Package org.apache.poi.hslf.usermodel
Class HSLFSimpleShape
- java.lang.Object
-
- org.apache.poi.hslf.usermodel.HSLFShape
-
- org.apache.poi.hslf.usermodel.HSLFSimpleShape
-
- All Implemented Interfaces:
IAdjustableShape
,PlaceableShape<HSLFShape,HSLFTextParagraph>
,Shape<HSLFShape,HSLFTextParagraph>
,SimpleShape<HSLFShape,HSLFTextParagraph>
- Direct Known Subclasses:
HSLFConnectorShape
,HSLFPictureShape
,HSLFTextShape
public abstract class HSLFSimpleShape extends HSLFShape implements SimpleShape<HSLFShape,HSLFTextParagraph>
An abstract simple (non-group) shape. This is the parent class for all primitive shapes like Line, Rectangle, etc.
-
-
Field Summary
Fields Modifier and Type Field Description protected HSLFHyperlink
_hyperlink
Hyperlinkprotected static EscherPropertyTypes[]
ADJUST_VALUES
static double
DEFAULT_LINE_WIDTH
-
Constructor Summary
Constructors Modifier Constructor Description protected
HSLFSimpleShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
Create a SimpleShape object and initialize it from the supplied Record container.
-
Method Summary
-
Methods inherited from class org.apache.poi.hslf.usermodel.HSLFShape
afterInsert, draw, getAnchor, getClientData, getClientDataRecord, getClientRecords, getEscherChild, getEscherChild, getEscherChild, getEscherChild, getEscherOptRecord, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getFill, getFillStyle, getFlipHorizontal, getFlipVertical, getParent, getRotation, getShapeId, getShapeName, getShapeType, getSheet, getSpContainer, moveTo, setAnchor, setEscherProperty, setEscherProperty, setEscherProperty, setEscherProperty, setEscherProperty, setFlipHorizontal, setFlipVertical, setRotation, setShapeId, setShapeType, setSheet
-
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.PlaceableShape
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
-
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getAnchor, getParent, getShapeId, getShapeName, getSheet
-
Methods inherited from interface org.apache.poi.sl.usermodel.SimpleShape
getFillStyle, getShapeType, setShapeType
-
-
-
-
Field Detail
-
DEFAULT_LINE_WIDTH
public static final double DEFAULT_LINE_WIDTH
- See Also:
- Constant Field Values
-
ADJUST_VALUES
protected static final EscherPropertyTypes[] ADJUST_VALUES
-
_hyperlink
protected HSLFHyperlink _hyperlink
Hyperlink
-
-
Constructor Detail
-
HSLFSimpleShape
protected HSLFSimpleShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
Create a SimpleShape object and initialize it from the supplied Record container.- Parameters:
escherRecord
-EscherSpContainer
container which holds information about this shapeparent
- the parent of the shape
-
-
Method Detail
-
createSpContainer
protected EscherContainerRecord createSpContainer(boolean isChild)
Create a new Shape- Overrides:
createSpContainer
in classHSLFShape
- Parameters:
isChild
-true
if the Line is inside a group,false
otherwise- Returns:
- the record container which holds this shape
-
getLineWidth
public double getLineWidth()
Returns width of the line in in points
-
setLineWidth
public void setLineWidth(double width)
Sets the width of line in in points- Parameters:
width
- the width of line in in points
-
setLineColor
public void setLineColor(Color color)
Sets the color of line- Parameters:
color
- new color of the line
-
getLineColor
public Color getLineColor()
- Returns:
- color of the line. If color is not set returns
null
-
getLineBackgroundColor
public Color getLineBackgroundColor()
- Returns:
- background color of the line. If color is not set returns
null
-
setLineBackgroundColor
public void setLineBackgroundColor(Color color)
Sets the background color of line- Parameters:
color
- new background color of the line
-
getLineCap
public StrokeStyle.LineCap getLineCap()
Gets line cap.- Returns:
- cap of the line.
-
setLineCap
public void setLineCap(StrokeStyle.LineCap pen)
Sets line cap.- Parameters:
pen
- new style of the line.
-
getLineDash
public StrokeStyle.LineDash getLineDash()
Gets line dashing.- Returns:
- dashing of the line.
-
setLineDash
public void setLineDash(StrokeStyle.LineDash pen)
Sets line dashing.- Parameters:
pen
- new style of the line.
-
getLineCompound
public StrokeStyle.LineCompound getLineCompound()
Gets the line compound style- Returns:
- the compound style of the line.
-
setLineCompound
public void setLineCompound(StrokeStyle.LineCompound style)
Sets the line compound style- Parameters:
style
- new compound style of the line.
-
getStrokeStyle
public StrokeStyle getStrokeStyle()
Returns line style. One of the constants defined in this class.- Specified by:
getStrokeStyle
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
- Returns:
- style of the line.
-
getFillColor
public Color getFillColor()
- Specified by:
getFillColor
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
setFillColor
public void setFillColor(Color color)
- Specified by:
setFillColor
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
getAdjustValue
public Guide getAdjustValue(String name)
- Specified by:
getAdjustValue
in interfaceIAdjustableShape
-
getGeometry
public CustomGeometry getGeometry()
- Specified by:
getGeometry
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
getShadowAngle
public double getShadowAngle()
-
getShadowDistance
public double getShadowDistance()
-
getShadowColor
public Color getShadowColor()
- Returns:
- color of the line. If color is not set returns
java.awt.Color.black
-
getShadow
public Shadow<HSLFShape,HSLFTextParagraph> getShadow()
- Specified by:
getShadow
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
getLineHeadDecoration
public LineDecoration.DecorationShape getLineHeadDecoration()
-
setLineHeadDecoration
public void setLineHeadDecoration(LineDecoration.DecorationShape decoShape)
-
getLineHeadWidth
public LineDecoration.DecorationSize getLineHeadWidth()
-
setLineHeadWidth
public void setLineHeadWidth(LineDecoration.DecorationSize decoSize)
-
getLineHeadLength
public LineDecoration.DecorationSize getLineHeadLength()
-
setLineHeadLength
public void setLineHeadLength(LineDecoration.DecorationSize decoSize)
-
getLineTailDecoration
public LineDecoration.DecorationShape getLineTailDecoration()
-
setLineTailDecoration
public void setLineTailDecoration(LineDecoration.DecorationShape decoShape)
-
getLineTailWidth
public LineDecoration.DecorationSize getLineTailWidth()
-
setLineTailWidth
public void setLineTailWidth(LineDecoration.DecorationSize decoSize)
-
getLineTailLength
public LineDecoration.DecorationSize getLineTailLength()
-
setLineTailLength
public void setLineTailLength(LineDecoration.DecorationSize decoSize)
-
getLineDecoration
public LineDecoration getLineDecoration()
- Specified by:
getLineDecoration
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
getPlaceholderDetails
public HSLFShapePlaceholderDetails getPlaceholderDetails()
- Specified by:
getPlaceholderDetails
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
getPlaceholder
public Placeholder getPlaceholder()
- Specified by:
getPlaceholder
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
setPlaceholder
public void setPlaceholder(Placeholder placeholder)
- Specified by:
setPlaceholder
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
setStrokeStyle
public void setStrokeStyle(Object... styles)
- Specified by:
setStrokeStyle
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
getHyperlink
public HSLFHyperlink getHyperlink()
- Specified by:
getHyperlink
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
createHyperlink
public HSLFHyperlink createHyperlink()
- Specified by:
createHyperlink
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
setHyperlink
protected void setHyperlink(HSLFHyperlink link)
Sets the hyperlink - used when the document is parsed- Parameters:
link
- the hyperlink
-
isPlaceholder
public boolean isPlaceholder()
- Specified by:
isPlaceholder
in interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
- Overrides:
isPlaceholder
in classHSLFShape
-
-