Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate


com.aspose.cells
Class Shapes

java.lang.Object
  extended by com.aspose.cells.Shapes

public class Shapes
extends java.lang.Object

Represents all the shapes in the worksheet.


Method Summary
 ArcShape addArc(int row, int column, int left, int top, int width, int height)
          Add an Arc to this collection
 Button addButton(int row, int column, int left, int top, int width, int height)
          Adds a button to the collection.
 CheckBox addCheckBox(int row, int column, int left, int top, int width, int height)
          Adds a checkbox to the collection.
 ComboBox addComboBox(int row, int column, int left, int top, int width, int height)
          Adds a combobox to the collection.
 Comment addComment(int row, int column)
          Adds a comment to the collection.
 Comment addComment(int row, int column, byte placementType)
          Adds a comment to the collection and sets its placement as given type.
 Comment addComment(java.lang.String cellName)
          Adds a comment to the collection.
 Shape addCopy(Shape source)
          Copies a shape and adds the copied one to the collection.
 GroupBox addGroupBox(int row, int column, int left, int top, int width, int height)
          Adds a groupbox to the collection.
 Label addLabel(int row, int column, int left, int top, int width, int height)
          Adds a label to the collection.
 LineShape addLine(int row, int column, int left, int top, int width, int height)
          Add a line to this collection.
 ListBox addListBox(int row, int column, int left, int top, int width, int height)
          Adds a list box to the collection.
 OleObject addOleObject(int row, int column, int left, int top, byte[] imageData, byte[] objectData)
          Embed an OleObject in this collection.
 OleObject addOleObject(int row, int column, int left, int top, byte[] imageData, byte[] objectData, byte fileType, java.lang.String sourceFullName)
          Embed an OleObject in this collection.
 OleObject addOleObject(int row, int column, int left, int top, java.io.InputStream imageStream, java.io.InputStream objectStream, byte fileType, java.lang.String sourceFullName)
          Embed an OleObject in this collection.
 OvalShape addOval(int row, int column, int left, int top, int width, int height)
          Add an Oval to this collection
 Picture addPicture(int startRow, int startColumn, java.io.InputStream inputStream)
          Adds a picture to the collection.
 Picture addPicture(int startRow, int startColumn, java.io.InputStream inputStream, int widthScale, int heightScale)
          Adds a picture to the collection.
 Picture addPicture(int startRow, int startColumn, int endRow, int endColumn, java.io.InputStream inputStream)
          Adds a picture to the collection.
 Picture addPicture(int startRow, int startColumn, int endRow, int endColumn, java.lang.String fileName)
          Adds a picture to the collection.
 Picture addPicture(int startRow, int startColumn, java.lang.String fileName)
          Adds a picture to the collection.
 Picture addPicture(int startRow, int startColumn, java.lang.String fileName, int widthScale, int heightScale)
          Adds a picture to the collection.
 Picture addPictureInChart(int top, int left, int widthScale, int heightScale, java.io.InputStream inputStream)
          Adds a picture to the collection.
 Picture addPictureInChart(int top, int left, int widthScale, int heightScale, java.lang.String fileName)
          Adds a picture to the collection.
 RadioButton addRadioButton(int row, int column, int left, int top, int width, int height)
          Adds a radio button to the collection.
 RectangleShape addRectangle(int row, int column, int left, int top, int width, int height)
          Add an Rectangle to this collection
 ScrollBar addScrollBar(int row, int column, int left, int top, int width, int height)
          Adds a ScrollBar to the collection.
 Shape addShape(short shapeType, int row, int column, int left, int top, int width, int height, java.io.InputStream stream)
          Add a shape to this collection.
 Spinner addSpinner(int row, int column, int left, int top, int width, int height)
          Adds a spinner to the collection.
 TextBox addTextBox(int row, int column, int left, int top, int width, int height)
          Adds a text box to the text boxes collection.
 TextBox addTextBoxInChart(int left, int top, int width, int height)
          Adds a text box to the text boxes collection of Chart.
 void clearComments()
          Remove all comments from the collection
 Shape get(int index)
          get Shape in collection at given index
 Comment getComment(int row, int column)
          Gets the comment of given cell.
 GroupShape group(Shape[] children)
          Groups given shapes
 Comment removeComment(int row, int column)
          Remove a comment from the collection.
 Comment removeComment(java.lang.String cellName)
          Remove a comment from the collection.
 boolean removeShape(int index)
          Remove a shape from the collection
 boolean removeShape(Shape shape)
          Remove a shape from the collection
 int size()
          get the size of collection
 void unGroup(GroupShape group)
          Ungroups shapes in given GroupShape
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addShape

