![]() |
||
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.Shape
public class Shape
Common Shape Property.
Method Summary | |
---|---|
void |
addHyperlink(java.lang.String address)
Adds a hyperlink to the mso drawing object. |
Characters[] |
getCharacters()
Gets rich text formatting of this Shape. |
ShapeFill |
getFill()
Gets a object that contains fill formatting properties for the specified shape. |
Font |
getFont()
Gets the font of text in shape. |
GroupShape |
getGroup()
get the GroupShape that this shape is in. |
int |
getHeight()
Gets the height, in unit of pixel. |
double |
getHeightCM()
Gets the height, in unit of centimeters. |
float |
getHeightInch()
Gets the height, in unit of inches. |
int |
getHeightInChart()
Gets the height, in units of 1/4000 of the chart area. |
Hyperlink |
getHyperlink()
Gets a hyperlink from the mso drawing object. |
int |
getLeft()
Gets the horizontal offset of shape from its left column, in unit of pixel. |
double |
getLeftCM()
Gets the horizontal offset of shape from its left column, in unit of centimeters. |
float |
getLeftInch()
Gets the horizontal offset of shape from its left column, in unit of inches. |
int |
getLeftInChart()
Gets the horizontal offset of shape from its left column, in units of 1/4000 of the chart area. |
ShapeLine |
getLine()
Gets a object that contains line formatting properties for the shape. |
java.lang.String |
getLinkedCell()
Gets the linked cell of shape. |
int |
getLowerRightColumn()
Gets the lower right column index. |
int |
getLowerRightRow()
Gets the lower right row index. |
java.lang.String |
getName()
Gets the name of this Shape. |
int |
getOrientation()
Gets text orientation. |
int |
getPlacement()
Gets the way the drawing obejct is attached to the cells below it. |
float |
getRotation()
Gets rotation of shape |
java.lang.String |
getText()
Gets the text in shape. |
int |
getTextHorizontalAlignment()
Gets the text horizontal alignment. |
int |
getTextVerticalAlignment()
Gets the text vertical alignment. |
int |
getTop()
Gets the vertical offset of shape from its top row, in unit of pixel. |
double |
getTopCM()
Gets the vertical offset of shape from its top row, in unit of centimeters. |
float |
getTopInch()
Gets the vertical offset of shape from its top row, in unit of inches. |
int |
getTopInChart()
Gets the vertical offset of shape from its top row, in units of 1/4000 of the chart area. |
short |
getType()
Gets the shape type. |
int |
getUpperLeftColumn()
Gets the upper left column index. |
int |
getUpperLeftRow()
Gets the upper left row index. |
int |
getWidth()
Gets the width, in unit of pixel. |
double |
getWidthCM()
Gets the width, in unit of centimeters. |
float |
getWidthInch()
Gets the width, in unit of inches. |
int |
getWidthInChart()
Gets the widthx, in units of 1/4000 of the chart area. |
int |
getZOrderPosition()
Gets the ZOrderPosition of Shape, 1 based. |
boolean |
hasLine()
Indicates whether shape has border line. |
boolean |
isFilled()
Indicates whether shape is filled. |
boolean |
isFlippedHorizontally()
Checks whether shape is flipped horizontally. |
boolean |
isFlippedVertically()
Checks whether shape is flipped vertically. |
boolean |
isLockAspectRatio()
Indicates whether allow changes in aspect ratio. |
boolean |
isLocked()
Check if the object is locked when the sheet is protected. |
boolean |
isPrintable()
Check if the object is printable. |
void |
move(int startRow,
int startColumn)
Moves the shape to a specified location. |
void |
move(int startRow,
int startColumn,
int endRow,
int endColumn)
Moves the shape to a specified location and size. |
void |
moveToCenter(int startRow,
int startColumn,
int endRow,
int endColumn)
Moves the shape to the center of given cell range. |
void |
setCharacters(int startIndex,
int length,
Font font)
Performs rich text formatting. |
void |
setFilled(boolean isFilled)
Sets whether shape is filled. |
void |
setFlippedHorizontally(boolean flipped)
Sets whether shape is flipped horizontally. |
void |
setFlippedVertically(boolean flipped)
Sets whether shape is flipped vertically. |
void |
setFont(Font font)
Sets the font of text in shape. |
void |
setHasLine(boolean hasLine)
Sets whether shape has border line. |
void |
setHeight(int height)
Sets the height, in unit of pixel. |
void |
setHeightCM(double height)
Sets the height, in unit of centimeters. |
void |
setHeightInch(double height)
Sets the height, in unit of inches. |
void |
setHeightInChart(int height)
Sets the height, in units of 1/4000 of the chart area. |
void |
setLeft(int left)
Deprecated. for shape in Chart, use setLeftInChart(int) instead;
for shape in common sheet, use
setLeftPositionInPixel(short, short) instead. |
void |
setLeftCM(double left)
Sets the horizontal offset of shape from its left column, in unit of centimeters. |
void |
setLeftInch(double left)
Sets the horizontal offset of shape from its left column, in unit of inches. |
void |
setLeftInChart(int left)
Sets the horizontal offset of shape from its left column, in units of 1/4000 of the chart area. |
void |
setLeftPosition(short column,
short offsetRatio)
set left border position for shape. |
void |
setLeftPositionInPixel(short column,
short offsetInPixel)
set left border position for shape. |
void |
setLinkedCell(java.lang.String linkedCell)
Sets the linked cell of shape. |
void |
setLockAspectRatio(boolean isLock)
Sets whether allow changes in aspect ratio. |
void |
setLocked(boolean locked)
Sets if the object is locked when the sheet is protected. |
void |
setName(java.lang.String name)
Sets the name of this Shape. |
void |
setOrientation(int orientation)
Sets text orientation. |
void |
setPlacement(byte placementType)
Sets the way the drawing obejct is attached to the cells below it. |
void |
setPrintable(boolean printable)
Sets if the object is printable |
void |
setRotation(float degree)
Rotates the shape |
void |
setText(java.lang.String text)
Sets the text in shape. |
void |
setTextHorizontalAlignment(int textAlignmentType)
Sets the text horizontal alignment. |
void |
setTextVerticalAlignment(int textAlignmentType)
Sets the text vertical alignment. |
void |
setTop(int top)
Deprecated. for shape in Chart, use setTopInChart(int) instead;
for shape in common sheet, use
setTopPositionInPixel(int, short) instead. |
void |
setTopCM(double top)
Sets the vertical offset of shape from its top row, in unit of centimeters. |
void |
setTopInch(double top)
Sets the vertical offset of shape from its top row, in unit of inches. |
void |
setTopInChart(int top)
Sets the vertical offset of shape from its top row, in units of 1/4000 of the chart area. |
void |
setTopPosition(int row,
short offsetRatio)
set top border position for shape. |
void |
setTopPositionInPixel(int row,
short offsetInPixel)
set top border position for shape. |
void |
setUpperLeftColumn(int column)
Deprecated. replaced by setLeftPosition(short, short) |
void |
setUpperLeftRow(int row)
Deprecated. replaced by setTopPosition(int, short) |
void |
setWidth(int width)
Sets the width, in unit of pixel. |
void |
setWidthCM(double width)
Sets the width, in unit of centimeters. |
void |
setWidthInch(double width)
Sets the width, in unit of inches. |
void |
setWidthInChart(int width)
Sets the width, in units of 1/4000 of the chart area. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to be set to Shape.public int getZOrderPosition()
public short getType()
MsoDrawingType
public ShapeFill getFill()
public ShapeLine getLine()
public boolean isFilled()
public void setFilled(boolean isFilled)
isFilled
- whether shape is filled.public Hyperlink getHyperlink()
public void addHyperlink(java.lang.String address)
address
- address of this hyperlink.This parameter can't be empty.public boolean hasLine()
public void setHasLine(boolean hasLine)
hasLine
- whether shape has border line.public boolean isFlippedHorizontally()
public void setFlippedHorizontally(boolean flipped)
flipped
- whether shape is flipped horizontally.public boolean isFlippedVertically()
public void setFlippedVertically(boolean flipped)
flipped
- whether shape is flipped vertically.public void move(int startRow, int startColumn, int endRow, int endColumn)
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.
CellsException
- if shape Object has bean removed.
java.lang.IllegalArgumentException
- if row or column index is out of range.public void move(int startRow, int startColumn)
startRow
- row index of the top left cell.startColumn
- column index of the top left cell.
CellsException
- if shape Object has bean removed.
java.lang.IllegalArgumentException
- if row or column index is out of range.public void moveToCenter(int startRow, int startColumn, int endRow, int endColumn)
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.public int getUpperLeftColumn()
public void setLeftPosition(short column, short offsetRatio)
column
- column where the shape's left border is inoffsetRatio
- ratio of the distance between shape's left border and column's
left border to column's width. in unit of 1/1024, that is,
valid value is between 0 and 1024(inclusive)public void setTopPosition(int row, short offsetRatio)
row
- row where the shape's top border is inoffsetRatio
- ratio of the distance between shape's top border and row's top
border to row's height. in unit of 1/256, that is, valid value
is between 0 and 256(inclusive)public void setLeftPositionInPixel(short column, short offsetInPixel)
column
- column where the shape's left border is inoffsetInPixel
- the distance between shape's left border and column's left
border, in unit of pixelpublic void setTopPositionInPixel(int row, short offsetInPixel)
row
- row where the shape's top border is inoffsetInPixel
- the distance between shape's top border and row's top border,
in unit of pixelpublic void setUpperLeftColumn(int column)
setLeftPosition(short, short)
column
- the upper left column index .public int getUpperLeftRow()
public void setUpperLeftRow(int row)
setTopPosition(int, short)
row
- the upper left row index.public int getLowerRightRow()
public int getLowerRightColumn()
public int getHeight()
public void setHeight(int height)
height
- the height, in unit of pixel.public int getHeightInChart()
public void setHeightInChart(int height)
height
- the height, in units of 1/4000 of the chart area.
java.lang.IllegalArgumentException
- if height > 4000;public float getHeightInch()
public void setHeightInch(double height)
height
- the heigh, in unit of inches.public double getHeightCM()
public void setHeightCM(double height)
height
- the height, in unit of centimeters.public int getWidth()
public void setWidth(int width)
width
- the width, in unit of pixel.public int getWidthInChart()
public void setWidthInChart(int width)
width
- the width, in units of 1/4000 of the chart area.
java.lang.IllegalArgumentException
- if width > 4000;public float getWidthInch()
public void setWidthInch(double width)
width
- the width, in unit of inches.public double getWidthCM()
public void setWidthCM(double width)
width
- the width, in unit of centimeters.public int getLeft()
public void setLeft(int left)
setLeftInChart(int)
instead;
for shape in common sheet, use
setLeftPositionInPixel(short, short)
instead.
left
- the horizontal offset of shape from its left column, in unit
of pixel.public int getLeftInChart()
public void setLeftInChart(int left)
left
- the horizontal offset of shape from its left column, in units
of 1/4000 of the chart area.
java.lang.IllegalArgumentException
- if left > 4000;public float getLeftInch()
public void setLeftInch(double left)
left
- the horizontal offset of shape from its left column, in unit
of inches.public double getLeftCM()
public void setLeftCM(double left)
left
- the horizontal offset of shape from its left column, in unit
of centimeters.public int getTop()
public void setTop(int top)
setTopInChart(int)
instead;
for shape in common sheet, use
setTopPositionInPixel(int, short)
instead.
top
- the vertical offset of shape from its top row, in unit of
pixel.public int getTopInChart()
public void setTopInChart(int top)
top
- the vertical offset of shape from its top row, in units of
1/4000 of the chart area.
java.lang.IllegalArgumentException
- if top > 4000;public float getTopInch()
public void setTopInch(double top)
top
- the vertical offset of shape from its top row, in unit of
inches.public double getTopCM()
public void setTopCM(double top)
top
- the vertical offset of shape from its top row, in unit of
centimeters.public int getPlacement()
setPlacement(byte)
public void setPlacement(byte placementType)
placementType
- the way the drawing obejct is attached to the cells below it. It
could be one of the following values: PlacementType.FREE_FLOATING |
PlacementType.MOVE |
PlacementType.MOVE_AND_SIZE |
java.lang.IllegalArgumentException
- if placementType is not member of PlacementTypepublic GroupShape getGroup()
public void setRotation(float degree)
degree
- degree for rotate anglepublic float getRotation()
public boolean isLocked()
public void setLocked(boolean locked)
locked
- true if the object is locked, false if the object can be modified when the sheet is protected.public boolean isPrintable()
public void setPrintable(boolean printable)
printable
- if the object is printablepublic boolean isLockAspectRatio()
public void setLockAspectRatio(boolean isLock)
isLock
- whether allow changes in aspect ratio.public Font getFont()
CellsException
- if shape has been removed.public void setFont(Font font)
font
- the font of text in shape.
CellsException
- if shape has been removed.public java.lang.String getText()
CellsException
- if shape has been removed.public void setText(java.lang.String text)
text
- the text in shape.
CellsException
- if shape has been removed.public Characters[] getCharacters()
CellsException
- if shape has been removed.public void setCharacters(int startIndex, int length, Font font)
startIndex
- start index.length
- character counts.
If length is negative, all characters after the start index are formatted.
If length is 0, no characters is formatted.font
- font for the specified range. It can be null which means shape's font is used.
CellsException
- if shape has been removed.public java.lang.String getLinkedCell()
CellsException
- if shape has been removed.public void setLinkedCell(java.lang.String linkedCell)
linkedCell
- the linked cell.
CellsException
- if shape has been removed.public int getTextHorizontalAlignment()
CellsException
- if shape has been removed.setTextHorizontalAlignment(int)
public void setTextHorizontalAlignment(int textAlignmentType)
textAlignmentType
- the text horizontal alignment.
It could be one of the following values: TextAlignmentType.LEFT |
TextAlignmentType.CENTER |
TextAlignmentType.RIGHT |
TextAlignmentType.JUSTIFY |
TextAlignmentType.DISTRIBUTED |
CellsException
- if shape has been removed.
java.lang.IllegalArgumentException
- if text alignment type is invalid.public int getTextVerticalAlignment()
CellsException
- if shape has been removed.setTextVerticalAlignment(int)
public void setTextVerticalAlignment(int textAlignmentType)
textAlignmentType
- the text vertical alignment.
It could be one of the following values: TextAlignmentType.TOP |
TextAlignmentType.CENTER |
TextAlignmentType.BOTTOM |
TextAlignmentType.JUSTIFY |
TextAlignmentType.DISTRIBUTED |
CellsException
- if shape has been removed.
java.lang.IllegalArgumentException
- if text alignment type is invalid.public int getOrientation()
CellsException
- if shape has been removed.setOrientation(int)
public void setOrientation(int orientation)
MsoTextOrientation.NO_ROTATED |
MsoTextOrientation.TOP_TO_BOTTOM |
MsoTextOrientation.UPWARD |
MsoTextOrientation.DOWNWARD |
java.lang.IllegalArgumentException
- if rotation is one of MsoTextOrientation constants.
CellsException
- if shape has been removed.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |