Package org.apache.poi.hssf.usermodel
Class HSSFTextbox
java.lang.Object
org.apache.poi.hssf.usermodel.HSSFShape
org.apache.poi.hssf.usermodel.HSSFSimpleShape
org.apache.poi.hssf.usermodel.HSSFTextbox
- All Implemented Interfaces:
Shape,SimpleShape
- Direct Known Subclasses:
HSSFComment
A textbox is a shape that may hold a rich text string.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final shortstatic final shortstatic final shortHow to align text horizontallystatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortHow to align text verticallyFields inherited from class org.apache.poi.hssf.usermodel.HSSFSimpleShape
OBJECT_TYPE_ARC, OBJECT_TYPE_COMBO_BOX, OBJECT_TYPE_COMMENT, OBJECT_TYPE_LINE, OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING, OBJECT_TYPE_OVAL, OBJECT_TYPE_PICTURE, OBJECT_TYPE_RECTANGLE, WRAP_BY_POINTS, WRAP_NONE, WRAP_SQUAREFields inherited from class org.apache.poi.hssf.usermodel.HSSFShape
FILL__FILLCOLOR_DEFAULT, LINESTYLE__COLOR_DEFAULT, LINESTYLE_DASHDOTDOTSYS, LINESTYLE_DASHDOTGEL, LINESTYLE_DASHDOTSYS, LINESTYLE_DASHGEL, LINESTYLE_DASHSYS, LINESTYLE_DEFAULT, LINESTYLE_DOTGEL, LINESTYLE_DOTSYS, LINESTYLE_LONGDASHDOTDOTGEL, LINESTYLE_LONGDASHDOTGEL, LINESTYLE_LONGDASHGEL, LINESTYLE_NONE, LINESTYLE_SOLID, LINEWIDTH_DEFAULT, LINEWIDTH_ONE_PT, NO_FILL_DEFAULT, NO_FILLHITTEST_FALSE, NO_FILLHITTEST_TRUE -
Constructor Summary
ConstructorsConstructorDescriptionHSSFTextbox(EscherContainerRecord spContainer, ObjRecord objRecord, TextObjectRecord textObjectRecord) HSSFTextbox(HSSFShape parent, HSSFAnchor anchor) Construct a new textbox with the given parent and anchor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterRemove(HSSFPatriarch patriarch) remove escher container from the patriarch.escherAggregate remove obj, textObj and note records if it's necessary in case of ShapeGroup remove all contained shapesprotected HSSFShapeprotected ObjRecordprotected EscherContainerRecordshortGets the horizontal alignment.intGets the bottom margin within the textbox.intintintshortGets the vertical alignment.voidsetHorizontalAlignment(short align) Sets the horizontal alignment.voidsetMarginBottom(int marginBottom) Sets the bottom margin within the textbox.voidsetMarginLeft(int marginLeft) Sets the left margin within the textbox.voidsetMarginRight(int marginRight) Sets the right margin within the textbox.voidsetMarginTop(int marginTop) Sets the top margin within the textbox.voidsetShapeType(int shapeType) voidsetVerticalAlignment(short align) Sets the vertical alignment.Methods inherited from class org.apache.poi.hssf.usermodel.HSSFSimpleShape
createTextObjRecord, getShapeId, getShapeType, getString, getTextObjectRecord, getWrapText, setString, setWrapTextMethods inherited from class org.apache.poi.hssf.usermodel.HSSFShape
countOfAllChildren, getAnchor, getEscherContainer, getFillColor, getLineStyle, getLineStyleColor, getLineWidth, getObjRecord, getOptRecord, getParent, getPatriarch, getRotationDegree, getShapeName, isFlipHorizontal, isFlipVertical, isNoFill, setAnchor, setFillColor, setFillColor, setFlipHorizontal, setFlipVertical, setLineStyle, setLineStyleColor, setLineStyleColor, setLineWidth, setNoFill, setParent, setPatriarch, setPropertyValue, setRotationDegreeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.poi.ss.usermodel.Shape
getAnchor, getParent, getShapeName, isNoFill, setFillColor, setLineStyleColor, setNoFill
-
Field Details
-
OBJECT_TYPE_TEXT
public static final short OBJECT_TYPE_TEXT- See Also:
-
HORIZONTAL_ALIGNMENT_LEFT
public static final short HORIZONTAL_ALIGNMENT_LEFTHow to align text horizontally- See Also:
-
HORIZONTAL_ALIGNMENT_CENTERED
public static final short HORIZONTAL_ALIGNMENT_CENTERED- See Also:
-
HORIZONTAL_ALIGNMENT_RIGHT
public static final short HORIZONTAL_ALIGNMENT_RIGHT- See Also:
-
HORIZONTAL_ALIGNMENT_JUSTIFIED
public static final short HORIZONTAL_ALIGNMENT_JUSTIFIED- See Also:
-
HORIZONTAL_ALIGNMENT_DISTRIBUTED
public static final short HORIZONTAL_ALIGNMENT_DISTRIBUTED- See Also:
-
VERTICAL_ALIGNMENT_TOP
public static final short VERTICAL_ALIGNMENT_TOPHow to align text vertically- See Also:
-
VERTICAL_ALIGNMENT_CENTER
public static final short VERTICAL_ALIGNMENT_CENTER- See Also:
-
VERTICAL_ALIGNMENT_BOTTOM
public static final short VERTICAL_ALIGNMENT_BOTTOM- See Also:
-
VERTICAL_ALIGNMENT_JUSTIFY
public static final short VERTICAL_ALIGNMENT_JUSTIFY- See Also:
-
VERTICAL_ALIGNMENT_DISTRIBUTED
public static final short VERTICAL_ALIGNMENT_DISTRIBUTED- See Also:
-
-
Constructor Details
-
HSSFTextbox
public HSSFTextbox(EscherContainerRecord spContainer, ObjRecord objRecord, TextObjectRecord textObjectRecord) -
HSSFTextbox
Construct a new textbox with the given parent and anchor.- Parameters:
parent-anchor- One of HSSFClientAnchor or HSSFChildAnchor
-
-
Method Details
-
createObjRecord
- Overrides:
createObjRecordin classHSSFSimpleShape
-
createSpContainer
- Overrides:
createSpContainerin classHSSFSimpleShape
-
getMarginLeft
public int getMarginLeft()- Returns:
- Returns the left margin within the textbox.
-
setMarginLeft
public void setMarginLeft(int marginLeft) Sets the left margin within the textbox. -
getMarginRight
public int getMarginRight()- Returns:
- returns the right margin within the textbox.
-
setMarginRight
public void setMarginRight(int marginRight) Sets the right margin within the textbox. -
getMarginTop
public int getMarginTop()- Returns:
- returns the top margin within the textbox.
-
setMarginTop
public void setMarginTop(int marginTop) Sets the top margin within the textbox. -
getMarginBottom
public int getMarginBottom()Gets the bottom margin within the textbox. -
setMarginBottom
public void setMarginBottom(int marginBottom) Sets the bottom margin within the textbox. -
getHorizontalAlignment
public short getHorizontalAlignment()Gets the horizontal alignment. -
setHorizontalAlignment
public void setHorizontalAlignment(short align) Sets the horizontal alignment. -
getVerticalAlignment
public short getVerticalAlignment()Gets the vertical alignment. -
setVerticalAlignment
public void setVerticalAlignment(short align) Sets the vertical alignment. -
setShapeType
public void setShapeType(int shapeType) - Overrides:
setShapeTypein classHSSFSimpleShape- Parameters:
shapeType- - shapeType- See Also:
-
cloneShape
- Overrides:
cloneShapein classHSSFSimpleShape
-
afterRemove
Description copied from class:HSSFShaperemove escher container from the patriarch.escherAggregate remove obj, textObj and note records if it's necessary in case of ShapeGroup remove all contained shapes- Overrides:
afterRemovein classHSSFSimpleShape
-