public Shape addShape(short shapeType,
                      int row,
                      int column,
                      int left,
                      int top,
                      int width,
                      int height,
                      java.io.InputStream stream)
Add a shape to this collection.

Parameters:
shapeType - shape type. See MsoDrawingType
row - row index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
column - column index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
left - When shapes collection is of Worksheet, it represents the horizontal offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the horizontal offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's width.
top - When shapes collection is of Worksheet, it represents the vertical offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the vertical offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's height.
width - height of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's width;
height - width of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's height;
stream - Stream object which contains the image data. Only for adding Picture.
Returns:
the new shape object has been created and added into this collection.
Throws:
java.lang.IllegalArgumentException - if position or size value is out of range.
CellsException - if the collection has been removed.

addCopy

public Shape addCopy(Shape source)
Copies a shape and adds the copied one to the collection.

Parameters:
source - the source shape to be copied.
Returns:
The new copied shape object

get

public Shape get(int index)
get Shape in collection at given index

Parameters:
index -
Returns:
Shape Object

size

public int size()
get the size of collection

Returns:
size of collection

group

public GroupShape group(Shape[] children)
Groups given shapes

Parameters:
children - shapes to be grouped
Returns:
GroupShape object

unGroup

public void unGroup(GroupShape group)
Ungroups shapes in given GroupShape

Parameters:
group - GroupShape whose children to be ungrouped

addLine

public LineShape addLine(int row,
                         int column,
                         int left,
                         int top,
                         int width,
                         int height)
Add a line to this collection.

Parameters:
row - row index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
column - column index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
left - When shapes collection is of Worksheet, it represents the horizontal offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the horizontal offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's width.
top - When shapes collection is of Worksheet, it represents the vertical offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the vertical offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's height.
width - height of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's width;
height - width of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's height;
Returns:
the new line shape object.

addRectangle

public RectangleShape addRectangle(int row,
                                   int column,
                                   int left,
                                   int top,
                                   int width,
                                   int height)
Add an Rectangle to this collection

Parameters:
row - row index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
column - column index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
left - When shapes collection is of Worksheet, it represents the horizontal offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the horizontal offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's width.
top - When shapes collection is of Worksheet, it represents the vertical offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the vertical offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's height.
width - height of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's width;
height - width of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's height;
Returns:
the new Rectangle shape object

addOval

public OvalShape addOval(int row,
                         int column,
                         int left,
                         int top,
                         int width,
                         int height)
Add an Oval to this collection

Parameters:
row - row index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
column - column index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
left - When shapes collection is of Worksheet, it represents the horizontal offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the horizontal offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's width.
top - When shapes collection is of Worksheet, it represents the vertical offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the vertical offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's height.
width - height of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's width;
height - width of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's height;
Returns:
the new Oval shape object

addArc

public ArcShape addArc(int row,
                       int column,
                       int left,
                       int top,
                       int width,
                       int height)
Add an Arc to this collection

Parameters:
row - row index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
column - column index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
left - When shapes collection is of Worksheet, it represents the horizontal offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the horizontal offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's width.
top - When shapes collection is of Worksheet, it represents the vertical offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the vertical offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's height.
width - height of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's width;
height - width of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's height;
Returns:
the new Arc shape object

addTextBox

public TextBox addTextBox(int row,
                          int column,
                          int left,
                          int top,
                          int width,
                          int height)
Adds a text box to the text boxes collection.

Parameters:
row - row index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
column - column index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
left - When shapes collection is of Worksheet, it represents the horizontal offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the horizontal offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's width.
top - When shapes collection is of Worksheet, it represents the vertical offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the vertical offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's height.
width - height of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's width;
height - width of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's height;
Returns:
the new TextBox object
Throws:
java.lang.IllegalArgumentException - if position or size value is out of range.

addTextBoxInChart

