com.sencha.gxt.chart.client.draw.sprite
Class TextSprite

java.lang.Object
  extended by com.sencha.gxt.chart.client.draw.sprite.Sprite
      extended by com.sencha.gxt.chart.client.draw.sprite.TextSprite

public class TextSprite
extends Sprite

A Sprite that represents text.


Nested Class Summary
static class TextSprite.TextAnchor
          Enum for TextSprite anchor.
 
Constructor Summary
TextSprite()
          Creates a text sprite.
TextSprite(String text)
          Creates a text sprite with the given text.
TextSprite(TextSprite sprite)
          Creates a copy of the given text sprite.
 
Method Summary
 void clearDirtyFlags()
          Clears all of the dirty flags on the sprite.
 TextSprite copy()
          Returns a copy of the sprite.
 String getFont()
          Returns the font of the text.
 int getFontSize()
          Returns the font size of the text.
 Style.FontStyle getFontStyle()
          Returns the Style.FontStyle of the text.
 Style.FontWeight getFontWeight()
          Returns the Style.FontWeight of the text.
 PathSprite getPathSprite()
          Returns the Sprite as a path.
 String getText()
          Returns the content of the text.
 TextSprite.TextAnchor getTextAnchor()
          Returns the text anchor.
 double getX()
          Returns the x-coordinate of the text.
 double getY()
          Returns the y-coordinate of the text.
 boolean isDirty()
          Returns true if the sprite changed since the last render.
 boolean isFontDirty()
          Returns true if the font changed since the last render.
 boolean isFontSizeDirty()
          Returns true if the font size changed since the last render.
 boolean isFontStyleDirty()
          Returns true if the font style changed since the last render.
 boolean isFontWeightDirty()
          Returns true if the font weight changed since the last render.
 boolean isTextAnchorDirty()
          Returns true if the text anchor changed since the last render.
 boolean isTextDirty()
          Returns true if the text changed since the last render.
 boolean isXDirty()
          Returns true if the x changed since the last render.
 boolean isYDirty()
          Returns true if the y changed since the last render.
 void setFont(String font)
          Sets the font of the text.
 void setFontSize(int fontSize)
          Sets the font size of the text.
 void setFontStyle(Style.FontStyle fontStyle)
          Sets the Style.FontStyle of the text.
 void setFontWeight(Style.FontWeight fontWeight)
          Sets the Style.FontWeight of the text.
 void setText(String text)
          Sets the content of the text.
 void setTextAnchor(TextSprite.TextAnchor textAnchor)
          Sets the TextSprite.TextAnchor of the text.
 void setX(double x)
          Sets the x-coordinate of the text.
 void setY(double y)
          Sets the y-coordinate of the text.
 void update(Sprite sprite)
          Updates the attributes of the sprite using the given sprite.
 
Methods inherited from class com.sencha.gxt.chart.client.draw.sprite.Sprite
getBBox, getClipRectangle, getComponent, getFill, getFillOpacity, getOpacity, getRotation, getScaling, getStroke, getStrokeOpacity, getStrokeWidth, getSurface, getTranslation, getzIndex, isClipRectangleDirty, isFillDirty, isFillOpacityDirty, isHidden, isHiddenDirty, isOpacityDirty, isStrokeDirty, isStrokeOpacityDirty, isStrokeWidthDirty, isTransformDirty, isZIndexDirty, redraw, remove, setClipRectangle, setComponent, setCursor, setFill, setFillOpacity, setHidden, setOpacity, setRotation, setRotation, setRotation, setScaling, setScaling, setScaling, setStroke, setStrokeOpacity, setStrokeWidth, setSurface, setTranslation, setTranslation, setZIndex, transformMatrix
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextSprite

public TextSprite()
Creates a text sprite.


TextSprite

public TextSprite(String text)
Creates a text sprite with the given text.

Parameters:
text - the text represented in the sprite

TextSprite

public TextSprite(TextSprite sprite)
Creates a copy of the given text sprite.

Parameters:
sprite - the sprite to be copied
Method Detail

