public GeneralPath makeMarkerPath(Diagram diagram){ if(points.size() != 1) return null; ShapePoint center = (ShapePoint) this.getPoint(0); float diameter = (float) 0.7 * Math.min(diagram.getCellWidth(), diagram.getCellHeight()); return new GeneralPath(new Ellipse2D.Float( center.x - diameter/2, center.y - diameter/2, diameter, diameter)); }
public static void debugIntersections(Graphics2D g, Page page) { int i = 0; for (Point2D p : Ruling.findIntersections(page.getHorizontalRulings(), page.getVerticalRulings()).keySet()) { g.setColor(COLORS[(i++) % 5]); g.fill(new Ellipse2D.Float((float) p.getX() - CIRCLE_RADIUS / 2f, (float) p.getY() - CIRCLE_RADIUS / 2f, 5f, 5f)); } }
public DebugDrawJ2D(TestPanelJ2D argTestPanel, boolean yFlip) { panel = argTestPanel; this.yFlip = yFlip; stroke = new BasicStroke(0); circle = new Ellipse2D.Float(-1, -1, 2, 2); }
private Shape getOuterDecoration() { if (outerDecoration == null) { float W = 523; float H = 174; outerDecoration = new Area(new Ellipse2D.Float(0, 0, W, H)); outerDecoration.subtract(new Area(new Ellipse2D.Float(16, 5, W - 2 * 16, H - 2 * 5))); outerDecoration.subtract(new Area(new Rectangle2D.Float(W / 2, 0, W / 2, H / 2))); outerDecoration.subtract(new Area(new Rectangle2D.Float(0, H / 2, W / 2, H / 2))); } return outerDecoration; }
private void drawMiddleEllipse(Graphics2D g) { transform(g, null); Shape ellipse = new Ellipse2D.Float(68, 38, 440, 146); g.setColor(DARK_GREEN_ALPHA_80); g.fill(ellipse); g.setColor(GREEN_ALPHA_40); g.setStroke(THIN_STROKE); g.draw(ellipse); }
public class CircleShapeGenerator implements ShapeGenerator { public Shape getGeneratedShape(int x, int y) { return new Ellipse2D.Float(x, y, 10, 10); } }
/** * Fills an oval bounded by the specified rectangle with the current color. * * @param x the <i>x</i> coordinate of the upper left corner of the oval to be filled. * @param y the <i>y</i> coordinate of the upper left corner of the oval to be filled. * @param width the width of the oval to be filled. * @param height the height of the oval to be filled. * @see Graphics#drawOval */ public void fillOval( final int x, final int y, final int width, final int height ) { parent.fill( new Ellipse2D.Float( x, y, width, height ) ); }
/** * @see Graphics#drawOval(int, int, int, int) */ @Override public void drawOval( final int x, final int y, final int width, final int height ) { final Ellipse2D oval = new Ellipse2D.Float( x, y, width, height ); draw( oval ); }
/** * */ public Shape createShape(mxGraphics2DCanvas canvas, mxCellState state) { Rectangle temp = state.getRectangle(); return new Ellipse2D.Float(temp.x, temp.y, temp.width, temp.height); }
/** Expects @param a in local coords. */ @Override public boolean intersects(final Area a) { if (0 == r) return a.contains(x, y); return M.intersects(a, new Area(new Ellipse2D.Float(x-r, y-r, r+r, r+r))); // TODO: not the getSegment() ? }
@Override public Area getArea() { if (0 == r) return super.getArea(); // a little square return new Area(new Ellipse2D.Float(x-r, y-r, r+r, r+r)); }
@Override public void paintData(final Graphics2D g, final Rectangle srcRect, final Tree<Float> tree, final AffineTransform to_screen, final Color cc, final Layer active_layer) { g.setColor(cc); g.draw(to_screen.createTransformedShape(new Ellipse2D.Float(x -r, y -r, r+r, r+r))); }
private Shape getInnerDecoration() { if (innerDecoration == null) { innerDecoration = new Area(new Ellipse2D.Float(0, 0, 368, 120)); innerDecoration.subtract(new Area(new Rectangle2D.Float(Float.MIN_VALUE, 30, Float.MAX_VALUE, 56))); innerDecoration.subtract(new Area(new Rectangle2D.Float(181, Float.MIN_VALUE, 7, Float.MAX_VALUE))); } return innerDecoration; }
private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0); private RoundRectangle2D roundRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0); private Ellipse2D ellipse = new Ellipse2D.Float(0, 0, 0, 0);
private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0); private RoundRectangle2D roundRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0); private Ellipse2D ellipse = new Ellipse2D.Float(0, 0, 0, 0);
shape = new Ellipse2D.Float(0, 0, getWidth(), getHeight());
return new Ellipse2D.Float( -windBarbDefinition.zeroWindRadius / 2.0f, // the X coordinate of the upper-left corner of the specified
public GeometryRenderer() { setStrokeWidth(2f); setAutoPopulateSeriesShape(false); setBaseShape(new Ellipse2D.Float(-3, -3, 6, 6)); }
@Implementation protected void addCircle(float x, float y, float radius, Path.Direction dir) { mPath.append(new Ellipse2D.Float(x - radius, y - radius, radius * 2, radius * 2), false); }
@Implementation(minSdk = LOLLIPOP) protected void addOval(float left, float top, float right, float bottom, Path.Direction dir) { mPath.append(new Ellipse2D.Float(left, top, right - left, bottom - top), false); }