public TextBox addTextBoxInChart(int left,
                                 int top,
                                 int width,
                                 int height)
Adds a text box to the text boxes collection of Chart.

Parameters:
left - the horizontal offset of textbox from the left corner of the chart, in units of 1/4000 of the chart area.
top - the vertical offset of textbox from the left corner of the chart, in units of 1/4000 of the chart area.
width - height of textbox, in units of 1/4000 of the chart area.
height - width of textbox, in units of 1/4000 of the chart area.
Returns:
the new TextBox object
Throws:
java.lang.UnsupportedOperationException - if Shapes object does not belong to Chart

addButton

public Button addButton(int row,
                        int column,
                        int left,
                        int top,
                        int width,
                        int height)
Adds a button to the collection.

Parameters:
row - row index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
column - column index of the cell that shape's top-left corner in. If shapes collection is of Chart, this parameter will be ignored.
left - When shapes collection is of Worksheet, it represents the horizontal offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the horizontal offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's width.
top - When shapes collection is of Worksheet, it represents the vertical offset of the top left corner of shape and cell, in unit of pixel; When shapes collection is of Chart, it represents the vertical offset of the top left corner of shape and Chart, in 1/4000 of the ChartArea's height.
width - height of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's width;
height - width of shape. When shapes collection is of Worksheet, the unit is pixel; When shapes collection is of Chart, the unit is 1/4000 of the ChartArea's height;
Returns:
the new Button object
Throws:
java.lang.IllegalArgumentException - if position or size value is out of range.

addPicture

public Picture addPicture(int startRow,
                          int startColumn,
                          int endRow,
                          int endColumn,
                          java.lang.String fileName)
Adds a picture to the collection. Only applicable to shapes collection of Worksheet. Currently supported image format are listed below:
BMP
JPEG
PNG
GIF
WMF
EMF

Parameters:
startRow - row index of the top left cell.
startColumn - column index of the top left cell.
endRow - row index of the bottom right cell.
endColumn - column index of the bottom right cell.
fileName - Image filename.
Returns:
Picture object.
Throws:
java.lang.IllegalArgumentException - if the file is not exsiting.
java.lang.IllegalArgumentException - if image foramt is not supported.

addPicture

public Picture addPicture(int startRow,
                          int startColumn,
                          int endRow,
                          int endColumn,
                          java.io.InputStream inputStream)
Adds a picture to the collection. Only applicable to shapes collection of Worksheet.

Parameters:
startRow - row index of the top left cell.
startColumn - column index of the top left cell.
endRow - row index of the bottom right cell.
endColumn - column index of the bottom right cell.
inputStream - Stream object which contains the image data.
Returns:
Picture object.
Throws:
java.lang.IllegalArgumentException - if image foramt is not supported.
See Also:
addPicture(int, int, int, int, String)

addPicture

public Picture addPicture(int startRow,
                          int startColumn,
                          java.io.InputStream inputStream,
                          int widthScale,
                          int heightScale)
Adds a picture to the collection. Only applicable to shapes collection of Worksheet.

Parameters:
startRow - row index of the top left cell.
startColumn - column index of the top left cell.
inputStream - Stream object which contains the image data.
widthScale - Scale of image width, a percentage.
heightScale - Scale of image height, a percentage.
Returns:
Picture object.
Throws:
java.lang.IllegalArgumentException - if image foramt is not supported.
See Also:
addPicture(int, int, int, int, String)

addPicture

public Picture addPicture(int startRow,
                          int startColumn,
                          java.lang.String fileName,
                          int widthScale,
                          int heightScale)
Adds a picture to the collection. Only applicable to shapes collection of Worksheet.

Parameters:
startRow - row index of the top left cell.
startColumn - column index of the top left cell.
fileName - Image filename.
widthScale - Scale of image width, a percentage.
heightScale - Scale of image height, a percentage.
Returns:
Picture object.
Throws:
java.lang.IllegalArgumentException - if the file is not exsiting.
java.lang.IllegalArgumentException - if image foramt is not supported.
See Also:
addPicture(int, int, int, int, String)

addPicture

public Picture addPicture(int startRow,
                          int startColumn,
                          java.io.InputStream inputStream)
Adds a picture to the collection. Use the default width and height of the picture. Only applicable to shapes collection of Worksheet.

