com.gwt.components.client
Class Canvas

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.FocusWidget
              extended by com.gwt.components.client.Canvas
All Implemented Interfaces:
com.google.gwt.event.dom.client.HasAllFocusHandlers, com.google.gwt.event.dom.client.HasAllKeyHandlers, com.google.gwt.event.dom.client.HasAllMouseHandlers, com.google.gwt.event.dom.client.HasBlurHandlers, com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.dom.client.HasFocusHandlers, com.google.gwt.event.dom.client.HasKeyDownHandlers, com.google.gwt.event.dom.client.HasKeyPressHandlers, com.google.gwt.event.dom.client.HasKeyUpHandlers, com.google.gwt.event.dom.client.HasMouseDownHandlers, com.google.gwt.event.dom.client.HasMouseMoveHandlers, com.google.gwt.event.dom.client.HasMouseOutHandlers, com.google.gwt.event.dom.client.HasMouseOverHandlers, com.google.gwt.event.dom.client.HasMouseUpHandlers, com.google.gwt.event.dom.client.HasMouseWheelHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.Focusable, com.google.gwt.user.client.ui.HasFocus, com.google.gwt.user.client.ui.SourcesClickEvents, com.google.gwt.user.client.ui.SourcesFocusEvents, com.google.gwt.user.client.ui.SourcesKeyboardEvents, com.google.gwt.user.client.ui.SourcesMouseEvents, com.google.gwt.user.client.ui.SourcesMouseWheelEvents
Direct Known Subclasses:
DrawingView

public class Canvas
extends com.google.gwt.user.client.ui.FocusWidget
implements com.google.gwt.user.client.ui.SourcesMouseEvents, com.google.gwt.user.client.ui.SourcesMouseWheelEvents


Nested Class Summary
static class Canvas.DrawingStyle
           
static class Canvas.Gradient
           
static class Canvas.LinearGradient
           
static class Canvas.Pattern
           
static class Canvas.RadialGradient
           
 
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
protected  int modifiers
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
Canvas(int width, int height)
           
 
Method Summary
 void addMouseListener(com.google.gwt.user.client.ui.MouseListener listener)
           
 void addMouseWheelListener(com.google.gwt.user.client.ui.MouseWheelListener listener)
           
 void arc(float x, float y, float radius, float startAngle, float endAngle, boolean anticlockwise)
           
 void arcTo(float x1, float y1, float x2, float y2, float radius)
           
 void beginPath()
           
 void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y)
           
 void clearRect(float x, float y, float w, float h)
           
 void clip()
           
 void closePath()
           
 Canvas.LinearGradient createLinearGradient(float x0, float y0, float x1, float y1)
           
 Canvas.Pattern createPattern(com.google.gwt.user.client.ui.Image img, String repetition)
           
 Canvas.RadialGradient createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1)
           
 void fill()
           
 void fillRect(float x, float y, float w, float h)
           
 Object getFillStyle()
           
 float getGlobalAlpha()
           
 String getGlobalCompositeOperation()
           
 int getHeight()
           
 String getLineCap()
           
 String getLineJoin()
           
 float getLineWidth()
           
 float getMiterLimit()
           
 int getModifiers()
           
 float getShadowBlur()
           
 String getShadowColor()
           
 float getShadowOffsetX()
           
 float getShadowOffsetY()
           
 Object getStrokeStyle()
           
 int getWidth()
           
protected  void init()
           
static boolean isEmulation()
           
 boolean isPointInPath(float x, float y)
           
 void lineTo(float x, float y)
           
 void moveTo(float x, float y)
           
 void onBrowserEvent(com.google.gwt.user.client.Event event)
           
 void quadraticCurveTo(float cpx, float cpy, float x, float y)
           
 void rect(float x, float y, float w, float h)
           
 void removeMouseListener(com.google.gwt.user.client.ui.MouseListener listener)
           
 void removeMouseWheelListener(com.google.gwt.user.client.ui.MouseWheelListener listener)
           
 void resize(int width, int height)
           
 void restoreContext()
           
 void rotate(float angle)
           
 void saveContext()
           
 void scale(float x, float y)
           
 void setFillStyle(Canvas.DrawingStyle style)
           
 void setFillStyle(String style)
           
 void setGlobalAlpha(float alpha)
           
 void setGlobalCompositeOperation(String operation)
           
 void setHeight(int height)
           
 void setLineCap(String lineCap)
           
 void setLineJoin(String lineJoin)
           
 void setLineWidth(float lineWidth)
           
 void setMiterLimit(float miterLimit)
           
 void setShadowBlur(float blur)
           
 void setShadowColor(String style)
           
 void setShadowOffsetX(float x)
           
 void setShadowOffsetY(float y)
           
 void setStrokeStyle(Canvas.DrawingStyle style)
           
 void setStrokeStyle(String style)
           
 void setTransform(float m11, float m12, float m21, float m22, float dx, float dy)
           
 void setWidth(int width)
           
 void stroke()
           
 void strokeRect(float x, float y, float w, float h)
           
 void transform(float m11, float m12, float m21, float m22, float dx, float dy)
           
 void translate(float x, float y)
           
 
Methods inherited from class com.google.gwt.user.client.ui.FocusWidget
addBlurHandler, addClickHandler, addClickListener, addFocusHandler, addFocusListener, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, getFocusImpl, getTabIndex, isEnabled, removeClickListener, removeFocusListener, removeKeyboardListener, setAccessKey, setElement, setEnabled, setFocus, setTabIndex
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
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, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
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
 

Field Detail

modifiers

protected int modifiers
Constructor Detail

Canvas

public Canvas(int width,
              int height)
