jxl.biff.drawing
Class Comment

java.lang.Object
  extended byjxl.biff.drawing.Comment
All Implemented Interfaces:
DrawingGroupObject

public class Comment
extends java.lang.Object
implements DrawingGroupObject

Contains the various biff records used to insert a cell note into a worksheet


Constructor Summary
Comment(DrawingGroupObject dgo, DrawingGroup dg, WorkbookSettings ws)
          Copy constructor used to copy drawings from read to write
Comment(MsoDrawingRecord mso, ObjRecord obj, DrawingData dd, DrawingGroup dg, WorkbookSettings ws)
          Constructor used when reading images
Comment(java.lang.String text, int c, int r)
          Constructor invoked when writing the images
 
Method Summary
 void addMso(MsoDrawingRecord d)
           
 int getBlipId()
          Accessor for the blip id
 int getColumn()
          Accessor for the column
 DrawingGroup getDrawingGroup()
          Accessor for the drawing group
 double getHeight()
          Accessor for the height of this drawing
 byte[] getImageBytes()
          Accessor for the image data
 byte[] getImageData()
          Accessor for the image data
 java.lang.String getImageFilePath()
          Accessor for the image file path.
 MsoDrawingRecord getMsoDrawingRecord()
          Gets the drawing record which was read in
 int getObjectId()
          Accessor for the object id
 Origin getOrigin()
          Gets the origin of this drawing
 int getReferenceCount()
          Accessor for the reference count on this drawing
 int getRow()
          Accessor for the row
 int getShapeId()
          Accessor for the shape id
 jxl.biff.drawing.EscherContainer getSpContainer()
          Creates the main Sp container for the drawing
 java.lang.String getText()
          Accessor for the comment text
 jxl.biff.drawing.ShapeType getType()
          Accessor for the type
 double getWidth()
          Accessor for the width of this drawing
 double getX()
          Accessor for the column of this drawing
 double getY()
          Accessor for the row of this drawing
 int hashCode()
          Hashing algorithm
 boolean isFirst()
          Accessor for the first drawing on the sheet.
 boolean isFormObject()
          Queries whether this object is a form object.
 void setCommentText(java.lang.String t)
          Called when the comment text is changed during the sheet copy process
 void setDrawingGroup(DrawingGroup dg)
          Sets the drawing group for this drawing.
 void setFormatting(ContinueRecord t)
          Sets the formatting
 void setHeight(double h)
          Accessor for the height of this drawing
 void setNote(NoteRecord t)
          Sets the note object
 void setObjectId(int objid, int bip, int sid)
          Sets the object id.
 void setReferenceCount(int r)
          Sets the new reference count on the drawing
 void setText(ContinueRecord t)
          Sets the text data
 void setTextObject(TextObjectRecord t)
          Sets the text object
 void setWidth(double w)
          Accessor for the width
 void setX(double x)
          Sets the column position of this drawing.
 void setY(double y)
          Accessor for the row of the drawing
 void writeAdditionalRecords(File outputFile)
          Writes any other records associated with this drawing group object
 void writeTailRecords(File outputFile)
          Writes any records that need to be written after all the drawing group objects have been written Writes out all the note records
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Comment

public Comment(MsoDrawingRecord mso,
               ObjRecord obj,
               DrawingData dd,
               DrawingGroup dg,
               WorkbookSettings ws)
Constructor used when reading images

Parameters:
mso - the drawing record
obj - the object record
dd - the drawing data for all drawings on this sheet
dg - the drawing group
ws - the workbook settings

Comment

public Comment(DrawingGroupObject dgo,
               DrawingGroup dg,
               WorkbookSettings ws)
Copy constructor used to copy drawings from read to write


Comment

public Comment(java.lang.String text,
               int c,
               int r)
Constructor invoked when writing the images

Parameters:
text - the comment text
c - the column
r - the row
Method Detail

setObjectId

public final void setObjectId(int objid,
                              int bip,
                              int sid)
Sets the object id. Invoked by the drawing group when the object is added to id

Specified by:
setObjectId in interface DrawingGroupObject
Parameters:
objid - the object id
bip - the blip id
sid - the shape id

getObjectId

public final int getObjectId()
Accessor for the object id

Specified by:
getObjectId in interface DrawingGroupObject
Returns:
the object id

getShapeId

public final int getShapeId()
Accessor for the shape id

Specified by:
getShapeId in interface DrawingGroupObject
Returns:
the object id

getBlipId

public final int getBlipId()
Accessor for the blip id

Specified by:
getBlipId in interface DrawingGroupObject
Returns:
the blip id

getMsoDrawingRecord

public MsoDrawingRecord getMsoDrawingRecord()
Gets the drawing record which was read in

Specified by:
getMsoDrawingRecord in interface DrawingGroupObject
Returns:
the drawing record

getSpContainer

public jxl.biff.drawing.EscherContainer getSpContainer()
Creates the main Sp container for the drawing