Parameters:
startRow - row index of the top left cell.
startColumn - column index of the top left cell.
inputStream - Stream object which contains the image data.
Returns:
Picture object.
Throws:
java.lang.IllegalArgumentException - if image foramt is not supported.
See Also:
addPicture(int, int, int, int, String)

addPicture

public Picture addPicture(int startRow,
                          int startColumn,
                          java.lang.String fileName)
Adds a picture to the collection. Use the default width and height of the picture. Only applicable to shapes collection of Worksheet.

Parameters:
startRow - row index of the top left cell.
startColumn - column index of the top left cell.
fileName - Image filename.
Returns:
Picture object.
Throws:
java.lang.IllegalArgumentException - if the file is not exsiting.
java.lang.IllegalArgumentException - if image foramt is not supported.
See Also:
addPicture(int, int, int, int, String)

addPictureInChart

public Picture addPictureInChart(int top,
                                 int left,
                                 int widthScale,
                                 int heightScale,
                                 java.io.InputStream inputStream)
Adds a picture to the collection. Only applicable to shapes collection of Chart.

Parameters:
left - the horizontal offset of textbox from the left corner of the chart, in units of 1/4000 of the chart area.
top - the vertical offset of textbox from the left corner of the chart, in units of 1/4000 of the chart area.
widthScale - Scale of image width, a percentage.
heightScale - Scale of image height, a percentage.
inputStream - Stream object which contains the image data.
Returns:
the new Picture object
Throws:
java.lang.IllegalArgumentException - if position value is out of range.

addPictureInChart

public Picture addPictureInChart(int top,
                                 int left,
                                 int widthScale,
                                 int heightScale,
                                 java.lang.String fileName)
Adds a picture to the collection. Only applicable to shapes collection of Chart.

Parameters:
left - the horizontal offset of textbox from the left corner of the chart, in units of 1/4000 of the chart area.
top - the vertical offset of textbox from the left corner of the chart, in units of 1/4000 of the chart area.
widthScale - Scale of image width, a percentage.
heightScale - Scale of image height, a percentage.
fileName - Image filename.
Returns:
the new Picture object
Throws:
java.lang.IllegalArgumentException - if the file is not exsiting.
java.lang.IllegalArgumentException - if position value is out of range.

addCheckBox

public CheckBox addCheckBox(int row,
                            int column,
                            int left,
                            int top,
                            int width,
                            int height)
Adds a checkbox to the collection.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
width - height of shape, in unit of pixel.
height - width of shape, in unit of pixel.
Returns:
the new CheckBox object
Throws:
java.lang.IllegalArgumentException - if row or column index is out of range.

addGroupBox

public GroupBox addGroupBox(int row,
                            int column,
                            int left,
                            int top,
                            int width,
                            int height)
Adds a groupbox to the collection.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
width - height of shape, in unit of pixel.
height - width of shape, in unit of pixel.
Returns:
the new GroupBox object
Throws:
java.lang.IllegalArgumentException - if row or column index is out of range.

addComboBox

public ComboBox addComboBox(int row,
                            int column,
                            int left,
                            int top,
                            int width,
                            int height)
Adds a combobox to the collection.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
width - height of shape, in unit of pixel.
height - width of shape, in unit of pixel.
Returns:
the new ComboBox object
Throws:
java.lang.IllegalArgumentException - if row or column index is out of range.

addRadioButton

public RadioButton addRadioButton(int row,
                                  int column,
                                  int left,
                                  int top,
                                  int width,
                                  int height)
Adds a radio button to the collection.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
width - height of shape, in unit of pixel.
height - width of shape, in unit of pixel.
Returns:
the new RadioButton object
Throws:
java.lang.IllegalArgumentException - if row or column index is out of range.

addLabel

public Label addLabel(int row,
                      int column,
                      int left,
                      int top,
                      int width,
                      int height)
Adds a label to the collection.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
width - height of shape, in unit of pixel.
height - width of shape, in unit of pixel.
Returns:
the new Label object
Throws:
java.lang.IllegalArgumentException - if row or column index is out of range.

addSpinner

public Spinner addSpinner(int row,
                          int column,
                          int left,
                          int top,
                          int width,
                          int height)