clearDirtyFlags

public void clearDirtyFlags()
Description copied from class: Sprite
Clears all of the dirty flags on the sprite.

Overrides:
clearDirtyFlags in class Sprite

copy

public TextSprite copy()
Description copied from class: Sprite
Returns a copy of the sprite.

Specified by:
copy in class Sprite
Returns:
copy of the sprite

getFont

public String getFont()
Returns the font of the text.

Returns:
the font of the text

getFontSize

public int getFontSize()
Returns the font size of the text.

Returns:
the font size of the text

getFontStyle

public Style.FontStyle getFontStyle()
Returns the Style.FontStyle of the text.

Returns:
the font style of the text

getFontWeight

public Style.FontWeight getFontWeight()
Returns the Style.FontWeight of the text.

Returns:
the font weight of the text

getPathSprite

public PathSprite getPathSprite()
Description copied from class: Sprite
Returns the Sprite as a path.

Specified by:
getPathSprite in class Sprite
Returns:
the sprite as a path

getText

public String getText()
Returns the content of the text.

Returns:
the content of the text

getTextAnchor

public TextSprite.TextAnchor getTextAnchor()
Returns the text anchor.

Returns:
the text anchor

getX

public double getX()
Returns the x-coordinate of the text.

Returns:
the x-coordinate of the text

getY

public double getY()
Returns the y-coordinate of the text.

Returns:
the y-coordinate of the text

isDirty

public boolean isDirty()
Description copied from class: Sprite
Returns true if the sprite changed since the last render.

Overrides:
isDirty in class Sprite
Returns:
true if the sprite changed since the last render

isFontDirty

public boolean isFontDirty()
Returns true if the font changed since the last render.

Returns:
true if the font changed since the last render

isFontSizeDirty

public boolean isFontSizeDirty()
Returns true if the font size changed since the last render.

Returns:
true if the font size changed since the last render

isFontStyleDirty

public boolean isFontStyleDirty()
Returns true if the font style changed since the last render.

Returns:
true if the font style changed since the last render

isFontWeightDirty

public boolean isFontWeightDirty()
Returns true if the font weight changed since the last render.

Returns:
true if the font weight changed since the last render

isTextAnchorDirty

public boolean isTextAnchorDirty()
Returns true if the text anchor changed since the last render.

Returns:
true if the text anchor changed since the last render

isTextDirty

public boolean isTextDirty()
Returns true if the text changed since the last render.

Returns:
true if the text changed since the last render

isXDirty

public boolean isXDirty()
Returns true if the x changed since the last render.

Returns:
true if the x changed since the last render

isYDirty

public boolean isYDirty()
Returns true if the y changed since the last render.

Returns:
true if the y changed since the last render

setFont

public void setFont(String font)
Sets the font of the text.

Parameters:
font - the font of the text

setFontSize

public void setFontSize(int fontSize)
Sets the font size of the text.

Parameters:
fontSize - the font size of the text

setFontStyle

public void setFontStyle(Style.FontStyle fontStyle)
Sets the Style.FontStyle of the text.

Parameters:
fontStyle - the font style of the text

setFontWeight

public void setFontWeight(Style.FontWeight fontWeight)
Sets the Style.FontWeight of the text.

Parameters:
fontWeight - the font weight of the text

setText

public void setText(String text)
Sets the content of the text.

Parameters:
text - the content of the text

setTextAnchor

public void setTextAnchor(TextSprite.TextAnchor textAnchor)
Sets the TextSprite.TextAnchor of the text.

Parameters:
textAnchor - the anchor of the text

setX

public void setX(double x)
Sets the x-coordinate of the text.

Parameters:
x - the x-coordinate of the text

setY

public void setY(double y)
Sets the y-coordinate of the text.

Parameters:
y - the y-coordinate of the text

update

public void update(Sprite sprite)
Description copied from class: Sprite
Updates the attributes of the sprite using the given sprite.

Overrides:
update in class Sprite
Parameters:
sprite - the sprite attributes to use


Copyright © 2011. All Rights Reserved.