Method Detail

getWidth

public int getWidth()

setWidth

public void setWidth(int width)

getHeight

public int getHeight()

setHeight

public void setHeight(int height)

resize

public void resize(int width,
                   int height)

isEmulation

public static boolean isEmulation()

init

protected void init()

addMouseListener

public void addMouseListener(com.google.gwt.user.client.ui.MouseListener listener)
Specified by:
addMouseListener in interface com.google.gwt.user.client.ui.SourcesMouseEvents
Overrides:
addMouseListener in class com.google.gwt.user.client.ui.FocusWidget

onBrowserEvent

public void onBrowserEvent(com.google.gwt.user.client.Event event)
Specified by:
onBrowserEvent in interface com.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent in class com.google.gwt.user.client.ui.Widget

removeMouseListener

public void removeMouseListener(com.google.gwt.user.client.ui.MouseListener listener)
Specified by:
removeMouseListener in interface com.google.gwt.user.client.ui.SourcesMouseEvents
Overrides:
removeMouseListener in class com.google.gwt.user.client.ui.FocusWidget

getModifiers

public int getModifiers()

addMouseWheelListener

public void addMouseWheelListener(com.google.gwt.user.client.ui.MouseWheelListener listener)
Specified by:
addMouseWheelListener in interface com.google.gwt.user.client.ui.SourcesMouseWheelEvents
Overrides:
addMouseWheelListener in class com.google.gwt.user.client.ui.FocusWidget

removeMouseWheelListener

public void removeMouseWheelListener(com.google.gwt.user.client.ui.MouseWheelListener listener)
Specified by:
removeMouseWheelListener in interface com.google.gwt.user.client.ui.SourcesMouseWheelEvents
Overrides:
removeMouseWheelListener in class com.google.gwt.user.client.ui.FocusWidget

saveContext

public void saveContext()

restoreContext

public void restoreContext()

scale

public void scale(float x,
                  float y)

rotate

public void rotate(float angle)

translate

public void translate(float x,
                      float y)

transform

public void transform(float m11,
                      float m12,
                      float m21,
                      float m22,
                      float dx,
                      float dy)

setTransform

public void setTransform(float m11,
                         float m12,
                         float m21,
                         float m22,
                         float dx,
                         float dy)

getGlobalAlpha

public float getGlobalAlpha()

setGlobalAlpha

public void setGlobalAlpha(float alpha)

getGlobalCompositeOperation

public String getGlobalCompositeOperation()

setGlobalCompositeOperation

public void setGlobalCompositeOperation(String operation)

getStrokeStyle

public Object getStrokeStyle()

getFillStyle

public Object getFillStyle()

setStrokeStyle

public void setStrokeStyle(String style)
Parameters:
style - Can be either a java.lang.String valued to a valid CSS color or a DrawingStyle

setStrokeStyle

public void setStrokeStyle(Canvas.DrawingStyle style)

setFillStyle

public void setFillStyle(String style)
Parameters:
style - Can be either a java.lang.String valued to a valid CSS color or a DrawingStyle

setFillStyle

public void setFillStyle(Canvas.DrawingStyle style)

createLinearGradient

public Canvas.LinearGradient createLinearGradient(float x0,
                                                  float y0,
                                                  float x1,
                                                  float y1)

createRadialGradient

public Canvas.RadialGradient createRadialGradient(float x0,
                                                  float y0,
                                                  float r0,
                                                  float x1,
                                                  float y1,
                                                  float r1)

createPattern

public Canvas.Pattern createPattern(com.google.gwt.user.client.ui.Image img,
                                    String repetition)

getLineWidth

public float getLineWidth()

setLineWidth

public void setLineWidth(float lineWidth)

getLineCap

public String getLineCap()

setLineCap

public void setLineCap(String lineCap)

getLineJoin

public String getLineJoin()

setLineJoin

public void setLineJoin(String lineJoin)

getMiterLimit

public float getMiterLimit()

setMiterLimit

public void setMiterLimit(float miterLimit)

getShadowOffsetX

public float getShadowOffsetX()

setShadowOffsetX

public void setShadowOffsetX(float x)

getShadowOffsetY

public float getShadowOffsetY()

setShadowOffsetY

public void setShadowOffsetY(float y)

getShadowBlur

public float getShadowBlur()

setShadowBlur

public void setShadowBlur(float blur)

getShadowColor

public String getShadowColor()

setShadowColor

public void setShadowColor(String style)

clearRect

public void clearRect(float x,
                      float y,
                      float w,
                      float h)

fillRect

public void fillRect(float x,
                     float y,
                     float w,
                     float h)

strokeRect

public void strokeRect(float x,
                       float y,
                       float w,
                       float h)

beginPath

public void beginPath()

closePath

public void closePath()

moveTo

public void moveTo(float x,
                   float y)

lineTo

public void lineTo(float x,
                   float y)

quadraticCurveTo

public void quadraticCurveTo(float cpx,
                             float cpy,
                             float x,
                             float y)

bezierCurveTo

public void bezierCurveTo(float cp1x,
                          float cp1y,
                          float cp2x,
                          float cp2y,
                          float x,
                          float y)

arcTo

public void arcTo(float x1,
                  float y1,
                  float x2,
                  float y2,
                  float radius)

rect

public void rect(float x,
                 float y,
                 float w,
                 float h)

arc

public void arc(float x,
                float y,
                float radius,
                float startAngle,
                float endAngle,
                boolean anticlockwise)

fill

public void fill()

stroke

public void stroke()

clip

public void clip()

isPointInPath

public boolean isPointInPath(float x,
                             float y)


Copyright © 2010. All Rights Reserved.