Specified by:
getSpContainer in interface DrawingGroupObject
Returns:
the SP container

setDrawingGroup

public void setDrawingGroup(DrawingGroup dg)
Sets the drawing group for this drawing. Called by the drawing group when this drawing is added to it

Specified by:
setDrawingGroup in interface DrawingGroupObject
Parameters:
dg - the drawing group

getDrawingGroup

public DrawingGroup getDrawingGroup()
Accessor for the drawing group

Specified by:
getDrawingGroup in interface DrawingGroupObject
Returns:
the drawing group

getOrigin

public Origin getOrigin()
Gets the origin of this drawing

Specified by:
getOrigin in interface DrawingGroupObject
Returns:
where this drawing came from

getReferenceCount

public int getReferenceCount()
Accessor for the reference count on this drawing

Specified by:
getReferenceCount in interface DrawingGroupObject
Returns:
the reference count

setReferenceCount

public void setReferenceCount(int r)
Sets the new reference count on the drawing

Specified by:
setReferenceCount in interface DrawingGroupObject
Parameters:
r - the new reference count

getX

public double getX()
Accessor for the column of this drawing

Specified by:
getX in interface DrawingGroupObject
Returns:
the column

setX

public void setX(double x)
Sets the column position of this drawing. Used when inserting/removing columns from the spreadsheet

Specified by:
setX in interface DrawingGroupObject
Parameters:
x - the column

getY

public double getY()
Accessor for the row of this drawing

Specified by:
getY in interface DrawingGroupObject
Returns:
the row

setY

public void setY(double y)
Accessor for the row of the drawing

Specified by:
setY in interface DrawingGroupObject
Parameters:
y - the row

getWidth

public double getWidth()
Accessor for the width of this drawing

Specified by:
getWidth in interface DrawingGroupObject
Returns:
the number of columns spanned by this image

setWidth

public void setWidth(double w)
Accessor for the width

Specified by:
setWidth in interface DrawingGroupObject
Parameters:
w - the number of columns to span

getHeight

public double getHeight()
Accessor for the height of this drawing

Specified by:
getHeight in interface DrawingGroupObject
Returns:
the number of rows spanned by this image

setHeight

public void setHeight(double h)
Accessor for the height of this drawing

Specified by:
setHeight in interface DrawingGroupObject
Parameters:
h - the number of rows spanned by this image

getImageData

public byte[] getImageData()
Accessor for the image data

Specified by:
getImageData in interface DrawingGroupObject
Returns:
the image data

getType

public jxl.biff.drawing.ShapeType getType()
Accessor for the type

Specified by:
getType in interface DrawingGroupObject
Returns:
the type

setTextObject

public void setTextObject(TextObjectRecord t)
Sets the text object


setNote

public void setNote(NoteRecord t)
Sets the note object


setText

public void setText(ContinueRecord t)
Sets the text data


setFormatting

public void setFormatting(ContinueRecord t)
Sets the formatting


getImageBytes

public byte[] getImageBytes()
Accessor for the image data

Specified by:
getImageBytes in interface DrawingGroupObject
Returns:
the image data

getImageFilePath

public java.lang.String getImageFilePath()
Accessor for the image file path. Normally this is the absolute path of a file on the directory system, but if this drawing was constructed using an byte[] then the blip id is returned

Specified by:
getImageFilePath in interface DrawingGroupObject
Returns:
the image file path, or the blip id

addMso

public void addMso(MsoDrawingRecord d)

writeAdditionalRecords

public void writeAdditionalRecords(File outputFile)
                            throws java.io.IOException
Description copied from interface: DrawingGroupObject
Writes any other records associated with this drawing group object

Specified by:
writeAdditionalRecords in interface DrawingGroupObject
Throws:
java.io.IOException

writeTailRecords

public void writeTailRecords(File outputFile)
                      throws java.io.IOException
Writes any records that need to be written after all the drawing group objects have been written Writes out all the note records

Specified by:
writeTailRecords in interface DrawingGroupObject
Throws:
java.io.IOException

getRow

public int getRow()
Accessor for the row


getColumn

public int getColumn()
Accessor for the column


getText

public java.lang.String getText()
Accessor for the comment text


hashCode

public int hashCode()
Hashing algorithm


setCommentText

public void setCommentText(java.lang.String t)
Called when the comment text is changed during the sheet copy process

Parameters:
t - the new text

isFirst

public boolean isFirst()
Accessor for the first drawing on the sheet. This is used when copying unmodified sheets to indicate that this drawing contains the first time Escher gubbins

Specified by:
isFirst in interface DrawingGroupObject
Returns:
TRUE if this MSORecord is the first drawing on the sheet

isFormObject

public boolean isFormObject()
Queries whether this object is a form object. Form objects have their drawings records spread over several records and require special handling

Specified by:
isFormObject in interface DrawingGroupObject
Returns:
TRUE if this is a form object, FALSE otherwise