|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.sencha.gxt.widget.core.client.Component
com.sencha.gxt.chart.client.draw.DrawComponent
public class DrawComponent
The Draw Component is a surface in which Sprites can be rendered. The
Draw Component manages and holds a Surface instance: an interface
that has an SVG or VML implementation depending on the browser capabilities
and where Sprites can be appended.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
DrawComponent()
Creates a draw widget at the default size. |
|
DrawComponent(int width,
int height)
Creates a draw widget using the given width and height. |
|
| Method Summary | |
|---|---|
void |
addGradient(Gradient gradient)
Adds a Gradient to the draw widget's Surface. |
void |
addSprite(Sprite sprite)
Adds a Sprite to the draw widget's Surface. |
HandlerRegistration |
addSpriteHandler(SpriteHandler handler)
Adds a SpriteHandler handler for SpriteSelectionEvent,
SpriteOutEvent, SpriteOverEvent events. |
HandlerRegistration |
addSpriteOutHandler(SpriteOutEvent.SpriteOutHandler handler)
Adds a SpriteOutEvent.SpriteOutHandler handler for SpriteOutEvent
events. |
HandlerRegistration |
addSpriteOverHandler(SpriteOverEvent.SpriteOverHandler handler)
Adds a SpriteOverEvent.SpriteOverHandler handler for SpriteOverEvent
events. |
HandlerRegistration |
addSpriteSelectionHandler(SpriteSelectionEvent.SpriteSelectionHandler handler)
Adds a SpriteSelectionEvent.SpriteSelectionHandler handler for
SpriteSelectionEvent events. |
Color |
getBackground()
Returns the background color of the component. |
Surface |
getSurface()
Returns the Surface. |
boolean |
isAnimated()
Returns whether or not the chart is animated. |
boolean |
isViewBox()
Returns true if the widget is to have a view box. |
void |
onBrowserEvent(Event event)
|
void |
onMouseDown(Event event)
Method used when the chart is clicked. |
void |
onMouseMove(Event event)
Method used when the mouse moves over the chart. |
void |
onMouseOut(Event event)
Method used when the mouse leaves the chart. |
void |
redrawSurface()
Calls the Surface to render. |
void |
redrawSurfaceForced()
Redraws the surface immediately. |
void |
remove(Sprite sprite)
Removes a Sprite from the draw widget's Surface. |
void |
renderSprite(Sprite sprite)
Renders the given sprite to the surface. |
void |
setAnimated(boolean animated)
Sets whether or not the chart is animated. |
void |
setBackground(Color background)
Sets the background color of the chart. |
void |
setViewBox(boolean viewBox)
Sets whether the Surface has a view box. |
void |
sinkBrowserEvents()
Sinks the mouse browser events on the component if not already sunk. |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DrawComponent()
public DrawComponent(int width,
int height)
width - the width of the draw widgetheight - the height of the draw widget| Method Detail |
|---|
public void addGradient(Gradient gradient)
Gradient to the draw widget's Surface.
gradient - the gradient to be addedpublic void addSprite(Sprite sprite)
Sprite to the draw widget's Surface.
sprite - the sprite to be addedpublic HandlerRegistration addSpriteHandler(SpriteHandler handler)
SpriteHandler.HasSpriteHandlersSpriteHandler handler for SpriteSelectionEvent,
SpriteOutEvent, SpriteOverEvent events.
addSpriteHandler in interface SpriteHandler.HasSpriteHandlershandler - the handler
public HandlerRegistration addSpriteOutHandler(SpriteOutEvent.SpriteOutHandler handler)
SpriteOutEvent.HasSpriteOutHandlersSpriteOutEvent.SpriteOutHandler handler for SpriteOutEvent
events.
addSpriteOutHandler in interface SpriteOutEvent.HasSpriteOutHandlershandler - the handler
public HandlerRegistration addSpriteOverHandler(SpriteOverEvent.SpriteOverHandler handler)
SpriteOverEvent.HasSpriteOverHandlersSpriteOverEvent.SpriteOverHandler handler for SpriteOverEvent
events.
addSpriteOverHandler in interface SpriteOverEvent.HasSpriteOverHandlershandler - the handler
public HandlerRegistration addSpriteSelectionHandler(SpriteSelectionEvent.SpriteSelectionHandler handler)
SpriteSelectionEvent.HasSpriteSelectionHandlersSpriteSelectionEvent.SpriteSelectionHandler handler for
SpriteSelectionEvent events.
addSpriteSelectionHandler in interface SpriteSelectionEvent.HasSpriteSelectionHandlershandler - the handler
public Color getBackground()
public Surface getSurface()
Surface.
public boolean isAnimated()
public boolean isViewBox()
public void onBrowserEvent(Event event)
onBrowserEvent in interface EventListeneronBrowserEvent in class Componentpublic void onMouseDown(Event event)
event - the mouse eventpublic void onMouseMove(Event event)
event - the mouse eventpublic void onMouseOut(Event event)
event - the mouse eventpublic void redrawSurface()
Surface to render.
public void redrawSurfaceForced()
public void remove(Sprite sprite)
Sprite from the draw widget's Surface.
sprite - the sprite to be removedpublic void renderSprite(Sprite sprite)
sprite - the sprite to be renderedpublic void setAnimated(boolean animated)
animated - true if animatedpublic void setBackground(Color background)
background - the background color of the chartpublic void setViewBox(boolean viewBox)
Surface has a view box. The view box is determined
by the bounding box of all the Sprites in the surface.
viewBox - true for the surface to have a view boxpublic void sinkBrowserEvents()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||