public class DrawFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.ThreadLocal<DrawFactory> |
defaultFactory |
Constructor and Description |
---|
DrawFactory() |
Modifier and Type | Method and Description |
---|---|
void |
drawShape(java.awt.Graphics2D graphics,
Shape<?,?> shape,
java.awt.geom.Rectangle2D bounds)
Convenience method for drawing single shapes.
|
void |
fixFonts(java.awt.Graphics2D graphics)
Replace font families for Windows JVM 6, which contains a font rendering error.
|
DrawBackground |
getDrawable(Background<?,?> shape) |
DrawConnectorShape |
getDrawable(ConnectorShape<?,?> shape) |
DrawFreeformShape |
getDrawable(FreeformShape<?,?> shape) |
DrawGraphicalFrame |
getDrawable(GraphicalFrame<?,?> shape) |
DrawGroupShape |
getDrawable(GroupShape<?,?> shape) |
DrawMasterSheet |
getDrawable(MasterSheet<?,?> sheet) |
DrawPictureShape |
getDrawable(PictureShape<?,?> shape) |
Drawable |
getDrawable(Shape<?,?> shape) |
DrawSheet |
getDrawable(Sheet<?,?> sheet) |
DrawSlide |
getDrawable(Slide<?,?> sheet) |
DrawTableShape |
getDrawable(TableShape<?,?> shape) |
DrawTextBox |
getDrawable(TextBox<?,?> shape) |
DrawTextParagraph |
getDrawable(TextParagraph<?,?,?> paragraph) |
DrawTextShape |
getDrawable(TextShape<?,?> shape) |
DrawFontManager |
getFontManager(java.awt.Graphics2D graphics)
Return a FontManager, either registered beforehand or a default implementation
|
static DrawFactory |
getInstance(java.awt.Graphics2D graphics)
Returns the DrawFactory, preferably via a graphics instance.
|
DrawPaint |
getPaint(PlaceableShape<?,?> shape) |
DrawTextFragment |
getTextFragment(java.awt.font.TextLayout layout,
java.text.AttributedString str) |
static void |
setDefaultFactory(DrawFactory factory)
Set a custom draw factory for the current thread.
|
protected static final java.lang.ThreadLocal<DrawFactory> defaultFactory
public static void setDefaultFactory(DrawFactory factory)
Drawable.DRAW_FACTORY
to set the factory.factory
- public static DrawFactory getInstance(java.awt.Graphics2D graphics)
graphics
- the current graphics context or nullpublic DrawMasterSheet getDrawable(MasterSheet<?,?> sheet)
public DrawTextBox getDrawable(TextBox<?,?> shape)
public DrawFreeformShape getDrawable(FreeformShape<?,?> shape)
public DrawConnectorShape getDrawable(ConnectorShape<?,?> shape)
public DrawTableShape getDrawable(TableShape<?,?> shape)
public DrawTextShape getDrawable(TextShape<?,?> shape)
public DrawGroupShape getDrawable(GroupShape<?,?> shape)
public DrawPictureShape getDrawable(PictureShape<?,?> shape)
public DrawGraphicalFrame getDrawable(GraphicalFrame<?,?> shape)
public DrawTextParagraph getDrawable(TextParagraph<?,?,?> paragraph)
public DrawBackground getDrawable(Background<?,?> shape)
public DrawTextFragment getTextFragment(java.awt.font.TextLayout layout, java.text.AttributedString str)
public DrawPaint getPaint(PlaceableShape<?,?> shape)
public void drawShape(java.awt.Graphics2D graphics, Shape<?,?> shape, java.awt.geom.Rectangle2D bounds)
Sheet.draw(Graphics2D)
graphics
- the graphics context to draw toshape
- the shapebounds
- the bounds within the graphics context to draw topublic void fixFonts(java.awt.Graphics2D graphics)
graphics
- the graphics context which will contain the font mappingpublic DrawFontManager getFontManager(java.awt.Graphics2D graphics)
graphics
- the graphics context holding potentially a font managerCopyright 2018 The Apache Software Foundation or its licensors, as applicable.