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