Adds a spinner to the collection.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
width - height of shape, in unit of pixel.
height - width of shape, in unit of pixel.
Returns:
the new Spinner object
Throws:
java.lang.IllegalArgumentException - if row or column index is out of range.

addScrollBar

public ScrollBar addScrollBar(int row,
                              int column,
                              int left,
                              int top,
                              int width,
                              int height)
Adds a ScrollBar to the collection.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
width - height of shape, in unit of pixel.
height - width of shape, in unit of pixel.
Returns:
the new ScrollBar object
Throws:
java.lang.IllegalArgumentException - if row or column index is out of range.

addListBox

public ListBox addListBox(int row,
                          int column,
                          int left,
                          int top,
                          int width,
                          int height)
Adds a list box to the collection.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
width - height of shape, in unit of pixel.
height - width of shape, in unit of pixel.
Returns:
the new ListBox object
Throws:
java.lang.IllegalArgumentException - if row or column index is out of range.

addOleObject

public OleObject addOleObject(int row,
                              int column,
                              int left,
                              int top,
                              byte[] imageData,
                              byte[] objectData)
Embed an OleObject in this collection.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
imageData - data of Image as icon of the embeded object. If null, then uses the default blank icon.
objectData - data of the embeded object
Returns:
the new OleObject embeded in

addOleObject

public OleObject addOleObject(int row,
                              int column,
                              int left,
                              int top,
                              byte[] imageData,
                              byte[] objectData,
                              byte fileType,
                              java.lang.String sourceFullName)
Embed an OleObject in this collection. Take the file format as MS Office related document.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
imageData - data of Image as icon of the embeded object. If null, then uses the default blank icon.
objectData - data of the embeded object
fileType - the embeded object's file type, supproted file type see OleFileType.
sourceFullName - the ole native source full file name
Returns:
the new OleObject embeded in

addOleObject

public OleObject addOleObject(int row,
                              int column,
                              int left,
                              int top,
                              java.io.InputStream imageStream,
                              java.io.InputStream objectStream,
                              byte fileType,
                              java.lang.String sourceFullName)
Embed an OleObject in this collection.

Parameters:
row - row index of the cell that shape's top-left corner in.
column - column index of the cell that shape's top-left corner in.
left - the horizontal offset of the top left corner of shape and cell, in unit of pixel.
top - the vertical offset of the top left corner of shape and cell, in unit of pixel.
imageStream - InputStream of the Image as icon of the embeded object. If null, then uses the default blank icon.
objectStream - InputStream of the embeded object
fileType - the embeded object's file type, supproted file type see OleFileType.
sourceFullName - the ole native source full file name
Returns:
the new OleObject embeded in

getComment

public Comment getComment(int row,
                          int column)
Gets the comment of given cell.

Parameters:
row - row index
column - column index
Returns:
the Comment object. If given cell has no comment, returns null.

addComment

public Comment addComment(int row,
                          int column)
Adds a comment to the collection.

Parameters:
row - row index.
column - column index.
Returns:
Comment Object.

addComment

public Comment addComment(int row,
                          int column,
                          byte placementType)
Adds a comment to the collection and sets its placement as given type.

Parameters:
row - row index
column - column index
placementType - the placement type of Comment. When creating large amount of Comments, setting it to PlacementType.MOVE or PlacementType.MOVE_AND_SIZE will get better performance than PlacementType.FREE_FLOATING.
Returns:
Comment Object.

addComment

public Comment addComment(java.lang.String cellName)
Adds a comment to the collection.

Parameters:
cellName - cell name.
Returns:
Comment Object.

removeComment

public Comment removeComment(int row,
                             int column)
Remove a comment from the collection.

Parameters:
row - row index.
column - column index.
Returns:
the Comment Object be removed.

removeComment

public Comment removeComment(java.lang.String cellName)
Remove a comment from the collection.

Parameters:
cellName - cell name.
Returns:
the Comment Object be removed.

clearComments

public void clearComments()
Remove all comments from the collection


removeShape

public boolean removeShape(Shape shape)
Remove a shape from the collection

Parameters:
shape - Shape to be removed
Returns:
true if the shape exists and be removed.

removeShape

public boolean removeShape(int index)
Remove a shape from the collection

Parameters:
index -
Returns:
true if the shape exists and be removed.