public void applyTransform(Graphics2D graphics) { Drawable d = getGroupShape(graphics); if (d != null) { d.applyTransform(graphics); } else { super.applyTransform(graphics); } }
@Override public FontInfo getFallbackFont(Graphics2D graphics, FontInfo fontInfo) { FontInfo fi = getFontWithFallback(graphics, Drawable.FONT_FALLBACK, fontInfo); if (fi == null) { fi = new DrawFontInfo(Font.SANS_SERIF); } return fi; }
/** * 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 context) { PictureShape<?,?> ps = ((GraphicalFrame<?,?>)getShape()).getFallbackPicture(); if (ps == null) { return; } DrawPictureShape dps = DrawFactory.getInstance(context).getDrawable(ps); dps.draw(context); } }
@Override public double getTextHeight(Graphics2D graphics) { DrawFactory drawFact = DrawFactory.getInstance(graphics); DrawTextShape dts = drawFact.getDrawable(this); return dts.getTextHeight(graphics); }
protected Drawable getGroupShape(Graphics2D graphics) { if (shape instanceof GroupShape) { DrawFactory df = DrawFactory.getInstance(graphics); return df.getDrawable((GroupShape<?,?>)shape); } return null; }
public Paint getPaint(Graphics2D graphics, PaintStyle paint, PaintModifier modifier) { if (modifier == PaintModifier.NONE) { return null; } if (paint instanceof SolidPaint) { return getSolidPaint((SolidPaint)paint, graphics, modifier); } else if (paint instanceof GradientPaint) { return getGradientPaint((GradientPaint)paint, graphics); } else if (paint instanceof TexturePaint) { return getTexturePaint((TexturePaint)paint, graphics); } return null; }
@Override public void draw(Graphics2D graphics, Rectangle2D bounds) { DrawFactory.getInstance(graphics).drawShape(graphics, this, bounds); }
/** * Fit picture shape into the target rectangle, maintaining the aspect ratio * and repositioning within the target rectangle with a centered alignment. * * @param target The target rectangle */ public void resize(Rectangle2D target) { resize(target, RectAlign.CENTER); }
/** * Compute the cumulative height occupied by the text * * @return the height in points */ public double getTextHeight() { return getTextHeight(null); }
public DrawPictureShape getDrawable(PictureShape<?,?> shape) { return new DrawPictureShape(shape); }
@Override public boolean drawImage( Graphics2D graphics, Rectangle2D anchor) { return drawImage(graphics, anchor, null); }
@SuppressWarnings({"WeakerAccess", "unused"}) protected Paint createPathGradientPaint(GradientPaint fill, Graphics2D graphics) { // currently we ignore an eventually center setting return safeFractions(PathGradientPaint::new, fill); }
@Override public void loadImage(InputStream data, String contentType) throws IOException { img = readImage(data, contentType); }
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform transform, RenderingHints hints) { return new PathGradientContext(cm, deviceBounds, userBounds, transform, hints); }
/** * Sets this graphics context's current color to the specified * color. All subsequent graphics operations using this graphics * context use this specified color. * @param c the new rendering color. * @see java.awt.Color * @see java.awt.Graphics#getColor */ public void setColor(Color c) { setPaint(c); }
public DrawSheet getDrawable(Sheet<?,?> sheet) { return new DrawSheet(sheet); }
public DrawGroupShape getDrawable(GroupShape<?,?> shape) { return new DrawGroupShape(shape); }
/** * 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); }