org.apache.poi.sl.draw
Class DrawShape

java.lang.Object
  extended by org.apache.poi.sl.draw.DrawShape
All Implemented Interfaces:
Drawable
Direct Known Subclasses:
DrawBackground, DrawGraphicalFrame, DrawGroupShape, DrawSimpleShape, DrawTableShape

public class DrawShape
extends java.lang.Object
implements Drawable


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.poi.sl.draw.Drawable
Drawable.DrawableHint
 
Field Summary
protected  Shape<?,?> shape
           
 
Fields inherited from interface org.apache.poi.sl.draw.Drawable
CURRENT_SLIDE, DRAW_FACTORY, FONT_FALLBACK, FONT_HANDLER, FONT_MAP, GRADIENT_SHAPE, GRESTORE, GROUP_TRANSFORM, GSAVE, IMAGE_RENDERER, PRESET_GEOMETRY_CACHE, TEXT_AS_CHARACTERS, TEXT_AS_SHAPES, TEXT_RENDERING_MODE
 
Constructor Summary
DrawShape(Shape<?,?> shape)
           
 
Method Summary
 void applyTransform(java.awt.Graphics2D graphics)
          Apply 2-D transforms before drawing this shape.
 void draw(java.awt.Graphics2D graphics)
          Draw this shape into the supplied canvas
 void drawContent(java.awt.Graphics2D graphics)
          draw any content within this shape (image, text, etc.).
static java.awt.geom.Rectangle2D getAnchor(java.awt.Graphics2D graphics, PlaceableShape<?,?> shape)
           
static java.awt.geom.Rectangle2D getAnchor(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D anchor)
           
protected  Shape<?,?> getShape()
           
protected static java.awt.BasicStroke getStroke(StrokeStyle strokeStyle)
           
protected static boolean isHSLF(Shape<?,?> shape)
          Sometimes it's necessary to distinguish between XSLF/HSLF for the rendering.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shape

protected final Shape<?,?> shape
Constructor Detail

DrawShape

public DrawShape(Shape<?,?> shape)
Method Detail

isHSLF

protected static boolean isHSLF(Shape<?,?> shape)
Sometimes it's necessary to distinguish between XSLF/HSLF for the rendering. Use this method on the shape to determine, if we work on the BIFF implementation

Parameters:
shape - the shape to render
Returns:
true if HSLF implementation is used

applyTransform

public void applyTransform(java.awt.Graphics2D graphics)
Apply 2-D transforms before drawing this shape. This includes rotation and flipping.

Specified by:
applyTransform in interface Drawable
Parameters:
graphics - the graphics whos transform matrix will be modified

draw

public void draw(java.awt.Graphics2D graphics)
Description copied from interface: Drawable
Draw this shape into the supplied canvas

Specified by:
draw in interface Drawable
Parameters:
graphics - the graphics to draw into

drawContent

public void drawContent(java.awt.Graphics2D graphics)
Description copied from interface: Drawable
draw any content within this shape (image, text, etc.).

Specified by:
drawContent in interface Drawable
Parameters:
graphics - the graphics to draw into

getAnchor

public static java.awt.geom.Rectangle2D getAnchor(java.awt.Graphics2D graphics,
                                                  PlaceableShape<?,?> shape)

getAnchor

public static java.awt.geom.Rectangle2D getAnchor(java.awt.Graphics2D graphics,
                                                  java.awt.geom.Rectangle2D anchor)

getShape

protected Shape<?,?> getShape()

getStroke

protected static java.awt.BasicStroke getStroke(StrokeStyle strokeStyle)