, 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;
CustomGeometry geom = sh.getGeometry(); if(geom == null) { return lst;
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); } } }
@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()); 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);
private boolean isPlaceholder(HSLFShape shape) { return shape instanceof SimpleShape && ((SimpleShape)shape).isPlaceholder(); }
protected void applyPaint(SimpleShape<?,?> shape) { if (_paint instanceof Color) { shape.setFillColor((Color)_paint); } } }
public BasicStroke getStroke() { return getStroke(getShape().getStrokeStyle()); }
/** * Checks if this {@code sheet} displays the specified shape. * * Subclasses can override it and skip certain shapes from drawings, * for instance, slide masters and layouts don't display placeholders */ @Override protected boolean canDraw(Graphics2D graphics, Shape<?,?> shape) { Slide<?,?> slide = (Slide<?,?>)graphics.getRenderingHint(Drawable.CURRENT_SLIDE); if (shape instanceof SimpleShape) { // in XSLF, slidenumber and date shapes aren't marked as placeholders opposed to HSLF Placeholder ph = ((SimpleShape<?,?>)shape).getPlaceholder(); if (ph != null) { return slide.getDisplayPlaceholder(ph); } } return slide.getFollowMasterGraphics(); } }
@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()); 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);
private boolean isPlaceholder(HSLFShape shape) { return shape instanceof SimpleShape && ((SimpleShape)shape).isPlaceholder(); }
protected void applyPaint(SimpleShape<?,?> shape) { if (_paint instanceof Color) { shape.setFillColor((Color)_paint); } } }
public BasicStroke getStroke() { return getStroke(getShape().getStrokeStyle()); }
/** * Checks if this {@code sheet} displays the specified shape. * * Subclasses can override it and skip certain shapes from drawings, * for instance, slide masters and layouts don't display placeholders */ @Override protected boolean canDraw(Graphics2D graphics, Shape<?,?> shape) { Slide<?,?> slide = (Slide<?,?>)graphics.getRenderingHint(Drawable.CURRENT_SLIDE); if (shape instanceof SimpleShape) { // in XSLF, slidenumber and date shapes aren't marked as placeholders opposed to HSLF Placeholder ph = ((SimpleShape<?,?>)shape).getPlaceholder(); if (ph != null) { return slide.getDisplayPlaceholder(ph); } } return slide.getFollowMasterGraphics(); } }
, 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;
/** * Checks if the shape is a placeholder. * (placeholders aren't normal shapes, they are visible only in the Edit Master mode) * * * @return true if the shape is a placeholder * * @deprecated use {@link SimpleShape#isPlaceholder()} */ @Deprecated @Removal(version="4.1.0") public static boolean isPlaceholder(HSLFShape shape){ return shape instanceof SimpleShape && ((SimpleShape<?,?>)shape).isPlaceholder(); } }
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); } } }
CustomGeometry geom = sh.getGeometry(); if(geom == null) { return lst;