org.apache.poi.hssf.usermodel
Class HSSFTextbox

java.lang.Object
  extended by org.apache.poi.hssf.usermodel.HSSFShape
      extended by org.apache.poi.hssf.usermodel.HSSFSimpleShape
          extended by org.apache.poi.hssf.usermodel.HSSFTextbox
All Implemented Interfaces:
Comment
Direct Known Subclasses:
HSSFComment

public class HSSFTextbox
extends HSSFSimpleShape
implements Comment

A textbox is a shape that may hold a rich text string.

Author:
Glen Stampoultzis (glens at apache.org)

Field Summary
static short HORIZONTAL_ALIGNMENT_CENTERED
           
static short HORIZONTAL_ALIGNMENT_DISTRIBUTED
           
static short HORIZONTAL_ALIGNMENT_JUSTIFIED
           
static short HORIZONTAL_ALIGNMENT_LEFT
          How to align text horizontally
static short HORIZONTAL_ALIGNMENT_RIGHT
           
static short OBJECT_TYPE_TEXT
           
static short VERTICAL_ALIGNMENT_BOTTOM
           
static short VERTICAL_ALIGNMENT_CENTER
           
static short VERTICAL_ALIGNMENT_DISTRIBUTED
           
static short VERTICAL_ALIGNMENT_JUSTIFY
           
static short VERTICAL_ALIGNMENT_TOP
          How to align text vertically
 
Fields inherited from class org.apache.poi.hssf.usermodel.HSSFSimpleShape
OBJECT_TYPE_COMBO_BOX, OBJECT_TYPE_COMMENT, OBJECT_TYPE_LINE, OBJECT_TYPE_OVAL, OBJECT_TYPE_PICTURE, OBJECT_TYPE_RECTANGLE
 
Fields inherited from class org.apache.poi.hssf.usermodel.HSSFShape
LINESTYLE_DASHDOTDOTSYS, LINESTYLE_DASHDOTGEL, LINESTYLE_DASHDOTSYS, LINESTYLE_DASHGEL, LINESTYLE_DASHSYS, LINESTYLE_DOTGEL, LINESTYLE_DOTSYS, LINESTYLE_LONGDASHDOTDOTGEL, LINESTYLE_LONGDASHDOTGEL, LINESTYLE_LONGDASHGEL, LINESTYLE_NONE, LINESTYLE_SOLID, LINEWIDTH_DEFAULT, LINEWIDTH_ONE_PT
 
Constructor Summary
HSSFTextbox(HSSFShape parent, HSSFAnchor anchor)
          Construct a new textbox with the given parent and anchor.
 
Method Summary
 java.lang.String getAuthor()
          Name of the original comment author
 int getColumn()
          Return the column of the cell that contains the comment
 short getHorizontalAlignment()
          Gets the horizontal alignment.
 int getMarginBottom()
          Gets the bottom margin within the textbox.
 int getMarginLeft()
           
 int getMarginRight()
           
 int getMarginTop()
           
 int getRow()
          Return the row of the cell that contains the comment
 RichTextString getString()
          Fetches the rich text string of the comment
 short getVerticalAlignment()
          Gets the vertical alignment.
 boolean isVisible()
          Sets whether this comment is visible.
 void setAuthor(java.lang.String author)
          Name of the original comment author
 void setColumn(int column)
          Set the column of the cell that contains the comment
 void setHorizontalAlignment(short align)
          Sets the horizontal alignment.
 void setMarginBottom(int marginBottom)
          Sets the bottom margin within the textbox.
 void setMarginLeft(int marginLeft)
          Sets the left margin within the textbox.
 void setMarginRight(int marginRight)
          Sets the right margin within the textbox.
 void setMarginTop(int marginTop)
          Sets the top margin within the textbox.
 void setRow(int row)
          Set the row of the cell that contains the comment
 void setString(RichTextString string)
          Sets the rich text string used by this comment.
 void setVerticalAlignment(short align)
          Sets the vertical alignment.
 void setVisible(boolean visible)
          Returns whether this comment is visible.
 
Methods inherited from class org.apache.poi.hssf.usermodel.HSSFSimpleShape
getShapeType, setShapeType
 
