org.apache.poi.hslf.usermodel
Class HSLFFreeformShape

java.lang.Object
  extended by org.apache.poi.hslf.usermodel.HSLFShape
      extended by org.apache.poi.hslf.usermodel.HSLFSimpleShape
          extended by org.apache.poi.hslf.usermodel.HSLFTextShape
              extended by org.apache.poi.hslf.usermodel.HSLFAutoShape
                  extended by org.apache.poi.hslf.usermodel.HSLFFreeformShape
All Implemented Interfaces:
java.lang.Iterable<HSLFTextParagraph>, IAdjustableShape, AutoShape<HSLFShape,HSLFTextParagraph>, FreeformShape<HSLFShape,HSLFTextParagraph>, PlaceableShape<HSLFShape,HSLFTextParagraph>, Shape<HSLFShape,HSLFTextParagraph>, SimpleShape<HSLFShape,HSLFTextParagraph>, TextShape<HSLFShape,HSLFTextParagraph>

public final class HSLFFreeformShape
extends HSLFAutoShape
implements FreeformShape<HSLFShape,HSLFTextParagraph>

A "Freeform" shape.

Shapes drawn with the "Freeform" tool have cubic bezier curve segments in the smooth sections and straight-line segments in the straight sections. This object closely corresponds to java.awt.geom.GeneralPath.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.TextShape
TextShape.TextAutofit, TextShape.TextDirection, TextShape.TextPlaceholder
 
Field Summary
static byte[] SEGMENTINFO_CLOSE
           
static byte[] SEGMENTINFO_CUBICTO
           
static byte[] SEGMENTINFO_CUBICTO2
           
static byte[] SEGMENTINFO_END
           
static byte[] SEGMENTINFO_ESCAPE
           
static byte[] SEGMENTINFO_ESCAPE2
           
static byte[] SEGMENTINFO_LINETO
           
static byte[] SEGMENTINFO_MOVETO
           
 
Fields inherited from class org.apache.poi.hslf.usermodel.HSLFTextShape
_frc, _paragraphs, _txtbox, WrapByPoints, WrapNone, WrapSquare, WrapThrough, WrapTopBottom
 
Fields inherited from class org.apache.poi.hslf.usermodel.HSLFSimpleShape
_hyperlink, DEFAULT_LINE_WIDTH
 
Fields inherited from class org.apache.poi.hslf.usermodel.HSLFShape
_escherContainer, _fill, _parent, _sheet, logger
 
Constructor Summary
  HSLFFreeformShape()
          Create a new Freeform.
