Top Fields Constructors Methods
org.apache.poi.sl.draw

public Class DrawShape

extends Object
implements Drawable
Class Inheritance
All Implemented Interfaces
org.apache.poi.sl.draw.Drawable
Known Direct Subclasses
org.apache.poi.sl.draw.DrawSimpleShape, org.apache.poi.sl.draw.DrawTableShape, org.apache.poi.sl.draw.DrawBackground, org.apache.poi.sl.draw.DrawGraphicalFrame, org.apache.poi.sl.draw.DrawGroupShape
Imports
java.awt.BasicStroke, .Graphics2D, java.awt.geom.AffineTransform, .Rectangle2D, java.util.Locale, org.apache.poi.sl.usermodel.PlaceableShape, .Shape, .StrokeStyle, .StrokeStyle.LineCap, .StrokeStyle.LineDash

Field Summary

Modifier and TypeField and Description
protected final Shape<?, ?>

Constructor Summary

AccessConstructor and Description
public
DrawShape(Shape<?, ?> shape)

Method Summary

Modifier and TypeMethod and Description
public void
applyTransform(Graphics2D
the graphics whose transform matrix will be modified
graphics
)

Implements org.apache.poi.sl.draw.Drawable.applyTransform.

Apply 2-D transforms before drawing this shape.

public void
draw(Graphics2D
the graphics to draw into
graphics
)

Implements org.apache.poi.sl.draw.Drawable.draw.

Draw this shape into the supplied canvas

public void
drawContent(Graphics2D
the graphics to draw into
graphics
)

Implements org.apache.poi.sl.draw.Drawable.drawContent.

draw any content within this shape (image, text, etc.).

private void
private void
public static Rectangle2D
getAnchor(Graphics2D graphics, PlaceableShape<?, ?> shape)

public static Rectangle2D
getAnchor(Graphics2D graphics, Rectangle2D anchor)

protected Shape<?, ?>
protected static BasicStroke
getStroke(StrokeStyle strokeStyle)

pack-priv static boolean

Returns:

true if HSLF implementation is used
isHSLF
(Object
the shape to render
shape
)

Sometimes it's necessary to distinguish between XSLF/HSLF for the rendering.

private void
rotate(Graphics2D graphics, Rectangle2D anchor)

private static double
safeScale(double dim1, double dim2)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

shapeback to summary
protected final Shape<?, ?> shape

Constructor Detail

DrawShapeback to summary
public DrawShape(Shape<?, ?> shape)

Method Detail

applyTransformback to summary
public void applyTransform(Graphics2D graphics)

Implements org.apache.poi.sl.draw.Drawable.applyTransform.

Apply 2-D transforms before drawing this shape. This includes rotation and flipping.

Parameters
graphics:Graphics2D

the graphics whose transform matrix will be modified

Annotations
@Override
drawback to summary
public void draw(Graphics2D graphics)

Implements org.apache.poi.sl.draw.Drawable.draw.

Doc from org.apache.poi.sl.draw.Drawable.draw.

Draw this shape into the supplied canvas

Parameters
graphics:Graphics2D

the graphics to draw into

Annotations
@Override
drawContentback to summary
public void drawContent(Graphics2D graphics)

Implements org.apache.poi.sl.draw.Drawable.drawContent.

Doc from org.apache.poi.sl.draw.Drawable.drawContent.

draw any content within this shape (image, text, etc.).

Parameters
graphics:Graphics2D

the graphics to draw into

Annotations
@Override
flipHorizontalback to summary
private void flipHorizontal(Graphics2D graphics, Rectangle2D anchor)
flipVerticalback to summary
private void flipVertical(Graphics2D graphics, Rectangle2D anchor)
getAnchorback to summary
public static Rectangle2D getAnchor(Graphics2D graphics, PlaceableShape<?, ?> shape)
getAnchorback to summary
public static Rectangle2D getAnchor(Graphics2D graphics, Rectangle2D anchor)
getShapeback to summary
protected Shape<?, ?> getShape()
getStrokeback to summary
protected static BasicStroke getStroke(StrokeStyle strokeStyle)
isHSLFback to summary
pack-priv static boolean isHSLF(Object 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:Object

the shape to render

Returns:boolean

true if HSLF implementation is used

rotateback to summary
private void rotate(Graphics2D graphics, Rectangle2D anchor)
safeScaleback to summary
private static double safeScale(double dim1, double dim2)