![]() |
||
Home Products Purchase Downloads Demos Forums Blogs Ticket Wiki API Corporate |
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.cells.Shapes
public class Shapes
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 |
---|
public Shape addShape(short shapeType, int row, int column, int left, int top, int width, int height, java.io.InputStream stream)
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.
java.lang.IllegalArgumentException
- if position or size value is out of range.
CellsException
- if the collection has been removed.public Shape addCopy(Shape source)
source
- the source shape to be copied.
public Shape get(int index)
index
-
public int size()
public GroupShape group(Shape[] children)
children
- shapes to be grouped
public void unGroup(GroupShape group)
group
- GroupShape whose children to be ungroupedpublic LineShape addLine(int row, int column, int left, int top, int width, int height)
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;
public RectangleShape addRectangle(int row, int column, int left, int top, int width, int height)
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;
public OvalShape addOval(int row, int column, int left, int top, int width, int height)
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;
public ArcShape addArc(int row, int column, int left, int top, int width, int height)
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;
public TextBox addTextBox(int row, int column, int left, int top, int width, int height)
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;
java.lang.IllegalArgumentException
- if position or size value is out of range.public TextBox addTextBoxInChart(int left, int top, int width, int height)
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.
java.lang.UnsupportedOperationException
- if Shapes object does not belong to Chartpublic Button addButton(int row, int column, int left, int top, int width, int height)
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;
java.lang.IllegalArgumentException
- if position or size value is out of range.public Picture addPicture(int startRow, int startColumn, int endRow, int endColumn, java.lang.String fileName)
BMP |
JPEG |
PNG |
GIF |
WMF |
EMF |
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.
java.lang.IllegalArgumentException
- if the file is not exsiting.
java.lang.IllegalArgumentException
- if image foramt is not supported.public Picture addPicture(int startRow, int startColumn, int endRow, int endColumn, java.io.InputStream inputStream)
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.
java.lang.IllegalArgumentException
- if image foramt is not supported.addPicture(int, int, int, int, String)
public Picture addPicture(int startRow, int startColumn, java.io.InputStream inputStream, int widthScale, int heightScale)
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.
java.lang.IllegalArgumentException
- if image foramt is not supported.addPicture(int, int, int, int, String)
public Picture addPicture(int startRow, int startColumn, java.lang.String fileName, int widthScale, int heightScale)
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.
java.lang.IllegalArgumentException
- if the file is not exsiting.
java.lang.IllegalArgumentException
- if image foramt is not supported.addPicture(int, int, int, int, String)
public Picture addPicture(int startRow, int startColumn, java.io.InputStream inputStream)
startRow
- row index of the top left cell.startColumn
- column index of the top left cell.inputStream
- Stream object which contains the image data.
java.lang.IllegalArgumentException
- if image foramt is not supported.addPicture(int, int, int, int, String)
public Picture addPicture(int startRow, int startColumn, java.lang.String fileName)
startRow
- row index of the top left cell.startColumn
- column index of the top left cell.fileName
- Image filename.
java.lang.IllegalArgumentException
- if the file is not exsiting.
java.lang.IllegalArgumentException
- if image foramt is not supported.addPicture(int, int, int, int, String)
public Picture addPictureInChart(int top, int left, int widthScale, int heightScale, java.io.InputStream inputStream)
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.
java.lang.IllegalArgumentException
- if position value is out of range.public Picture addPictureInChart(int top, int left, int widthScale, int heightScale, java.lang.String fileName)
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.
java.lang.IllegalArgumentException
- if the file is not exsiting.
java.lang.IllegalArgumentException
- if position value is out of range.public CheckBox addCheckBox(int row, int column, int left, int top, int width, int height)
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.
java.lang.IllegalArgumentException
- if row or column index is out of range.public GroupBox addGroupBox(int row, int column, int left, int top, int width, int height)
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.
java.lang.IllegalArgumentException
- if row or column index is out of range.public ComboBox addComboBox(int row, int column, int left, int top, int width, int height)
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.
java.lang.IllegalArgumentException
- if row or column index is out of range.public RadioButton addRadioButton(int row, int column, int left, int top, int width, int height)
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.
java.lang.IllegalArgumentException
- if row or column index is out of range.public Label addLabel(int row, int column, int left, int top, int width, int height)
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.
java.lang.IllegalArgumentException
- if row or column index is out of range.public Spinner addSpinner(int row, int column, int left, int top, int width, int height)
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.
java.lang.IllegalArgumentException
- if row or column index is out of range.public ScrollBar addScrollBar(int row, int column, int left, int top, int width, int height)
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.
java.lang.IllegalArgumentException
- if row or column index is out of range.public ListBox addListBox(int row, int column, int left, int top, int width, int height)
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.
java.lang.IllegalArgumentException
- if row or column index is out of range.public OleObject addOleObject(int row, int column, int left, int top, byte[] imageData, byte[] objectData)
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
public OleObject addOleObject(int row, int column, int left, int top, byte[] imageData, byte[] objectData, byte fileType, java.lang.String sourceFullName)
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 objectfileType
- the embeded object's file type, supproted file type see
OleFileType
.sourceFullName
- the ole native source full file name
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)
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 objectfileType
- the embeded object's file type, supproted file type see
OleFileType
.sourceFullName
- the ole native source full file name
public Comment getComment(int row, int column)
row
- row indexcolumn
- column index
public Comment addComment(int row, int column)
row
- row index.column
- column index.
public Comment addComment(int row, int column, byte placementType)
row
- row indexcolumn
- column indexplacementType
- 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
.
public Comment addComment(java.lang.String cellName)
cellName
- cell name.
public Comment removeComment(int row, int column)
row
- row index.column
- column index.
public Comment removeComment(java.lang.String cellName)
cellName
- cell name.
public void clearComments()
public boolean removeShape(Shape shape)
shape
- Shape to be removed
public boolean removeShape(int index)
index
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |