org.apache.poi.xslf.usermodel
Class XSLFShape

java.lang.Object
  extended by org.apache.poi.xslf.usermodel.XSLFShape
Direct Known Subclasses:
XSLFGraphicFrame, XSLFGroupShape, XSLFSimpleShape

@Beta
public abstract class XSLFShape
extends java.lang.Object

Base super-class class for all shapes in PresentationML

Author:
Yegor Kozlov

Constructor Summary
XSLFShape()
           
 
Method Summary
protected  void applyTransform(java.awt.Graphics2D graphics)
          Apply 2-D transforms before drawing this shape.
abstract  void draw(java.awt.Graphics2D graphics)
          Draw this shape into the supplied canvas
abstract  java.awt.geom.Rectangle2D getAnchor()
           
abstract  boolean getFlipHorizontal()
          Whether the shape is horizontally flipped
abstract  boolean getFlipVertical()
          Whether the shape is vertically flipped
abstract  double getRotation()
          Rotation angle in degrees
abstract  int getShapeId()
          Returns a unique identifier for this shape within the current document.
abstract  java.lang.String getShapeName()
           
abstract  org.apache.xmlbeans.XmlObject getXmlObject()
           
abstract  void setAnchor(java.awt.geom.Rectangle2D anchor)
           
abstract  void setFlipHorizontal(boolean flip)
           
abstract  void setFlipVertical(boolean flip)
          Whether the shape is vertically flipped
abstract  void setRotation(double theta)
          Rotate this shape.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSLFShape

public XSLFShape()
Method Detail

getAnchor

public abstract java.awt.geom.Rectangle2D getAnchor()
Returns:
the position of this shape within the drawing canvas. The coordinates are expressed in points

setAnchor

public abstract void setAnchor(java.awt.geom.Rectangle2D anchor)
Parameters:
anchor - the position of this shape within the drawing canvas. The coordinates are expressed in points

getXmlObject

public abstract org.apache.xmlbeans.XmlObject getXmlObject()
Returns:
the xml bean holding this shape's data

getShapeName

public abstract java.lang.String getShapeName()
Returns:
human-readable name of this shape, e.g. "Rectange 3"

getShapeId

public abstract int getShapeId()
Returns a unique identifier for this shape within the current document. This ID may be used to assist in uniquely identifying this object so that it can be referred to by other parts of the document.

If multiple objects within the same document share the same id attribute value, then the document shall be considered non-conformant.

Returns:
unique id of this shape

setRotation

public abstract void setRotation(double theta)
Rotate this shape.

Positive angles are clockwise (i.e., towards the positive y axis); negative angles are counter-clockwise (i.e., towards the negative y axis).

Parameters:
theta - the rotation angle in degrees.

getRotation

public abstract double getRotation()
Rotation angle in degrees

Positive angles are clockwise (i.e., towards the positive y axis); negative angles are counter-clockwise (i.e., towards the negative y axis).

Returns:
rotation angle in degrees

setFlipHorizontal

public abstract void setFlipHorizontal(boolean flip)
Parameters:
flip - whether the shape is horizontally flipped

setFlipVertical

public abstract void setFlipVertical(boolean flip)
Whether the shape is vertically flipped

Parameters:
flip - whether the shape is vertically flipped

getFlipHorizontal

public abstract boolean getFlipHorizontal()
Whether the shape is horizontally flipped

Returns:
whether the shape is horizontally flipped

getFlipVertical

public abstract boolean getFlipVertical()
Whether the shape is vertically flipped

Returns:
whether the shape is vertically flipped

draw

public abstract void draw(java.awt.Graphics2D graphics)
Draw this shape into the supplied canvas

Parameters:
graphics - the graphics to draw into

applyTransform

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

Parameters:
graphics - the graphics whos transform matrix will be modified


Copyright 2012 The Apache Software Foundation or its licensors, as applicable.