|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sencha.gxt.chart.client.draw.Surface
public abstract class Surface
A Surface is an interface to render methods inside a draw
DrawComponent. A Surface contains methods to render Sprites,
get bounding boxes of sprites, add sprites to the canvas, initialize other
graphic components, etc. One of the most used methods for this class is the
add(Sprite...) method, to add sprites to the surface.
| Constructor Summary | |
|---|---|
Surface()
|
|
| Method Summary | |
|---|---|
void |
add(Sprite... sprites)
Adds a Sprite to the surface. |
abstract void |
addGradient(Gradient... gradients)
Adds the passed Gradients to the surface. |
static Surface |
create(DrawComponent component)
Instantiates a surface instance via deferred binding. |
static Surface |
create(DrawComponent component,
int width,
int height)
Instantiates a surface instance via deferred binding. |
void |
draw()
Renders the surface to the DOM as well as any sprites already added. |
PreciseRectangle |
getBBox(Sprite sprite)
Calculates the bounding box of the given sprite. |
DrawComponent |
getComponent()
Returns the draw component that the surface is attached. |
int |
getHeight()
Returns the height of the surface. |
SpriteList<Sprite> |
getSprites()
Returns the SpriteList containing all the sprites in the surface. |
XElement |
getSurfaceElement()
Returns the element of the surface. |
int |
getWidth()
Returns the width of the surface. |
void |
remove(Sprite sprite)
Removes the given sprite from the surface. |
abstract void |
renderSprite(Sprite sprite)
Renders the given sprite to the DOM. |
void |
setBackground(Color background)
Set the background color of the surface. |
abstract void |
setCursor(Sprite sprite,
String property)
Sets the cursor property for the given sprite. |
void |
setHeight(int height)
Sets the height of the surface. |
abstract void |
setViewBox(double x,
double y,
double width,
double height)
Sets the view box of the surface. |
void |
setWidth(int width)
Sets the width of the surface. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Surface()
| Method Detail |
|---|
public static Surface create(DrawComponent component)
SVG. If the user agent is IE 6, 7, or 8 VML will be
used.
component - the element that the surface will be attached
public static Surface create(DrawComponent component,
int width,
int height)
SVG. If the user agent is IE 6, 7, or 8 VML will be
used.
component - the element that the surface will be attachedwidth - the width of the surfaceheight - the height of the surface
public void add(Sprite... sprites)
Sprite to the surface. The sprite is not rendered to the DOM
until draw() or Sprite.redraw() is called.
sprites - the sprites to be addedpublic abstract void addGradient(Gradient... gradients)
Gradients to the surface.
gradients - the gradients to be addedpublic void draw()
public PreciseRectangle getBBox(Sprite sprite)
sprite - the sprite to be used in the calculation
public DrawComponent getComponent()
public int getHeight()
public SpriteList<Sprite> getSprites()
SpriteList containing all the sprites in the surface.
SpriteList containing all the sprites in the surfacepublic XElement getSurfaceElement()
public int getWidth()
public void remove(Sprite sprite)
sprite - the sprite to be removedpublic abstract void renderSprite(Sprite sprite)
sprite - the sprite to be renderedpublic void setBackground(Color background)
background - the background color
public abstract void setCursor(Sprite sprite,
String property)
sprite - the sprite to be setproperty - the property to usepublic void setHeight(int height)
height - the height of the surface.
public abstract void setViewBox(double x,
double y,
double width,
double height)
x - the x coordinate of the viewboxy - the y coordinate of the viewboxwidth - the width of the viewboxheight - the height of the viewboxpublic void setWidth(int width)
width - the width of the surface.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||