public GraphicsConfiguration getDeviceConfiguration() { return getG2D().getDeviceConfiguration(); }
@Override public GraphicsConfiguration getDeviceConfiguration() { return groupG2D.getDeviceConfiguration(); }
public GraphicsConfiguration getDeviceConfiguration() { return delegate.getDeviceConfiguration(); }
/** Call this method before starting to use the graphic for good */ public void init() { if (delegate == null) { if (master instanceof DelayedBackbufferGraphic) { ((DelayedBackbufferGraphic) master).init(); } image = master.getDeviceConfiguration() .createCompatibleImage( screenSize.width, screenSize.height, Transparency.TRANSLUCENT); delegate = image.createGraphics(); delegate.setRenderingHints(master.getRenderingHints()); } }
/** * Glyph bounding boxes. */ @Override protected void showGlyph(Matrix textRenderingMatrix, PDFont font, int code, String unicode, Vector displacement) throws IOException { // draw glyph super.showGlyph(textRenderingMatrix, font, code, unicode, displacement); // bbox in EM -> user units Shape bbox = new Rectangle2D.Float(0, 0, font.getWidth(code) / 1000, 1); AffineTransform at = textRenderingMatrix.createAffineTransform(); bbox = at.createTransformedShape(bbox); // save Graphics2D graphics = getGraphics(); Color color = graphics.getColor(); Stroke stroke = graphics.getStroke(); Shape clip = graphics.getClip(); // draw graphics.setClip(graphics.getDeviceConfiguration().getBounds()); graphics.setColor(Color.RED); graphics.setStroke(new BasicStroke(.5f)); graphics.draw(bbox); // restore graphics.setStroke(stroke); graphics.setColor(color); graphics.setClip(clip); }
/** * Filled path bounding boxes. */ @Override public void fillPath(int windingRule) throws IOException { // bbox in user units Shape bbox = getLinePath().getBounds2D(); // draw path (note that getLinePath() is now reset) super.fillPath(windingRule); // save Graphics2D graphics = getGraphics(); Color color = graphics.getColor(); Stroke stroke = graphics.getStroke(); Shape clip = graphics.getClip(); // draw graphics.setClip(graphics.getDeviceConfiguration().getBounds()); graphics.setColor(Color.GREEN); graphics.setStroke(new BasicStroke(.5f)); graphics.draw(bbox); // restore graphics.setStroke(stroke); graphics.setColor(color); graphics.setClip(clip); }
private boolean isBitonal(Graphics2D graphics) { GraphicsConfiguration deviceConfiguration = graphics.getDeviceConfiguration(); if (deviceConfiguration == null) { return false; } GraphicsDevice device = deviceConfiguration.getDevice(); if (device == null) { return false; } DisplayMode displayMode = device.getDisplayMode(); if (displayMode == null) { return false; } return displayMode.getBitDepth() == 1; }
graphics.setClip(graphics.getDeviceConfiguration().getBounds()); graphics.setColor(Color.cyan); graphics.setStroke(new BasicStroke(.5f));
@Override public GraphicsConfiguration getDeviceConfiguration() { return groupG2D.getDeviceConfiguration(); }
/** * @see Graphics2D#getDeviceConfiguration() */ public GraphicsConfiguration getDeviceConfiguration() { return dg2.getDeviceConfiguration(); }
/** * Returns the device configuration associated with this <code>Graphics2D</code>. * * @return the device configuration of this <code>Graphics2D</code>. */ public GraphicsConfiguration getDeviceConfiguration() { return parent.getDeviceConfiguration(); }
/** * @see Graphics2D#getDeviceConfiguration() */ public GraphicsConfiguration getDeviceConfiguration() { return dg2.getDeviceConfiguration(); }
if (graphics.getDeviceConfiguration() != null && graphics.getDeviceConfiguration().getDevice() != null) deviceType = graphics.getDeviceConfiguration().getDevice().getType();
public GraphicsConfiguration getDeviceConfiguration() { System.out.println( "getDeviceConfiguration():" ); return g2D.getDeviceConfiguration(); }
/** * @see Graphics2D#getDeviceConfiguration() */ @Override public GraphicsConfiguration getDeviceConfiguration() { return getDG2().getDeviceConfiguration(); }
/** * Call this method before starting to use the graphic for good */ public void init() { if (delegate == null) { image = master.getDeviceConfiguration().createCompatibleImage(screenSize.width, screenSize.height, Transparency.TRANSLUCENT); delegate = image.createGraphics(); delegate.setRenderingHints(master.getRenderingHints()); } }
@Override public GraphicsConfiguration getDeviceConfiguration() { Graphics2D gr = getProxy(); copyGraphicsParams(gr); GraphicsConfiguration gc = gr.getDeviceConfiguration(); gr.dispose(); return gc; }
@Override public GraphicsConfiguration getDeviceConfiguration() { Graphics2D gr = getProxy(); copyGraphicsParams(gr); GraphicsConfiguration gc = gr.getDeviceConfiguration(); gr.dispose(); return gc; }
/** * This method perfectly detects retina Graphics2D for jdk7+ * For Apple JDK6 it returns false. * * @param g graphics to be tested * @return false if the device of the Graphics2D is not a retina device, * jdk is an Apple JDK or Oracle API has been changed. */ private static boolean isMacRetina(Graphics2D g) { GraphicsDevice device = g.getDeviceConfiguration().getDevice(); return isOracleMacRetinaDevice(device); }
protected LayoutContext newLayoutContext(Graphics2D g) { XRLog.layout(Level.FINEST, "new context begin"); getSharedContext().setCanvas(this); XRLog.layout(Level.FINEST, "new context end"); LayoutContext result = getSharedContext().newLayoutContextInstance(); Graphics2D layoutGraphics = g.getDeviceConfiguration().createCompatibleImage(1, 1).createGraphics(); result.setFontContext(new Java2DFontContext(layoutGraphics)); getSharedContext().getTextRenderer().setup(result.getFontContext()); return result; }