Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate


com.aspose.cells
Class Title

java.lang.Object
  extended by com.aspose.cells.ChartFrame
      extended by com.aspose.cells.Title

public class Title
extends ChartFrame

Encapsulates the object that represents the title of chart or axis.


Method Summary
 byte getBackgroundMode()
          Gets the display mode of the background.
 Characters[] getCharacters()
          Gets rich text formatting of this Title.
 Font getFont()
          Gets a Font object of title.
 int getRotation()
          Gets text rotation angel.
 java.lang.String getText()
          Gets the text of a frame's title.
 int getTextDirection()
          Gets the text direction type.
 int getTextHorizontalAlignment()
          Gets the text horizontal alignment.
 int getTextVerticalAlignment()
          Gets the text vertical alignment of text.
 int getX()
          Gets the x coordinate of the Title's center in units of 1/4000 of the chart area.
 int getY()
          Gets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
 boolean isAutoScaleFont()
          Check whether the text in the object changes font size when the object size changes.
 boolean isShadow()
          Indicates if the frame has a shadow.
 void setAutoScaleFont(boolean isAutoScaleFont)
          Set whether the text in the object changes font size when the object size changes.
 void setBackgroundMode(byte mode)
          Sets the display mode of the background.
 void setCharacters(int startIndex, int length, Font font)
          Performs rich text formatting.
 void setFont(Font font)
          Sets a Font object of title.
 void setRotation(int rotation)
          Sets text rotation angel.Must be between -90 and 90.
 void setShadow(boolean shadow)
          Sets if the frame has a shadow.
 void setText(java.lang.String content)
          Sets the text of a frame's title.
 void setTextDirection(int directionType)
          Sets the text direction type.
 void setTextHorizontalAlignment(int textAlignmentType)
          Sets the text horizontal alignment.
 void setTextVerticalAlignment(int textAlignmentType)
          Sets the text vertical alignment of text.
 void setX(int x)
          Sets the x coordinate of the Title's center in units of 1/4000 of the chart area.
 void setY(int y)
          Sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
 
Methods inherited from class com.aspose.cells.ChartFrame
equals, getArea, getAreaOrNull, getBorder, getBorderOrNull
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getText

public java.lang.String getText()
Gets the text of a frame's title.

Returns:
the text of a frame's title.
Throws:
CellsException - if chart has bean removed.

setText

public void setText(java.lang.String content)
Sets the text of a frame's title.

Parameters:
content - the text of a frame's title. If null, will use automatically generated text string; If "", means no Title shown
Throws:
CellsException - if chart has bean removed.

getCharacters

public Characters[] getCharacters()
Gets rich text formatting of this Title.

Returns:
rich text formatting of this Title. If this title does not contains text or no rich text formatting be applied, return null.

setCharacters

public void setCharacters(int startIndex,
                          int length,
                          Font font)
Performs rich text formatting.

Parameters:
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 title's font is used.

getFont

public Font getFont()
Gets a Font object of title.

Returns:
a Font object.
Throws:
CellsException - if chart has bean removed.

setFont

public void setFont(Font font)
Sets a Font object of title.

Parameters:
font - a Font object.
Throws:
CellsException - if chart has bean removed.

isAutoScaleFont

public boolean isAutoScaleFont()
Check whether the text in the object changes font size when the object size changes.

Returns:
true if the text in the object changes font size when the object size changes.

setAutoScaleFont

public void setAutoScaleFont(boolean isAutoScaleFont)
Set whether the text in the object changes font size when the object size changes.

Parameters:
isAutoScaleFont - true if the text in the object changes font size when the object size changes.

getTextHorizontalAlignment

public int getTextHorizontalAlignment()
Gets the text horizontal alignment.

Returns:
the text horizontal alignment.
Throws:
CellsException - if chart has bean removed.
See Also:
setTextHorizontalAlignment(int)

setTextHorizontalAlignment

public void setTextHorizontalAlignment(int textAlignmentType)
Sets the text horizontal alignment.

Parameters:
textAlignmentType - the text horizontal alignment. It could be one of the following values:
TextAlignmentType.LEFT
TextAlignmentType.CENTER
TextAlignmentType.RIGHT
TextAlignmentType.JUSTIFY
TextAlignmentType.DISTRIBUTED
Throws:
CellsException - if chart has bean removed.
java.lang.IllegalArgumentException - if text alignment type is invalid.

getTextVerticalAlignment

public int getTextVerticalAlignment()
Gets the text vertical alignment of text.

Returns:
the text vertical alignment of text.
Throws:
CellsException - if chart has bean removed.
See Also:
setTextVerticalAlignment(int)

setTextVerticalAlignment

public void setTextVerticalAlignment(int textAlignmentType)
Sets the text vertical alignment of text.

Parameters:
textAlignmentType - the text vertical alignment of text. It could be one of the following values:
TextAlignmentType.TOP
TextAlignmentType.CENTER
TextAlignmentType.BOTTOM
TextAlignmentType.JUSTIFY
TextAlignmentType.DISTRIBUTED
Throws:
CellsException - if chart has bean removed.
java.lang.IllegalArgumentException - if text alignment type is invalid.

setRotation

public void setRotation(int rotation)
Sets text rotation angel.Must be between -90 and 90.

Parameters:
rotation - text rotation angel.
Throws:
java.lang.IllegalArgumentException - if rotation is not between -90 and 90.
CellsException - if chart has bean removed.

getRotation

public int getRotation()
Gets text rotation angel.

Returns:
text rotation angel.
Throws:
CellsException - if chart has bean removed.

getBackgroundMode

public byte getBackgroundMode()
Gets the display mode of the background.

Returns:
the display mode of the background.
See Also:
setBackgroundMode(byte)

setBackgroundMode

public void setBackgroundMode(byte mode)
Sets the display mode of the background.

Parameters:
mode - the display mode of the background. It could be one of following:
BackgroundMode.AUTOMATIC
BackgroundMode.TRANSPARENT
BackgroundMode.OPAQUE

getX

public int getX()
Gets the x coordinate of the Title's center in units of 1/4000 of the chart area.

Returns:
the x coordinate of the upper left corner.

setX

public void setX(int x)
Sets the x coordinate of the Title's center in units of 1/4000 of the chart area.

Parameters:
x - the x coordinate of the upper left corner.
Throws:
CellsException - if chart has bean removed.
java.lang.IllegalArgumentException - if x > 4000;

getY

public int getY()
Gets the y coordinate of the upper left corner in units of 1/4000 of the chart area.

Returns:
the y coordinate of the upper left corner.

setY

public void setY(int y)
Sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.

Parameters:
y - the y coordinate of the upper left corner.
Throws:
CellsException - if chart has bean removed.
java.lang.IllegalArgumentException - if y > 4000;

getTextDirection

public int getTextDirection()
Gets the text direction type.

Returns:
the text direction type.
See Also:
TextDirectionType

setTextDirection

public void setTextDirection(int directionType)
Sets the text direction type.

Parameters:
directionType - the direction type. * It must be one of the following values:
TextDirectionType.CONTEXT
TextDirectionType.LEFT_TO_RIGHT
TextDirectionType.RIGHT_TO_LEFT
Throws:
java.lang.IllegalArgumentException - if the direction type is invalid.
See Also:
TextDirectionType

isShadow

public boolean isShadow()
Indicates if the frame has a shadow.

Returns:
true if the frame has a shadow.

setShadow

public void setShadow(boolean shadow)
Sets if the frame has a shadow.

Parameters:
shadow - true if the frame has a shadow.