Package org.apache.poi.sl.draw
Interface Drawable
-
- All Known Implementing Classes:
DrawAutoShape,DrawBackground,DrawConnectorShape,DrawFreeformShape,DrawGraphicalFrame,DrawGroupShape,DrawMasterSheet,DrawNothing,DrawPictureShape,DrawShape,DrawSheet,DrawSimpleShape,DrawSlide,DrawTableShape,DrawTextBox,DrawTextFragment,DrawTextParagraph,DrawTextShape
public interface Drawable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDrawable.DrawableHint
-
Field Summary
Fields Modifier and Type Field Description static Drawable.DrawableHintBUFFERED_IMAGEStores a reference (WEAK_REFERENCE) to the buffered image, if the rendering is based on a buffered imagestatic Drawable.DrawableHintCACHE_IMAGE_SOURCEA boolean value to instruct the bitmap image renderer to keep the original image bytes.static Drawable.DrawableHintCURRENT_SLIDEThe Common SL Draw API works sometimes cascading, but there are places where the current slide context need to be evaluated, e.g.static Drawable.DrawableHintDEFAULT_CHARSETSets the default charset to render text elements.static Drawable.DrawableHintDRAW_FACTORYDrawFactorywhich will be used to draw objects into this graphics contextstatic Drawable.DrawableHintEMF_FORCE_HEADER_BOUNDSA boolean value to force the usage of the bounding box, which is specified in the EMF header.static Drawable.DrawableHintFONT_FALLBACKKey for a font fallback map of typeMap<String,String>which maps the original font family (key) to the fallback font family (value).static Drawable.DrawableHintFONT_HANDLERUse this object to resolve unknown / missing fonts when rendering slides.static Drawable.DrawableHintFONT_MAPKey for a font map of typeMap<String,String>which maps the original font family (key) to the mapped font family (value)static Drawable.DrawableHintGRADIENT_SHAPEPathGradientPaint needs the shape to be set.static Drawable.DrawableHintGRESTOREstatic Drawable.DrawableHintGROUP_TRANSFORMKey will be internally used to store affine transformation temporarily within group shapesstatic Drawable.DrawableHintGSAVEstatic Drawable.DrawableHintIMAGE_RENDERERUse a custom image renderer of an instance ofImageRendererstatic Drawable.DrawableHintPRESET_GEOMETRY_CACHEInternal key for caching the preset geometriesstatic intTEXT_AS_CHARACTERSstatic intTEXT_AS_SHAPESdraw text viaTextLayout.draw(java.awt.Graphics2D, float, float)static Drawable.DrawableHintTEXT_RENDERING_MODEhow to render text:TEXT_AS_CHARACTERS(default) means to draw viaGraphics2D.drawString(java.text.AttributedCharacterIterator, float, float).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyTransform(Graphics2D graphics)Apply 2-D transforms before drawing this shape.voiddraw(Graphics2D graphics)Draw this shape into the supplied canvasvoiddrawContent(Graphics2D graphics)draw any content within this shape (image, text, etc.).
-
-
-
Field Detail
-
DRAW_FACTORY
static final Drawable.DrawableHint DRAW_FACTORY
DrawFactorywhich will be used to draw objects into this graphics context
-
GROUP_TRANSFORM
@Internal static final Drawable.DrawableHint GROUP_TRANSFORM
Key will be internally used to store affine transformation temporarily within group shapes
-
IMAGE_RENDERER
static final Drawable.DrawableHint IMAGE_RENDERER
Use a custom image renderer of an instance ofImageRenderer
-
TEXT_RENDERING_MODE
static final Drawable.DrawableHint TEXT_RENDERING_MODE
how to render text:TEXT_AS_CHARACTERS(default) means to draw viaGraphics2D.drawString(java.text.AttributedCharacterIterator, float, float). This mode draws text as characters. Use it if the target graphics writes the actual character codes instead of glyph outlines (PDFGraphics2D, SVGGraphics2D, etc.)TEXT_AS_SHAPESmeans to render viaTextLayout.draw(java.awt.Graphics2D, float, float). This mode draws glyphs as shapes and provides some advanced capabilities such as justification and font substitution. Use it if the target graphics is an image.
-
GRADIENT_SHAPE
static final Drawable.DrawableHint GRADIENT_SHAPE
PathGradientPaint needs the shape to be set. It will be achieved through setting it in the rendering hints
-
PRESET_GEOMETRY_CACHE
static final Drawable.DrawableHint PRESET_GEOMETRY_CACHE
Internal key for caching the preset geometries
-
TEXT_AS_CHARACTERS
static final int TEXT_AS_CHARACTERS
- See Also:
- Constant Field Values
-
TEXT_AS_SHAPES
static final int TEXT_AS_SHAPES
draw text viaTextLayout.draw(java.awt.Graphics2D, float, float)- See Also:
- Constant Field Values
-
FONT_HANDLER
static final Drawable.DrawableHint FONT_HANDLER
Use this object to resolve unknown / missing fonts when rendering slides. The font handler must be of typeDrawFontManager.In case a
FONT_HANDLERis register,FONT_FALLBACKandFONT_MAPare ignored
-
FONT_FALLBACK
static final Drawable.DrawableHint FONT_FALLBACK
Key for a font fallback map of typeMap<String,String>which maps the original font family (key) to the fallback font family (value). In case there is also aFONT_MAPregistered, the original font is first mapped via the font_map and then the fallback font is determined
-
FONT_MAP
static final Drawable.DrawableHint FONT_MAP
Key for a font map of typeMap<String,String>which maps the original font family (key) to the mapped font family (value)
-
GSAVE
static final Drawable.DrawableHint GSAVE
-
GRESTORE
static final Drawable.DrawableHint GRESTORE
-
CURRENT_SLIDE
static final Drawable.DrawableHint CURRENT_SLIDE
The Common SL Draw API works sometimes cascading, but there are places where the current slide context need to be evaluated, e.g. when slide numbers are printed. In this situation we need to have a way to access the current slide
-
BUFFERED_IMAGE
static final Drawable.DrawableHint BUFFERED_IMAGE
Stores a reference (WEAK_REFERENCE) to the buffered image, if the rendering is based on a buffered image
-
DEFAULT_CHARSET
static final Drawable.DrawableHint DEFAULT_CHARSET
Sets the default charset to render text elements. Opposed to other windows libraries in POI this simply defaults to Windows-1252. The rendering value is of typeCharset
-
EMF_FORCE_HEADER_BOUNDS
static final Drawable.DrawableHint EMF_FORCE_HEADER_BOUNDS
A boolean value to force the usage of the bounding box, which is specified in the EMF header. Defaults toFALSE- in this case the records are scanned for window and viewport records to determine the initial bounding box by using the following condition:isValid(viewport) ? viewport : isValid(window) ? window : headerBoundsThis is a workaround switch, which might be removed in future releases, when the bounding box determination for the special cases is fixed. In most cases it's recommended to leave the default value.
-
CACHE_IMAGE_SOURCE
static final Drawable.DrawableHint CACHE_IMAGE_SOURCE
A boolean value to instruct the bitmap image renderer to keep the original image bytes. Defaults tofalseif unset.
-
-
Method Detail
-
applyTransform
void applyTransform(Graphics2D graphics)
Apply 2-D transforms before drawing this shape. This includes rotation and flipping.- Parameters:
graphics- the graphics whose transform matrix will be modified
-
draw
void draw(Graphics2D graphics)
Draw this shape into the supplied canvas- Parameters:
graphics- the graphics to draw into
-
drawContent
void drawContent(Graphics2D graphics)
draw any content within this shape (image, text, etc.).- Parameters:
graphics- the graphics to draw into
-
-