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"); } }
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 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 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 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"); } }