public Graphics create() { return new EscherGraphics2d(_escherGraphics); }
public void drawString(AttributedCharacterIterator attributedcharacteriterator, float x, float y) { TextLayout textlayout = new TextLayout(attributedcharacteriterator, getFontRenderContext()); Paint paint1 = getPaint(); setColor(getColor()); fill(textlayout.getOutline(AffineTransform.getTranslateInstance(x, y))); setPaint(paint1); }
public void clipRect(int x, int y, int width, int height) { clip(new Rectangle(x,y,width,height)); }
public void clearRect(int i, int j, int k, int l) { Paint paint1 = getPaint(); setColor(getBackground()); fillRect(i, j, k, l); setPaint(paint1); }
/** * Constructs one escher graphics object from an escher graphics object. * * @param escherGraphics the original EscherGraphics2d object to copy */ public EscherGraphics2d(EscherGraphics escherGraphics) { this._escherGraphics = escherGraphics; setImg( new BufferedImage(1, 1, 2) ); setColor(Color.black); }
private static void drawStar( EscherGraphics2d g2d ) { g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); for (double i = 0; i < Math.PI; i += 0.1) { g2d.setColor( new Color((int)(i * 5343062d) ) ); int x1 = (int) ( Math.cos(i) * 160.0 ) + 160; int y1 = (int) ( Math.sin(i) * 138.0 ) + 138; int x2 = (int) ( -Math.cos(i) * 160.0 ) + 160; int y2 = (int) ( -Math.sin(i) * 138.0 ) + 138; g2d.setStroke(new BasicStroke(2)); g2d.drawLine(x1,y1,x2,y2); } g2d.setFont(new Font("SansSerif",Font.BOLD | Font.ITALIC, 20)); g2d.drawString("EscherGraphics2d",70,100); g2d.setColor(Color.yellow); g2d.fillOval( 160-20,138-20,40,40); g2d.setColor(Color.black); g2d.fillPolygon(new int[] {-10+160,0+160,10+160,0+160}, new int[] {0+138,10+138,0+138,-10+138}, 4); g2d.drawPolygon(new int[] {-160+160,0+160,160+160,0+160}, new int[] {0+138,138+138,0+138,-138+138}, 4); } }
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) { return drawImage(img, x,y,width,height, null, observer); }
public void drawPolyline(int xPoints[], int yPoints[], int nPoints) { if(nPoints > 0) { GeneralPath generalpath = new GeneralPath(); generalpath.moveTo(xPoints[0], yPoints[0]); for(int j = 1; j < nPoints; j++) generalpath.lineTo(xPoints[j], yPoints[j]); draw(generalpath); } }
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { fill(new java.awt.geom.RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight)); }
public void setPaint(Paint paint1) { if(paint1 != null) { _paint = paint1; if(paint1 instanceof Color) setColor( (Color)paint1 ); } }
public void draw(Shape shape) { if (shape instanceof Line2D) { Line2D shape2d = (Line2D) shape; int width = 0; if (_stroke != null && _stroke instanceof BasicStroke) { width = (int) ((BasicStroke)_stroke).getLineWidth() * 12700; } drawLine((int)shape2d.getX1(), (int)shape2d.getY1(), (int)shape2d.getX2(), (int)shape2d.getY2(), width); } else { if (logger.check(POILogger.WARN)) logger.log(POILogger.WARN, "draw not fully supported"); } }
public void drawRenderableImage(RenderableImage renderableimage, AffineTransform affinetransform) { drawRenderedImage(renderableimage.createDefaultRendering(), affinetransform); }
public void clearRect(int i, int j, int k, int l) { Paint paint1 = getPaint(); setColor(getBackground()); fillRect(i, j, k, l); setPaint(paint1); }
public boolean drawImage(Image image, int x, int y, ImageObserver imageobserver) { return drawImage(image, x, y, image.getWidth(imageobserver), image.getHeight(imageobserver), imageobserver); }
/** * Constructs one escher graphics object from an escher graphics object. * * @param escherGraphics the original EscherGraphics2d object to copy */ public EscherGraphics2d(EscherGraphics escherGraphics) { this._escherGraphics = escherGraphics; setImg( new BufferedImage(1, 1, 2) ); setColor(Color.black); }
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) { draw(new java.awt.geom.Arc2D.Float(x, y, width, height, startAngle, arcAngle, 0)); }
public void drawGlyphVector(GlyphVector g, float x, float y) { fill(g.getOutline(x, y)); }
public void setPaint(Paint paint1) { if(paint1 != null) { _paint = paint1; if(paint1 instanceof Color) setColor( (Color)paint1 ); } }