@Override protected void drawStroke(Graphics2D g) { Ellipse2D.Double r = (Ellipse2D.Double) ellipse.clone(); double grow = AttributeKeys.getPerpendicularDrawGrowth(this); r.x -= grow; r.y -= grow; r.width += grow * 2; r.height += grow * 2; if (r.width > 0 && r.height > 0) { g.draw(r); } }
@Override protected void drawStroke(Graphics2D g) { RoundRectangle2D.Double r = (RoundRectangle2D.Double) roundrect.clone(); double grow = AttributeKeys.getPerpendicularDrawGrowth(this); r.x -= grow; r.y -= grow; r.width += grow * 2; r.height += grow * 2; r.arcwidth += grow * 2; r.archeight += grow * 2; if (r.width > 0 && r.height > 0) { g.draw(r); } } // SHAPE AND BOUNDS
@Override protected void drawStroke(Graphics2D g) { Rectangle2D.Double r = (Rectangle2D.Double) rectangle.clone(); double grow = AttributeKeys.getPerpendicularDrawGrowth(this); Geom.grow(r, grow, grow); g.draw(new Line2D.Double(r.x,r.y,r.x+r.width-1,r.y)); } }
@Override protected void drawStroke(Graphics2D g) { Rectangle2D.Double r = (Rectangle2D.Double) rectangle.clone(); double grow = AttributeKeys.getPerpendicularDrawGrowth(this); Geom.grow(r, grow, grow); g.draw(r); }
@Override protected void drawStroke(final Graphics2D g) { final Rectangle2D.Double r = (Rectangle2D.Double) bounds.clone(); final double grow = AttributeKeys.getPerpendicularDrawGrowth(this); Geom.grow(r, grow, grow); g.draw(r); }
@Override protected void drawStroke(Graphics2D g) { Rectangle2D.Double r = (Rectangle2D.Double) rectangle.clone(); double grow = AttributeKeys.getPerpendicularDrawGrowth(this); Geom.grow(r, grow, grow); g.draw(r); } // SHAPE AND BOUNDS
@Override protected void drawStroke(final Graphics2D g) { final Rectangle2D.Double r = (Rectangle2D.Double) bounds.clone(); final double grow = AttributeKeys.getPerpendicularDrawGrowth(this); Geom.grow(r, grow, grow); g.draw(r); }
/** * Returns the distance, that a Rectangle needs to grow (or shrink) to * make hit detections on a shape as specified by the FILL_UNDER_STROKE and STROKE_POSITION * attributes of a figure. * The value returned is the number of units that need to be grown (or shrunk) * perpendicular to a stroke on an outline of the shape. */ public static double getPerpendicularHitGrowth(Figure f) { double grow; if (f.get(STROKE_COLOR) == null) { grow = getPerpendicularFillGrowth(f); } else { double strokeWidth = AttributeKeys.getStrokeTotalWidth(f); grow = getPerpendicularDrawGrowth(f) + strokeWidth / 2d; } return grow; } }
@Override protected void drawStroke(Graphics2D g) { Shape triangle = getBezierPath(); double grow = AttributeKeys.getPerpendicularDrawGrowth(this); if (grow != 0d) { GrowStroke gs = new GrowStroke((float) grow, (float) (AttributeKeys.getStrokeTotalWidth(this) * get(STROKE_MITER_LIMIT)) ); triangle = gs.createStrokedShape(triangle); } g.draw(triangle); } @Override
@Override protected void drawStroke(Graphics2D g) { if (isClosed()) { double grow = AttributeKeys.getPerpendicularDrawGrowth(this); if (grow == 0d) { g.draw(path); } else { GrowStroke gs = new GrowStroke(grow, AttributeKeys.getStrokeTotalWidth(this) * get(STROKE_MITER_LIMIT)); g.draw(gs.createStrokedShape(path)); } } else { g.draw(getCappedPath()); } drawCaps(g); }
double grow = AttributeKeys.getPerpendicularDrawGrowth(this); if (grow != 0d) { double growx, growy;