public Stroke getStroke() { return AttributeKeys.getStroke(this); }
public Stroke getStroke() { return AttributeKeys.getStroke(this); }
/** * Draws the arrow tip in the direction specified by the given two * Points. (template method) */ @Override public void draw(Graphics2D g, Figure f, Point2D.Double p1, Point2D.Double p2) { Path2D.Double path = getTransformedDecoratorPath(f, p1, p2); Color color; if (isFilled) { if (isSolid) { color = f.get(STROKE_COLOR); } else { color = f.get(FILL_COLOR); } if (color != null) { g.setColor(color); g.fill(path); } } if (isStroked) { color = f.get(STROKE_COLOR); if (color != null) { g.setColor(color); g.setStroke(AttributeKeys.getStroke(f)); g.draw(path); } } }
@Override public void draw(Graphics2D g) { if (get(FILL_COLOR) != null) { g.setColor(get(FILL_COLOR)); drawFill(g); } if (get(STROKE_COLOR) != null && get(STROKE_WIDTH) > 0d) { g.setStroke(AttributeKeys.getStroke(this)); g.setColor(get(STROKE_COLOR)); drawStroke(g); } if (get(TEXT_COLOR) != null) { if (get(TEXT_SHADOW_COLOR) != null && get(TEXT_SHADOW_OFFSET) != null) { Dimension2DDouble d = get(TEXT_SHADOW_OFFSET); g.translate(d.width, d.height); g.setColor(get(TEXT_SHADOW_COLOR)); drawText(g); g.translate(-d.width,-d.height); } g.setColor(get(TEXT_COLOR)); drawText(g); } }
@Override protected void drawFigure(Graphics2D g) { if (get(FILL_COLOR) != null) { g.setColor(get(FILL_COLOR)); drawFill(g); } drawImage(g); if (get(STROKE_COLOR) != null && get(STROKE_WIDTH) > 0d) { g.setStroke(AttributeKeys.getStroke(this)); g.setColor(get(STROKE_COLOR)); drawStroke(g); } if (get(TEXT_COLOR) != null) { if (get(TEXT_SHADOW_COLOR) != null && get(TEXT_SHADOW_OFFSET) != null) { Dimension2DDouble d = get(TEXT_SHADOW_OFFSET); g.translate(d.width, d.height); g.setColor(get(TEXT_SHADOW_COLOR)); drawText(g); g.translate(-d.width, -d.height); } g.setColor(get(TEXT_COLOR)); drawText(g); } }
public void drawFigure(Graphics2D g) { drawChildren(g); if (get(FILL_COLOR) != null) { g.setColor(get(FILL_COLOR)); drawFill(g); } if (get(STROKE_COLOR) != null && get(STROKE_WIDTH) > 0d) { g.setStroke(AttributeKeys.getStroke(this)); g.setColor(get(STROKE_COLOR)); drawStroke(g); } if (get(TEXT_COLOR) != null) { if (get(TEXT_SHADOW_COLOR) != null && get(TEXT_SHADOW_OFFSET) != null) { Dimension2DDouble d = get(TEXT_SHADOW_OFFSET); g.translate(d.width, d.height); g.setColor(get(TEXT_SHADOW_COLOR)); drawText(g); g.translate(-d.width, -d.height); } g.setColor(get(TEXT_COLOR)); drawText(g); } }