protected HSLFFreeformShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
          Create a Freeform object and initialize it from the supplied Record container.
  HSLFFreeformShape(ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
          Create a new Freeform.
 
Method Summary
 java.awt.geom.Path2D.Double getPath()
          Gets the shape path.
 int setPath(java.awt.geom.Path2D.Double path)
          Set the shape path
 
Methods inherited from class org.apache.poi.hslf.usermodel.HSLFAutoShape
createSpContainer, getAdjustmentValue, setAdjustmentValue, setDefaultTextProperties
 
Methods inherited from class org.apache.poi.hslf.usermodel.HSLFTextShape
afterInsert, appendText, getBottomInset, getEscherTextboxWrapper, getHFPlaceholderAtom, getHyperlinks, getInsets, getLeftInset, getMetroShape, getPlaceholderAtom, getRawText, getRightInset, getRunType, getText, getTextDirection, getTextHeight, getTextId, getTextParagraphs, getTextPlaceholder, getTextRotation, getTopInset, getVerticalAlignment, getWordWrap, getWordWrapEx, isAlignToBaseline, isHorizontalCentered, isPlaceholder, iterator, resizeToFitText, setAlignToBaseline, setBottomInset, setHorizontalCentered, setInsets, setLeftInset, setRightInset, setRunType, setSheet, setText, setTextDirection, setTextId, setTextPlaceholder, setTextRotation, setTopInset, setVerticalAlignment, setWordWrap, setWordWrapEx, storeText
 
Methods inherited from class org.apache.poi.hslf.usermodel.HSLFSimpleShape
createHyperlink, createSpContainer, getAdjustValue, getFillColor, getGeometry, getHyperlink, getLineCap, getLineColor, getLineCompound, getLineDash, getLineDecoration, getLineHeadDecoration, getLineHeadLength, getLineHeadWidth, getLineTailDecoration, getLineTailLength, getLineTailWidth, getLineWidth, getPlaceholder, getShadow, getShadowAngle, getShadowColor, getShadowDistance, getStrokeStyle, setFillColor, setHyperlink, setLineCap, setLineColor, setLineCompound, setLineDash, setLineHeadDecoration, setLineHeadLength, setLineHeadWidth, setLineTailDecoration, setLineTailLength, setLineTailWidth, setLineWidth, setPlaceholder, setStrokeStyle
 
Methods inherited from class org.apache.poi.hslf.usermodel.HSLFShape
draw, getAnchor, getClientData, getClientDataRecord, getClientRecords, getEscherChild, getEscherChild, getEscherChild, getEscherChild, getEscherOptRecord, getEscherProperty, getEscherProperty, getEscherProperty, getFill, getFillStyle, getFlipHorizontal, getFlipVertical, getParent, getRotation, getShapeId, getShapeName, getShapeType, getSheet, getSpContainer, moveTo, setAnchor, setEscherProperty, setEscherProperty, setFlipHorizontal, setFlipVertical, setRotation, setShapeId, setShapeType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.poi.sl.usermodel.TextShape
appendText, getInsets, getText, getTextDirection, getTextHeight, getTextParagraphs, getTextPlaceholder, getTextRotation, getVerticalAlignment, getWordWrap, isHorizontalCentered, setHorizontalCentered, setInsets, setText, setTextDirection, setTextPlaceholder, setTextRotation, setVerticalAlignment, setWordWrap
 
Methods inherited from interface org.apache.poi.sl.usermodel.SimpleShape
createHyperlink, getFillColor, getFillStyle, getGeometry, getHyperlink, getLineDecoration, getPlaceholder, getShadow, getShapeType, getStrokeStyle, setFillColor, setPlaceholder, setShapeType, setStrokeStyle
 
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getAnchor, getParent, getSheet
 
Methods inherited from interface org.apache.poi.sl.draw.geom.IAdjustableShape
getAdjustValue
 
Methods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
 
Methods inherited from interface java.lang.Iterable
iterator
 

Field Detail

SEGMENTINFO_MOVETO

public static final byte[] SEGMENTINFO_MOVETO

SEGMENTINFO_LINETO

public static final byte[] SEGMENTINFO_LINETO

SEGMENTINFO_ESCAPE

public static final byte[] SEGMENTINFO_ESCAPE

SEGMENTINFO_ESCAPE2

public static final byte[] SEGMENTINFO_ESCAPE2

SEGMENTINFO_CUBICTO

public static final byte[] SEGMENTINFO_CUBICTO

SEGMENTINFO_CUBICTO2

public static final byte[] SEGMENTINFO_CUBICTO2

SEGMENTINFO_CLOSE

public static final byte[] SEGMENTINFO_CLOSE

SEGMENTINFO_END

public static final byte[] SEGMENTINFO_END
Constructor Detail

HSLFFreeformShape

protected HSLFFreeformShape(EscherContainerRecord escherRecord,
                            ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
Create a Freeform object and initialize it from the supplied Record container.

Parameters:
escherRecord - EscherSpContainer container which holds information about this shape
parent - the parent of the shape

HSLFFreeformShape

public HSLFFreeformShape(ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
Create a new Freeform. This constructor is used when a new shape is created.

Parameters:
parent - the parent of this Shape. For example, if this text box is a cell in a table then the parent is Table.

HSLFFreeformShape

public HSLFFreeformShape()
Create a new Freeform. This constructor is used when a new shape is created.

Method Detail

setPath

public int setPath(java.awt.geom.Path2D.Double path)
Description copied from interface: FreeformShape
Set the shape path

Specified by:
setPath in interface FreeformShape<HSLFShape,HSLFTextParagraph>
Parameters:
path - shape outline
Returns:
the number of points written

getPath

public java.awt.geom.Path2D.Double getPath()
Description copied from interface: FreeformShape
Gets the shape path.

The path is translated in the shape's coordinate system, i.e. freeform.getPath().getBounds2D() equals to freeform.getAnchor() (small discrepancies are possible due to rounding errors)

Specified by:
getPath in interface FreeformShape<HSLFShape,HSLFTextParagraph>
Returns:
the path


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