org.apache.poi.hslf.model
Class AutoShape

java.lang.Object
  extended by org.apache.poi.hslf.model.Shape
      extended by org.apache.poi.hslf.model.SimpleShape
          extended by org.apache.poi.hslf.model.TextShape
              extended by org.apache.poi.hslf.model.AutoShape
Direct Known Subclasses:
Freeform, Polygon

public class AutoShape
extends TextShape

Represents an AutoShape.

AutoShapes are drawing objects with a particular shape that may be customized through smart resizing and adjustments. See ShapeTypes

Author:
Yegor Kozlov

Field Summary
 
Fields inherited from class org.apache.poi.hslf.model.TextShape
_frc, _txtbox, _txtrun, AlignCenter, AlignJustify, AlignLeft, AlignRight, AnchorBottom, AnchorBottomBaseline, AnchorBottomCentered, AnchorBottomCenteredBaseline, AnchorMiddle, AnchorMiddleCentered, AnchorTop, AnchorTopBaseline, AnchorTopCentered, AnchorTopCenteredBaseline, WrapByPoints, WrapNone, WrapSquare, WrapThrough, WrapTopBottom
 
Fields inherited from class org.apache.poi.hslf.model.Shape
_escherContainer, _fill, _parent, _sheet, EMU_PER_CENTIMETER, EMU_PER_INCH, EMU_PER_POINT, logger, MASTER_DPI, PIXEL_DPI, POINT_DPI
 
Constructor Summary
protected AutoShape(EscherContainerRecord escherRecord, Shape parent)
           
  AutoShape(int type)
           
  AutoShape(int type, Shape parent)
           
 
Method Summary
protected  EscherContainerRecord createSpContainer(int shapeType, boolean isChild)
           
 int getAdjustmentValue(int idx)
          Gets adjust value which controls smart resizing of the auto-shape.
 java.awt.Shape getOutline()
          Return shape outline as a java.awt.Shape object
 void setAdjustmentValue(int idx, int val)
          Sets adjust value which controls smart resizing of the auto-shape.
protected  void setDefaultTextProperties(TextRun _txtrun)
          Set default properties for the TextRun.
 
Methods inherited from class org.apache.poi.hslf.model.TextShape
afterInsert, createTextRun, draw, getEscherTextboxWrapper, getHorizontalAlignment, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPlaceholderAtom, getText, getTextId, getTextRun, getVerticalAlignment, getWordWrap, initTextRun, resizeToFitText, setHorizontalAlignment, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setSheet, setText, setTextId, setVerticalAlignment, setWordWrap
 
Methods inherited from class org.apache.poi.hslf.model.SimpleShape
createSpContainer, getClientDataRecord, getFillColor, getFlipHorizontal, getFlipVertical, getLineColor, getLineDashing, getLineStyle, getLineWidth, getLogicalAnchor2D, getRotation, setFillColor, setLineColor, setLineDashing, setLineStyle, setLineWidth
 
Methods inherited from class org.apache.poi.hslf.model.Shape
getAnchor, getAnchor2D, getColor, getEscherChild, getEscherProperty, getEscherProperty, getEscherProperty, getFill, getHyperlink, getParent, getShapeId, getShapeName, getShapeType, getSheet, getSpContainer, moveTo, setAnchor, setEscherProperty, setEscherProperty, setShapeId, setShapeType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoShape

protected AutoShape(EscherContainerRecord escherRecord,
                    Shape parent)

AutoShape

public AutoShape(int type,
                 Shape parent)

AutoShape

public AutoShape(int type)
Method Detail

createSpContainer

protected EscherContainerRecord createSpContainer(int shapeType,
                                                  boolean isChild)

setDefaultTextProperties

protected void setDefaultTextProperties(TextRun _txtrun)
Description copied from class: TextShape
Set default properties for the TextRun. Depending on the text and shape type the defaults are different: TextBox: align=left, valign=top AutoShape: align=center, valign=middle

Overrides:
setDefaultTextProperties in class TextShape

getAdjustmentValue

public int getAdjustmentValue(int idx)
Gets adjust value which controls smart resizing of the auto-shape.

The adjustment values are given in shape coordinates: the origin is at the top-left, positive-x is to the right, positive-y is down. The region from (0,0) to (S,S) maps to the geometry box of the shape (S=21600 is a constant).

Parameters:
idx - the adjust index in the [0, 9] range
Returns:
the adjustment value

setAdjustmentValue

public void setAdjustmentValue(int idx,
                               int val)
Sets adjust value which controls smart resizing of the auto-shape.

The adjustment values are given in shape coordinates: the origin is at the top-left, positive-x is to the right, positive-y is down. The region from (0,0) to (S,S) maps to the geometry box of the shape (S=21600 is a constant).

Parameters:
idx - the adjust index in the [0, 9] range
val - the adjustment value

getOutline

public java.awt.Shape getOutline()
Description copied from class: Shape
Return shape outline as a java.awt.Shape object

Overrides:
getOutline in class Shape
Returns:
the shape outline


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