public Drawable getDrawable(Shape<?,?> shape) { if (shape instanceof TextBox) { return getDrawable((TextBox<?,?>)shape); } else if (shape instanceof FreeformShape) { return getDrawable((FreeformShape<?,?>)shape); } else if (shape instanceof TextShape) { return getDrawable((TextShape<?,?>)shape); } else if (shape instanceof TableShape) { return getDrawable((TableShape<?,?>)shape); } else if (shape instanceof GroupShape) { return getDrawable((GroupShape<?,?>)shape); } else if (shape instanceof PictureShape) { return getDrawable((PictureShape<?,?>)shape); } else if (shape instanceof GraphicalFrame) { return getDrawable((GraphicalFrame<?,?>)shape); } else if (shape instanceof Background) { return getDrawable((Background<?,?>)shape); } else if (shape instanceof ConnectorShape) { return getDrawable((ConnectorShape<?,?>)shape); } else if (shape instanceof Slide) { return getDrawable((Slide<?,?>)shape); } else if (shape instanceof MasterSheet) { return getDrawable((MasterSheet<?,?>)shape); } else if (shape instanceof Sheet) { return getDrawable((Sheet<?,?>)shape); } else if (shape.getClass().isAnnotationPresent(DrawNotImplemented.class)) { return new DrawNothing(shape);
protected Drawable getGroupShape(Graphics2D graphics) { if (shape instanceof GroupShape) { DrawFactory df = DrawFactory.getInstance(graphics); return df.getDrawable((GroupShape<?,?>)shape); } return null; }
/** * Render this sheet into the supplied graphics object * * @param graphics the graphics context to draw to */ @Override public void draw(Graphics2D graphics){ DrawFactory drawFact = DrawFactory.getInstance(graphics); Drawable draw = drawFact.getDrawable(this); draw.draw(graphics); }
@Override public double getTextHeight(Graphics2D graphics) { DrawFactory drawFact = DrawFactory.getInstance(graphics); DrawTextShape dts = drawFact.getDrawable(this); return dts.getTextHeight(graphics); }
/** * Render this sheet into the supplied graphics object * * @param graphics the graphics context to draw to */ @Override public void draw(Graphics2D graphics){ DrawFactory drawFact = DrawFactory.getInstance(graphics); Drawable draw = drawFact.getDrawable(this); draw.draw(graphics); }
public void draw(Graphics2D graphics) { graphics.setRenderingHint(Drawable.CURRENT_SLIDE, this.sheet); Background<?,?> bg = sheet.getBackground(); if(bg != null) { DrawFactory drawFact = DrawFactory.getInstance(graphics); Drawable db = drawFact.getDrawable(bg); db.draw(graphics); } super.draw(graphics); graphics.setRenderingHint(Drawable.CURRENT_SLIDE, null); } }
public void draw(Graphics2D graphics) { // the coordinate system of this group of shape Rectangle2D interior = getShape().getInteriorAnchor(); // anchor of this group relative to the parent shape Rectangle2D exterior = getShape().getAnchor(); AffineTransform tx = (AffineTransform)graphics.getRenderingHint(Drawable.GROUP_TRANSFORM); AffineTransform tx0 = new AffineTransform(tx); double scaleX = interior.getWidth() == 0. ? 1.0 : exterior.getWidth() / interior.getWidth(); double scaleY = interior.getHeight() == 0. ? 1.0 : exterior.getHeight() / interior.getHeight(); tx.translate(exterior.getX(), exterior.getY()); tx.scale(scaleX, scaleY); tx.translate(-interior.getX(), -interior.getY()); DrawFactory drawFact = DrawFactory.getInstance(graphics); AffineTransform at2 = graphics.getTransform(); for (Shape<?,?> child : getShape()) { // remember the initial transform and restore it after we are done with the drawing AffineTransform at = graphics.getTransform(); graphics.setRenderingHint(Drawable.GSAVE, true); Drawable draw = drawFact.getDrawable(child); draw.applyTransform(graphics); draw.draw(graphics); // restore the coordinate system graphics.setTransform(at); graphics.setRenderingHint(Drawable.GRESTORE, true); } graphics.setTransform(at2); graphics.setRenderingHint(Drawable.GROUP_TRANSFORM, tx0); }
Drawable drawer = drawFact.getDrawable(master); drawer.draw(graphics); Drawable drawer = drawFact.getDrawable(shape); drawer.applyTransform(graphics);
public void draw(Graphics2D context) { PictureShape<?,?> ps = ((GraphicalFrame<?,?>)getShape()).getFallbackPicture(); if (ps == null) { return; } DrawPictureShape dps = DrawFactory.getInstance(context).getDrawable(ps); dps.draw(context); } }
Drawable d = getDrawable(shape); d.applyTransform(graphics); d.draw(graphics);
public void drawContent(Graphics2D graphics) { Drawable d = getGroupShape(graphics); if (d != null) { d.drawContent(graphics); return; } TableShape<?,?> ts = getShape(); DrawFactory df = DrawFactory.getInstance(graphics); final int rows = ts.getNumberOfRows(); final int cols = ts.getNumberOfColumns(); for (int row=0; row<rows; row++) { for (int col=0; col<cols; col++) { TableCell<?,?> tc = ts.getCell(row, col); if (tc != null) { DrawTextShape dts = df.getDrawable(tc); dts.drawContent(graphics); } } } }
for (int autoNbrIdx=0; paragraphs.hasNext(); autoNbrIdx++){ TextParagraph<?,?,? extends TextRun> p = paragraphs.next(); DrawTextParagraph dp = fact.getDrawable(p); BulletStyle bs = p.getBulletStyle(); if (bs == null || bs.getAutoNumberingScheme() == null) {
DrawTextShape dts = df.getDrawable(tc); maxHeight = Math.max(maxHeight, dts.getTextHeight());
protected Drawable getGroupShape(Graphics2D graphics) { if (shape instanceof GroupShape) { DrawFactory df = DrawFactory.getInstance(graphics); return df.getDrawable((GroupShape<?,?>)shape); } return null; }
/** * Render this sheet into the supplied graphics object * * @param graphics the graphics context to draw to */ @Override public void draw(Graphics2D graphics){ DrawFactory drawFact = DrawFactory.getInstance(graphics); Drawable draw = drawFact.getDrawable(this); draw.draw(graphics); }
/** * Render this sheet into the supplied graphics object * * @param graphics the graphics context to draw to */ @Override public void draw(Graphics2D graphics){ DrawFactory drawFact = DrawFactory.getInstance(graphics); Drawable draw = drawFact.getDrawable(this); draw.draw(graphics); }
@Override public void draw(Graphics2D graphics) { DrawFactory drawFact = DrawFactory.getInstance(graphics); Drawable draw = drawFact.getDrawable(this); draw.draw(graphics); }
@Override public void draw(Graphics2D graphics) { DrawFactory drawFact = DrawFactory.getInstance(graphics); Drawable draw = drawFact.getDrawable(this); draw.draw(graphics); }
public void draw(Graphics2D graphics) { graphics.setRenderingHint(Drawable.CURRENT_SLIDE, this.sheet); Background<?,?> bg = sheet.getBackground(); if(bg != null) { DrawFactory drawFact = DrawFactory.getInstance(graphics); Drawable db = drawFact.getDrawable(bg); db.draw(graphics); } super.draw(graphics); graphics.setRenderingHint(Drawable.CURRENT_SLIDE, null); } }
public void draw(Graphics2D context) { PictureShape<?,?> ps = ((GraphicalFrame<?,?>)getShape()).getFallbackPicture(); if (ps == null) { return; } DrawPictureShape dps = DrawFactory.getInstance(context).getDrawable(ps); dps.draw(context); } }