|
|||||||||
| 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.smartgwt.client.widgets.BaseWidget
com.smartgwt.client.widgets.Canvas
com.smartgwt.client.widgets.drawing.DrawPane
public class DrawPane
Container for DrawLine, DrawOval, DrawPath, and other DrawItem-based components. These components provide consistent
cross-browser APIs for rendering shapes using using the browsers' built in vector graphics capabilities. These include
SVG (Scalable Vector Graphics) where available, VML (Vector Markup Language) for Microsoft
browsers, and the HTML5 <canvas> tag.
You can use any of the following approaches to create DrawPanes and DrawItems:
To
use DrawPane in SmartGWT, include the Drawing module in your application by including <inherits
name="com.smartgwt.Drawing"/> in your GWT module XML.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
|---|
config, configOnly, id, isElementSet, nativeObject, scClassName |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
DrawPane()
|
|
DrawPane(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
| Method Summary | |
|---|---|
void |
addDrawItem(DrawItem item,
boolean autoDraw)
Add a drawItem to this drawPane (if necessary removing it from any other drawPanes) |
protected com.google.gwt.core.client.JavaScriptObject |
create()
|
java.lang.String |
createLinearGradient(java.lang.String id,
LinearGradient linearGradient)
Creates a linear gradient which can be used within any DrawItem Any DrawItems fillGradient can reference this gradient by the given name. |
java.lang.String |
createRadialGradient(java.lang.String id,
RadialGradient radialGradient)
Creates a radial gradient which can be used within any DrawItem Any DrawItems fillGradient can reference this gradient by the given name. |
java.lang.String |
createSimpleGradient(java.lang.String id,
SimpleGradient simple)
Creates a simple linear gradient which can be used within any DrawItem Any DrawItems fillGradient can reference this gradient by the given name. |
void |
destroyItems()
Permanently destroy all DrawItems currently associated with
this DrawPane, leaving the DrawPane itself intact |
void |
erase()
Call DrawItem.erase on all DrawItems currently associated
with the DrawPane. |
java.lang.Boolean |
getCanDrag()
In order to enable dragging of drawItems, this property must be set to true, in addition to canDrag. |
DrawItem[] |
getDrawItems()
Array of DrawItems to initially display in this DrawPane. |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
getLogicalStructure()
|
static DrawPane |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
float |
getRotation()
Rotation for the DrawPane as a whole, in degrees. |
java.lang.String |
getSvgString()
Converts this DrawPane to the source of an <svg> element equivalent to the current drawing. |
float |
getZoomLevel()
Zoom for the drawPane as a whole, where 1 is normal size. |
void |
setCanDrag(java.lang.Boolean canDrag)
In order to enable dragging of drawItems, this property must be set to true, in addition to canDrag. |
static void |
setDefaultProperties(DrawPane drawPaneProperties)
Class level method to set the default properties of this class. |
void |
setDrawItems(DrawItem... drawItems)
Array of DrawItems to initially display in this DrawPane. |
void |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
|
com.smartgwt.logicalstructure.core.LogicalStructureObject |
setLogicalStructure(com.smartgwt.logicalstructure.widgets.drawing.DrawPaneLogicalStructure s)
|
void |
setRotation(float rotation)
Rotation for the DrawPane as a whole, in degrees. |
void |
setZoomLevel(float zoomLevel)
Zoom for the drawPane as a whole, where 1 is normal size. |
void |
zoom(float zoom)
Zoom this drawPane to the specified magnification, maintaining the current viewport position |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public DrawPane()
public DrawPane(com.google.gwt.core.client.JavaScriptObject jsObj)
| Method Detail |
|---|
public static DrawPane getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
setJavaScriptObject in class Canvasprotected com.google.gwt.core.client.JavaScriptObject create()
create in class Canvaspublic void setCanDrag(java.lang.Boolean canDrag)
canDrag.
setCanDrag in class CanvascanDrag - canDrag Default value is falseDragdrop overview and related methods,
Drag create Examplepublic java.lang.Boolean getCanDrag()
canDrag.
getCanDrag in class CanvasDragdrop overview and related methods,
Drag create Example
public void setDrawItems(DrawItem... drawItems)
throws java.lang.IllegalStateException
drawItems - drawItems Default value is null
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic DrawItem[] getDrawItems()
public void setRotation(float rotation)
rotation - rotation Default value is 0public float getRotation()
public void setZoomLevel(float zoomLevel)
zoomLevel - zoomLevel Default value is 1public float getZoomLevel()
public void addDrawItem(DrawItem item,
boolean autoDraw)
item - drawItem to addautoDraw - If explicitly set to false, and this drawPane is drawn, don't draw the newly added item
public java.lang.String createLinearGradient(java.lang.String id,
LinearGradient linearGradient)
id - the name of the linear gradientlinearGradient - the linear gradient
public java.lang.String createRadialGradient(java.lang.String id,
RadialGradient radialGradient)
id - the name of the radial gradientradialGradient - the radial gradient
public java.lang.String createSimpleGradient(java.lang.String id,
SimpleGradient simple)
id - the name of the linear gradientsimple -
public void destroyItems()
destroy all DrawItems currently associated with
this DrawPane, leaving the DrawPane itself intact
public void erase()
DrawItem.erase on all DrawItems currently associated
with the DrawPane. The DrawItems will continue to exist, and you can call draw() on them to make them appear
again, or destroy to get rid of them permanetly. Use
DrawPane.destroyItems to permanently get rid of all
DrawItems.
public java.lang.String getSvgString()
<svg> element equivalent to the current drawing.
<svg> element.public void zoom(float zoom)
zoom - Desired zoom level as a float where 1.0 is equivalent to 100% magnification.public static void setDefaultProperties(DrawPane drawPaneProperties)
Note: This method is intended for setting default attributes only and will effect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead.
drawPaneProperties - properties that should be used as new defaults when instances of this class are createdpublic com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.drawing.DrawPaneLogicalStructure s)
public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
getLogicalStructure in interface LogicalStructuregetLogicalStructure in class Canvas
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||