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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHSLFSimpleShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape, HSLFTextParagraph> parent) Create a SimpleShape object and initialize it from the supplied Record container. -
Method Summary
Modifier and TypeMethodDescriptionCreates a hyperlink and asigns it to this shape.protected EscherContainerRecordcreateSpContainer(boolean isChild) Create a new ShapegetAdjustValue(String name) Returns the solid color fill.Returns the hyperlink assigned to this shapeGets line cap.Gets the line compound styleGets line dashing.doubleReturns width of the line in in pointsdoubledoubleReturns line style.booleanChecks if the shape is a placeholder.voidsetFillColor(Color color) Specifies a solid color fill.protected voidsetHyperlink(HSLFHyperlink link) Sets the hyperlink - used when the document is parsedvoidsetLineBackgroundColor(Color color) Sets the background color of linevoidSets line cap.voidsetLineColor(Color color) Sets the color of linevoidSets the line compound stylevoidSets line dashing.voidvoidvoidvoidvoidvoidvoidsetLineWidth(double width) Sets the width of line in in pointsvoidsetPlaceholder(Placeholder placeholder) Specifies that the corresponding shape should be represented by the generating application as a placeholder.voidsetStrokeStyle(Object... styles) Sets the line attributes.Methods inherited from class org.apache.poi.hslf.usermodel.HSLFShape
afterInsert, 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, setSheetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotationMethods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getAnchor, getParent, getShapeId, getShapeName, getSheetMethods inherited from interface org.apache.poi.sl.usermodel.SimpleShape
getFillStyle, getShapeType, setShapeType
-
Field Details
-
DEFAULT_LINE_WIDTH
public static final double DEFAULT_LINE_WIDTH- See Also:
-
_hyperlink
Hyperlink
-
-
Constructor Details
-
HSLFSimpleShape
protected HSLFSimpleShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape, HSLFTextParagraph> parent) Create a SimpleShape object and initialize it from the supplied Record container.- Parameters:
escherRecord-EscherSpContainercontainer which holds information about this shapeparent- the parent of the shape
-
-
Method Details
-
createSpContainer
Create a new Shape- Overrides:
createSpContainerin classHSLFShape- Parameters:
isChild-trueif the Line is inside a group,falseotherwise- 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
Sets the color of line- Parameters:
color- new color of the line
-
getLineColor
- Returns:
- color of the line. If color is not set returns
null
-
getLineBackgroundColor
- Returns:
- background color of the line. If color is not set returns
null
-
setLineBackgroundColor
Sets the background color of line- Parameters:
color- new background color of the line
-
getLineCap
Gets line cap.- Returns:
- cap of the line.
-
setLineCap
Sets line cap.- Parameters:
pen- new style of the line.
-
getLineDash
Gets line dashing.- Returns:
- dashing of the line.
-
setLineDash
Sets line dashing.- Parameters:
pen- new style of the line.
-
getLineCompound
Gets the line compound style- Returns:
- the compound style of the line.
-
setLineCompound
Sets the line compound style- Parameters:
style- new compound style of the line.
-
getStrokeStyle
Returns line style. One of the constants defined in this class.- Specified by:
getStrokeStylein interfaceSimpleShape<HSLFShape,HSLFTextParagraph> - Returns:
- style of the line.
-
getFillColor
Description copied from interface:SimpleShapeReturns the solid color fill.- Specified by:
getFillColorin interfaceSimpleShape<HSLFShape,HSLFTextParagraph> - Returns:
- solid fill color of null if not set or fill color is not solid (pattern or gradient)
-
setFillColor
Description copied from interface:SimpleShapeSpecifies a solid color fill. The shape is filled entirely with the specified color.- Specified by:
setFillColorin interfaceSimpleShape<HSLFShape,HSLFTextParagraph> - Parameters:
color- the solid color fill. The value ofnullunsets the solid fill attribute from the underlying implementation
-
getAdjustValue
- Specified by:
getAdjustValuein interfaceIAdjustableShape- Parameters:
name- name of a adjust value, e.g. adj1- Returns:
- adjust guide defined in the shape or null
-
getGeometry
- Specified by:
getGeometryin interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
getShadowAngle
public double getShadowAngle() -
getShadowDistance
public double getShadowDistance() -
getShadowColor
- Returns:
- color of the line. If color is not set returns
java.awt.Color.black
-
getShadow
- Specified by:
getShadowin interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
getLineHeadDecoration
-
setLineHeadDecoration
-
getLineHeadWidth
-
setLineHeadWidth
-
getLineHeadLength
-
setLineHeadLength
-
getLineTailDecoration
-
setLineTailDecoration
-
getLineTailWidth
-
setLineTailWidth
-
getLineTailLength
-
setLineTailLength
-
getLineDecoration
- Specified by:
getLineDecorationin interfaceSimpleShape<HSLFShape,HSLFTextParagraph>
-
getPlaceholderDetails
- Specified by:
getPlaceholderDetailsin interfaceSimpleShape<HSLFShape,HSLFTextParagraph> - Returns:
- an accessor for placeholder details
-
getPlaceholder
- Specified by:
getPlaceholderin interfaceSimpleShape<HSLFShape,HSLFTextParagraph> - Returns:
- the placeholder or null if none is assigned
- See Also:
-
setPlaceholder
Description copied from interface:SimpleShapeSpecifies that the corresponding shape should be represented by the generating application as a placeholder. When a shape is considered a placeholder by the generating application it can have special properties to alert the user that they may enter content into the shape.- Specified by:
setPlaceholderin interfaceSimpleShape<HSLFShape,HSLFTextParagraph> - Parameters:
placeholder- the placeholder or null to remove the reference to the placeholder
-
setStrokeStyle
Description copied from interface:SimpleShapeSets the line attributes. Possible attributes are Double (width), LineCap, LineDash, LineCompound, Color (implementations of PaintStyle aren't yet supported ...) If no styles are given, the line will be hidden- Specified by:
setStrokeStylein interfaceSimpleShape<HSLFShape,HSLFTextParagraph> - Parameters:
styles- the line attributes
-
getHyperlink
Description copied from interface:SimpleShapeReturns the hyperlink assigned to this shape- Specified by:
getHyperlinkin interfaceSimpleShape<HSLFShape,HSLFTextParagraph> - Returns:
- the hyperlink assigned to this shape
or
nullif not found.
-
createHyperlink
Description copied from interface:SimpleShapeCreates a hyperlink and asigns it to this shape. If the shape has already a hyperlink assigned, return it instead- Specified by:
createHyperlinkin interfaceSimpleShape<HSLFShape,HSLFTextParagraph> - Returns:
- the hyperlink assigned to this shape
-
setHyperlink
Sets the hyperlink - used when the document is parsed- Parameters:
link- the hyperlink
-
isPlaceholder
public boolean isPlaceholder()Description copied from interface:SimpleShapeChecks if the shape is a placeholder. (placeholders aren't normal shapes, they are visible only in the Edit Master mode)- Specified by:
isPlaceholderin interfaceSimpleShape<HSLFShape,HSLFTextParagraph> - Overrides:
isPlaceholderin classHSLFShape- Returns:
trueif the shape is a placeholder
-