Methods inherited from class org.apache.poi.hssf.usermodel.HSSFShape
countOfAllChildren, getAnchor, getFillColor, getLineStyle, getLineStyleColor, getLineWidth, getParent, isNoFill, setAnchor, setFillColor, setFillColor, setLineStyle, setLineStyleColor, setLineStyleColor, setLineWidth, setNoFill
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_TYPE_TEXT

public static final short OBJECT_TYPE_TEXT
See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_LEFT

public static final short HORIZONTAL_ALIGNMENT_LEFT
How to align text horizontally

See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_CENTERED

public static final short HORIZONTAL_ALIGNMENT_CENTERED
See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_RIGHT

public static final short HORIZONTAL_ALIGNMENT_RIGHT
See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_JUSTIFIED

public static final short HORIZONTAL_ALIGNMENT_JUSTIFIED
See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_DISTRIBUTED

public static final short HORIZONTAL_ALIGNMENT_DISTRIBUTED
See Also:
Constant Field Values

VERTICAL_ALIGNMENT_TOP

public static final short VERTICAL_ALIGNMENT_TOP
How to align text vertically

See Also:
Constant Field Values

VERTICAL_ALIGNMENT_CENTER

public static final short VERTICAL_ALIGNMENT_CENTER
See Also:
Constant Field Values

VERTICAL_ALIGNMENT_BOTTOM

public static final short VERTICAL_ALIGNMENT_BOTTOM
See Also:
Constant Field Values

VERTICAL_ALIGNMENT_JUSTIFY

public static final short VERTICAL_ALIGNMENT_JUSTIFY
See Also:
Constant Field Values

VERTICAL_ALIGNMENT_DISTRIBUTED

public static final short VERTICAL_ALIGNMENT_DISTRIBUTED
See Also:
Constant Field Values
Constructor Detail

HSSFTextbox

public HSSFTextbox(HSSFShape parent,
                   HSSFAnchor anchor)
Construct a new textbox with the given parent and anchor.

Parameters:
parent -
anchor - One of HSSFClientAnchor or HSSFChildAnchor
Method Detail

getString

public RichTextString getString()
Description copied from interface: Comment
Fetches the rich text string of the comment

Specified by:
getString in interface Comment
Returns:
the rich text string for this textbox.

setString

public void setString(RichTextString string)
Description copied from interface: Comment
Sets the rich text string used by this comment.

Specified by:
setString in interface Comment
Parameters:
string - Sets the rich text string used by this object.

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.


setVisible

public void setVisible(boolean visible)
Description copied from interface: Comment
Returns whether this comment is visible.

Specified by:
setVisible in interface Comment
Parameters:
visible - true if the comment is visible, false otherwise

isVisible

public boolean isVisible()
Description copied from interface: Comment
Sets whether this comment is visible.

Specified by:
isVisible in interface Comment
Returns:
true if the comment is visible, false otherwise

getRow

public int getRow()
Description copied from interface: Comment
Return the row of the cell that contains the comment

Specified by:
getRow in interface Comment
Returns:
the 0-based row of the cell that contains the comment

setRow

public void setRow(int row)
Description copied from interface: Comment
Set the row of the cell that contains the comment

Specified by:
setRow in interface Comment
Parameters:
row - the 0-based row of the cell that contains the comment

getColumn

public int getColumn()
Description copied from interface: Comment
Return the column of the cell that contains the comment

Specified by:
getColumn in interface Comment
Returns:
the 0-based column of the cell that contains the comment

setColumn

public void setColumn(int column)
Description copied from interface: Comment
Set the column of the cell that contains the comment

Specified by:
setColumn in interface Comment
Parameters:
column - the 0-based column of the cell that contains the comment

getAuthor

public java.lang.String getAuthor()
Description copied from interface: Comment
Name of the original comment author

Specified by:
getAuthor in interface Comment
Returns:
the name of the original author of the comment

setAuthor

public void setAuthor(java.lang.String author)
Description copied from interface: Comment
Name of the original comment author

Specified by:
setAuthor in interface Comment
Parameters:
author - the name of the original author of the comment