|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.user.client.ui.UIObject com.google.gwt.user.client.ui.Widget com.google.gwt.user.client.ui.FocusWidget com.google.gwt.canvas.client.Canvas
public class Canvas
A widget representing a <canvas> element. This widget may not be supported on all browsers.
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 |
Method Summary | |
---|---|
static Canvas |
createIfSupported()
Return a new Canvas if supported, and null otherwise. |
CanvasElement |
getCanvasElement()
Returns the attached Canvas Element. |
Context |
getContext(java.lang.String contextId)
Gets the rendering context that may be used to draw on this canvas. |
Context2d |
getContext2d()
Returns a 2D rendering context. |
int |
getCoordinateSpaceHeight()
Gets the height of the internal canvas coordinate space. |
int |
getCoordinateSpaceWidth()
Gets the width of the internal canvas coordinate space. |
static boolean |
isSupported()
Runtime check for whether the canvas element is supported in this browser. |
void |
setCoordinateSpaceHeight(int height)
Sets the height of the internal canvas coordinate space. |
void |
setCoordinateSpaceWidth(int width)
Sets the width of the internal canvas coordinate space. |
java.lang.String |
toDataUrl()
Returns a data URL for the current content of the canvas element. |
java.lang.String |
toDataUrl(java.lang.String type)
Returns a data URL for the current content of the canvas element, with a specified type. |
static Canvas |
wrap(CanvasElement element)
Wrap an existing canvas element. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Method Detail |
---|
public static Canvas createIfSupported()
Canvas
if supported, and null otherwise.
Canvas
if supported, and null otherwisepublic static Canvas wrap(CanvasElement element)
RootPanel.detachNow(Widget)
.
Note: This method can return null if there is no support for canvas by the
current browser.
element
- the element to wrap
Canvas
widget or null if canvas is not supported by the current browser.public static boolean isSupported()
public CanvasElement getCanvasElement()
public Context getContext(java.lang.String contextId)
contextId
- the context id as a String
public Context2d getContext2d()
getContext(String)
.
public int getCoordinateSpaceHeight()
setCoordinateSpaceHeight(int)
public int getCoordinateSpaceWidth()
setCoordinateSpaceWidth(int)
public void setCoordinateSpaceHeight(int height)
height
- the height, in pixelsgetCoordinateSpaceHeight()
public void setCoordinateSpaceWidth(int width)
width
- the width, in pixelsgetCoordinateSpaceWidth()
public java.lang.String toDataUrl()
public java.lang.String toDataUrl(java.lang.String type)
type
- the type of the data url, e.g., image/jpeg or image/png.
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |