Package org.apache.poi.hssf.usermodel
Class HSSFComment
- java.lang.Object
-
- org.apache.poi.hssf.usermodel.HSSFShape
-
- org.apache.poi.hssf.usermodel.HSSFSimpleShape
-
- org.apache.poi.hssf.usermodel.HSSFTextbox
-
- org.apache.poi.hssf.usermodel.HSSFComment
-
- All Implemented Interfaces:
Comment
,Shape
,SimpleShape
public class HSSFComment extends HSSFTextbox implements Comment
Represents a cell comment - a sticky note associated with a cell.
-
-
Field Summary
-
Fields inherited from class org.apache.poi.hssf.usermodel.HSSFTextbox
HORIZONTAL_ALIGNMENT_CENTERED, HORIZONTAL_ALIGNMENT_DISTRIBUTED, HORIZONTAL_ALIGNMENT_JUSTIFIED, HORIZONTAL_ALIGNMENT_LEFT, HORIZONTAL_ALIGNMENT_RIGHT, OBJECT_TYPE_TEXT, VERTICAL_ALIGNMENT_BOTTOM, VERTICAL_ALIGNMENT_CENTER, VERTICAL_ALIGNMENT_DISTRIBUTED, VERTICAL_ALIGNMENT_JUSTIFY, VERTICAL_ALIGNMENT_TOP
-
Fields 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_SQUARE
-
Fields 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
Constructors Modifier Constructor Description HSSFComment(EscherContainerRecord spContainer, ObjRecord objRecord, TextObjectRecord textObjectRecord, NoteRecord note)
protected
HSSFComment(NoteRecord note, TextObjectRecord txo)
HSSFComment(HSSFShape parent, HSSFAnchor anchor)
Construct a new comment with the given parent and anchor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterRemove(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 HSSFShape
cloneShape()
protected ObjRecord
createObjRecord()
protected EscherContainerRecord
createSpContainer()
boolean
equals(Object obj)
CellAddress
getAddress()
Get the address of the cell that this comment is attached toString
getAuthor()
Name of the original comment authorint
getBackgroundImageId()
ClientAnchor
getClientAnchor()
Return defined position of this anchor in the sheet.int
getColumn()
Return the column of the cell that contains the commentprotected NoteRecord
getNoteRecord()
Returns the underlying Note recordint
getRow()
Return the row of the cell that contains the commentint
hashCode()
boolean
hasPosition()
Do we know which cell this comment belongs to?boolean
isVisible()
Returns whether this comment is visible.void
resetBackgroundImage()
void
setAddress(int row, int col)
Set the address of the cell that this comment is attached tovoid
setAddress(CellAddress address)
Set the address of the cell that this comment is attached tovoid
setAuthor(String author)
Name of the original comment authorvoid
setBackgroundImage(int pictureIndex)
void
setColumn(int col)
Set the column of the cell that contains the commentvoid
setRow(int row)
Set the row of the cell that contains the commentvoid
setShapeType(int shapeType)
void
setVisible(boolean visible)
Sets whether this comment is visible.-
Methods inherited from class org.apache.poi.hssf.usermodel.HSSFTextbox
getHorizontalAlignment, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getVerticalAlignment, setHorizontalAlignment, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setVerticalAlignment
-
Methods inherited from class org.apache.poi.hssf.usermodel.HSSFSimpleShape
createTextObjRecord, getShapeId, getShapeType, getString, getTextObjectRecord, getWrapText, setString, setWrapText
-
Methods 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, setRotationDegree
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.ss.usermodel.Shape
getAnchor, getParent, getShapeName, isNoFill, setFillColor, setLineStyleColor, setNoFill
-
-
-
-
Constructor Detail
-
HSSFComment
public HSSFComment(EscherContainerRecord spContainer, ObjRecord objRecord, TextObjectRecord textObjectRecord, NoteRecord note)
-
HSSFComment
public HSSFComment(HSSFShape parent, HSSFAnchor anchor)
Construct a new comment with the given parent and anchor.- Parameters:
anchor
- defines position of this anchor in the sheet
-
HSSFComment
protected HSSFComment(NoteRecord note, TextObjectRecord txo)
-
-
Method Detail
-
createSpContainer
protected EscherContainerRecord createSpContainer()
- Overrides:
createSpContainer
in classHSSFTextbox
-
createObjRecord
protected ObjRecord createObjRecord()
- Overrides:
createObjRecord
in classHSSFTextbox
-
setVisible
public void setVisible(boolean visible)
Sets whether this comment is visible.- Specified by:
setVisible
in interfaceComment
- Parameters:
visible
-true
if the comment is visible,false
otherwise
-
isVisible
public boolean isVisible()
Returns whether this comment is visible.
-
getAddress
public CellAddress getAddress()
Description copied from interface:Comment
Get the address of the cell that this comment is attached to- Specified by:
getAddress
in interfaceComment
- Returns:
- comment cell address
-
setAddress
public void setAddress(CellAddress address)
Description copied from interface:Comment
Set the address of the cell that this comment is attached to- Specified by:
setAddress
in interfaceComment
-
setAddress
public void setAddress(int row, int col)
Description copied from interface:Comment
Set the address of the cell that this comment is attached to- Specified by:
setAddress
in interfaceComment
-
getRow
public int getRow()
Return the row of the cell that contains the comment
-
setRow
public void setRow(int row)
Set the row of the cell that contains the comment
-
getColumn
public int getColumn()
Return the column of the cell that contains the comment
-
setColumn
public void setColumn(int col)
Set the column of the cell that contains the comment
-
getAuthor
public String getAuthor()
Name of the original comment author
-
setAuthor
public void setAuthor(String author)
Name of the original comment author
-
getNoteRecord
protected NoteRecord getNoteRecord()
Returns the underlying Note record
-
hasPosition
public boolean hasPosition()
Do we know which cell this comment belongs to?
-
getClientAnchor
public ClientAnchor getClientAnchor()
Description copied from interface:Comment
Return defined position of this anchor in the sheet. The anchor is the yellow box/balloon that is rendered on top of the sheets when the comment is visible. To associate a comment with a different cell, useComment.setAddress(org.apache.poi.ss.util.CellAddress)
.- Specified by:
getClientAnchor
in interfaceComment
- Returns:
- defined position of this anchor in the sheet, can be null
-
setShapeType
public void setShapeType(int shapeType)
- Overrides:
setShapeType
in classHSSFTextbox
- Parameters:
shapeType
- - shapeType- See Also:
HSSFShapeTypes
-
afterRemove
public void afterRemove(HSSFPatriarch patriarch)
Description copied from class:HSSFShape
remove 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:
afterRemove
in classHSSFTextbox
-
cloneShape
protected HSSFShape cloneShape()
- Overrides:
cloneShape
in classHSSFTextbox
-
setBackgroundImage
public void setBackgroundImage(int pictureIndex)
-
resetBackgroundImage
public void resetBackgroundImage()
-
getBackgroundImageId
public int getBackgroundImageId()
-
-