Package org.apache.poi.sl.draw
Class DrawFactory
java.lang.Object
org.apache.poi.sl.draw.DrawFactory
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawShape(Graphics2D graphics, Shape<?, ?> shape, Rectangle2D bounds) Convenience method for drawing single shapes.voidfixFonts(Graphics2D graphics) Replace font families for Windows JVM 6, which contains a font rendering error.getDrawable(Background<?, ?> shape) getDrawable(ConnectorShape<?, ?> shape) getDrawable(FreeformShape<?, ?> shape) getDrawable(GraphicalFrame<?, ?> shape) getDrawable(GroupShape<?, ?> shape) getDrawable(MasterSheet<?, ?> sheet) getDrawable(PictureShape<?, ?> shape) getDrawable(Shape<?, ?> shape) getDrawable(Sheet<?, ?> sheet) getDrawable(Slide<?, ?> sheet) getDrawable(TableShape<?, ?> shape) getDrawable(TextBox<?, ?> shape) getDrawable(TextParagraph<?, ?, ?> paragraph) getDrawable(TextShape<?, ?> shape) getFontManager(Graphics2D graphics) Return a FontManager, either registered beforehand or a default implementationstatic DrawFactorygetInstance(Graphics2D graphics) Returns the DrawFactory, preferably via a graphics instance.getPaint(PlaceableShape<?, ?> shape) getTextFragment(TextLayout layout, AttributedString str) static voidsetDefaultFactory(DrawFactory factory) Set a custom draw factory for the current thread.
-
Field Details
-
defaultFactory
-
-
Constructor Details
-
DrawFactory
public DrawFactory()
-
-
Method Details
-
setDefaultFactory
Set a custom draw factory for the current thread. This is a fallback, for operations where usercode can't set a graphics context. Preferably use the rendering hintDrawable.DRAW_FACTORYto set the factory.- Parameters:
factory-
-
getInstance
Returns the DrawFactory, preferably via a graphics instance. If graphics is null, the current thread local is checked or if it is not set, a new factory is created.- Parameters:
graphics- the current graphics context or null- Returns:
- the draw factory
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getDrawable
-
getTextFragment
-
getPaint
-
drawShape
Convenience method for drawing single shapes. For drawing whole slides, useSheet.draw(Graphics2D)- Parameters:
graphics- the graphics context to draw toshape- the shapebounds- the bounds within the graphics context to draw to
-
fixFonts
Replace font families for Windows JVM 6, which contains a font rendering error. This is likely to be removed, when POI upgrades to JDK 7- Parameters:
graphics- the graphics context which will contain the font mapping
-
getFontManager
Return a FontManager, either registered beforehand or a default implementation- Parameters:
graphics- the graphics context holding potentially a font manager- Returns:
- the font manager
-