@Override public void draw(Graphics2D graphics) { DrawPaint drawPaint = DrawFactory.getInstance(graphics).getPaint(getShape()); Paint fill = drawPaint.getPaint(graphics, getShape().getFillStyle().getPaint()); Paint line = drawPaint.getPaint(graphics, getShape().getStrokeStyle().getPaint()); BasicStroke stroke = getStroke(); // the stroke applies both to the shadow and the shape graphics.setStroke(stroke); Collection<Outline> elems = computeOutlines(graphics); drawShadow(graphics, elems, fill, line); for (Outline o : elems) { if (o.getPath().isFilled()){ Paint fillMod = drawPaint.getPaint(graphics, getShape().getFillStyle().getPaint(), o.getPath().getFill()); if (fillMod != null) { graphics.setPaint(fillMod); drawContent(graphics); drawDecoration(graphics, line, stroke);
protected static CustomGeometry getCustomGeometry(String name) { return getCustomGeometry(name, null); }
protected void drawDecoration(Graphics2D graphics, Paint line, BasicStroke stroke) { if(line == null) { return; } graphics.setPaint(line); List<Outline> lst = new ArrayList<>(); LineDecoration deco = getShape().getLineDecoration(); Outline head = getHeadDecoration(graphics, deco, stroke); if (head != null) { lst.add(head); } Outline tail = getTailDecoration(graphics, deco, stroke); if (tail != null) { lst.add(tail); } for(Outline o : lst){ java.awt.Shape s = o.getOutline(); Path p = o.getPath(); graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, s); if(p.isFilled()) { graphics.fill(s); } if(p.isStroked()) { graphics.draw(s); } } }
, Paint line ) { Shadow<?,?> shadow = getShape().getShadow(); if (shadow == null || (fill == null && line == null)) { return; Color shadowColor = DrawPaint.applyColorTransform(shadowPaint.getSolidColor()); double shapeRotation = getShape().getRotation(); if(getShape().getFlipVertical()) { shapeRotation += 180;
protected void drawDecoration(Graphics2D graphics, Paint line, BasicStroke stroke) { if(line == null) { return; } graphics.setPaint(line); List<Outline> lst = new ArrayList<>(); LineDecoration deco = getShape().getLineDecoration(); Outline head = getHeadDecoration(graphics, deco, stroke); if (head != null) { lst.add(head); } Outline tail = getTailDecoration(graphics, deco, stroke); if (tail != null) { lst.add(tail); } for(Outline o : lst){ java.awt.Shape s = o.getOutline(); Path p = o.getPath(); graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, s); if(p.isFilled()) { graphics.fill(s); } if(p.isStroked()) { graphics.draw(s); } } }
, Paint line ) { Shadow<?,?> shadow = getShape().getShadow(); if (shadow == null || (fill == null && line == null)) { return; Color shadowColor = DrawPaint.applyColorTransform(shadowPaint.getSolidColor()); double shapeRotation = getShape().getRotation(); if(getShape().getFlipVertical()) { shapeRotation += 180;
@Override public void draw(Graphics2D graphics) { DrawPaint drawPaint = DrawFactory.getInstance(graphics).getPaint(getShape()); Paint fill = drawPaint.getPaint(graphics, getShape().getFillStyle().getPaint()); Paint line = drawPaint.getPaint(graphics, getShape().getStrokeStyle().getPaint()); BasicStroke stroke = getStroke(); // the stroke applies both to the shadow and the shape graphics.setStroke(stroke); Collection<Outline> elems = computeOutlines(graphics); drawShadow(graphics, elems, fill, line); for (Outline o : elems) { if (o.getPath().isFilled()){ Paint fillMod = drawPaint.getPaint(graphics, getShape().getFillStyle().getPaint(), o.getPath().getFill()); if (fillMod != null) { graphics.setPaint(fillMod); drawContent(graphics); drawDecoration(graphics, line, stroke);
protected static CustomGeometry getCustomGeometry(String name) { return getCustomGeometry(name, null); }