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

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

public class RectangleSprite
extends Sprite

A Sprite that represents a rectangle.


Constructor Summary
RectangleSprite()
          Creates a rectangle with no values.
RectangleSprite(double width, double height)
          Creates a rectangle using the given width and height.
RectangleSprite(double width, double height, double x, double y)
          Creates a rectangle using the given width, height and coordinates.
RectangleSprite(double width, double height, double x, double y, double radius)
          Creates a rectangle using the given width, height, coordinates and corner radius.
RectangleSprite(PreciseRectangle rectangle)
          Creates a rectangle using the given PreciseRectangle.
RectangleSprite(RectangleSprite sprite)
          Creates a copy of the given rectangle.
 
Method Summary
 void clearDirtyFlags()
          Clears all of the dirty flags on the sprite.
 RectangleSprite copy()
          Returns a copy of the sprite.
 double getHeight()
          Returns the height of the rectangle
 PathSprite getPathSprite()
          Returns the Sprite as a path.
 double getRadius()
          Returns the radius of the corners of the rectangle
 double getWidth()
          Returns the width of the rectangle
 double getX()
          Returns the x-coordinate of the rectangle.
 double getY()
          Returns the y-coordinate of the rectangle.
 boolean isDirty()
          Returns true if the sprite changed since the last render.
 boolean isHeightDirty()
          Returns true if the height changed since the last render.
 boolean isRadiusDirty()
          Returns true if the radius changed since the last render.
 boolean isWidthDirty()
          Returns true if the width 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 setHeight(double height)
          Sets the height of the rectangle.
 void setRadius(double radius)
          Sets the radius of the corners of the rectangle
 void setWidth(double width)
          Sets the width of the rectangle.
 void setX(double x)
          Sets the x-coordinate of the rectangle.
 void setY(double y)
          Sets the y-coordinate of the rectangle.
 PreciseRectangle toRectangle()
          Returns the rectangle values of the sprite as a PreciseRectangle.
 String toString()
           
 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, wait, wait, wait
 

Constructor Detail

RectangleSprite

public RectangleSprite()
Creates a rectangle with no values.


RectangleSprite

public RectangleSprite(double width,
                       double height)
Creates a rectangle using the given width and height.

Parameters:
width - the width of the rectangle
height - the height of the rectangle

RectangleSprite

public RectangleSprite(double width,
                       double height,
                       double x,
                       double y)
Creates a rectangle using the given width, height and coordinates.

Parameters:
width - the width of the rectangle
height - the height of the rectangle
x - the x-coordinate of the rectangle
y - the y-coordinate of the rectangle

RectangleSprite

public RectangleSprite(double width,
                       double height,
                       double x,
                       double y,
                       double radius)
Creates a rectangle using the given width, height, coordinates and corner radius.

Parameters:
width - the width of the rectangle
height - the height of the rectangle
x - the x-coordinate of the rectangle
y - the y-coordinate of the rectangle
radius - the radius of the corners of the rectangle

RectangleSprite

public RectangleSprite(PreciseRectangle rectangle)
Creates a rectangle using the given PreciseRectangle.

Parameters:
rectangle - the rectangle to be used by the sprite

RectangleSprite

public RectangleSprite(RectangleSprite sprite)
Creates a copy of the given rectangle.

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 RectangleSprite copy()
Description copied from class: Sprite
Returns a copy of the sprite.

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

getHeight

public double getHeight()
Returns the height of the rectangle

Returns:
the height of the rectangle

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

getRadius

public double getRadius()
Returns the radius of the corners of the rectangle

Returns:
the radius of the corners of the rectangle

getWidth

public double getWidth()
Returns the width of the rectangle

Returns:
the width of the rectangle

getX

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

Returns:
the x-coordinate of the rectangle

getY

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

Returns:
the y-coordinate of the rectangle

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

isHeightDirty

public boolean isHeightDirty()
Returns true if the height changed since the last render.

Returns:
true if the height changed since the last render

isRadiusDirty

public boolean isRadiusDirty()
Returns true if the radius changed since the last render.

Returns:
true if the radius changed since the last render

isWidthDirty

public boolean isWidthDirty()
Returns true if the width changed since the last render.

Returns:
true if the width 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

setHeight

public void setHeight(double height)
Sets the height of the rectangle.

Parameters:
height - the height of the rectangle

setRadius

public void setRadius(double radius)
Sets the radius of the corners of the rectangle

Parameters:
radius - the radius of the corners

setWidth

public void setWidth(double width)
Sets the width of the rectangle.

Parameters:
width - the width of the rectangle

setX

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

Parameters:
x - the x-coordinate of the rectangle

setY

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

Parameters:
y - the y-coordinate of the rectangle

toRectangle

public PreciseRectangle toRectangle()
Returns the rectangle values of the sprite as a PreciseRectangle.

Returns:
the rectangle values of the sprite as a precise rectangle

toString

public String toString()
Overrides:
toString in class Object

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.