org.vectomatic.client.rep.view
Class DrawingView

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
                  extended by org.vectomatic.client.rep.view.DrawingView
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

public class DrawingView
extends Canvas

Class to render the geometry. This is where most of the action occurs. Events are caught and routed the to controllers. Rendering is done.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.gwt.components.client.Canvas
Canvas.DrawingStyle, Canvas.Gradient, Canvas.LinearGradient, Canvas.Pattern, 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
 
Fields inherited from class com.gwt.components.client.Canvas
modifiers
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
DrawingView(RepresentationController repController, DrawingModel model, int width, int height)
           
 
Method Summary
 float convertToReferenceLength(int screenLength)
          Converts a distance in the screen coordinate system into a distance in the reference coordinate system
 IController getController()
           
 IStyleVisitor getFillStyleVisitor()
           
 TransformMatrix getInverseTransform()
           
 PickVisitor getPicker()
           
 RenderVisitor getRenderer()
           
 float getRotation()
           
 Point getScaling(Point s)
           
 IStyleVisitor getStrokeStyleVisitor()
           
 TransformMatrix getTransform()
           
 Point getTranslation(Point t)
           
protected  void onLoad()
           
 void render()
           
 void reset()
           
 void setController(IController controller)
           
 void setCursor(Cursor cursor)
           
 void setRotation(float r)
           
 void setScaling(Point s)
           
 void setTranslation(Point t)
           
 Point toModelCoordinates(Point p)
          Converts a point from screen coordinates to model coordinates
 Point toModelCoordinates(Point p, Point dest)
           
 Point toScreenCoordinates(Point p)
           
 Point toScreenCoordinates(Point p, Point dest)
          Converts a point from model coordinates to screen coordinates
protected  void updateTransform()
           
 Point vectorToRefCoordinates(Point v)
           
 Point vectorToRefCoordinates(Point v, Point dest)
           
 
Methods inherited from class com.gwt.components.client.Canvas
addMouseListener, addMouseWheelListener, arc, arcTo, beginPath, bezierCurveTo, clearRect, clip, closePath, createLinearGradient, createPattern, createRadialGradient, fill, fillRect, getFillStyle, getGlobalAlpha, getGlobalCompositeOperation, getHeight, getLineCap, getLineJoin, getLineWidth, getMiterLimit, getModifiers, getShadowBlur, getShadowColor, getShadowOffsetX, getShadowOffsetY, getStrokeStyle, getWidth, init, isEmulation, isPointInPath, lineTo, moveTo, onBrowserEvent, quadraticCurveTo, rect, removeMouseListener, removeMouseWheelListener, resize, restoreContext, rotate, saveContext, scale, setFillStyle, setFillStyle, setGlobalAlpha, setGlobalCompositeOperation, setHeight, setLineCap, setLineJoin, setLineWidth, setMiterLimit, setShadowBlur, setShadowColor, setShadowOffsetX, setShadowOffsetY, setStrokeStyle, setStrokeStyle, setTransform, setWidth, stroke, strokeRect, transform, translate
 
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, 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
 

Constructor Detail

DrawingView

public DrawingView(RepresentationController repController,
                   DrawingModel model,
                   int width,
                   int height)
Method Detail

getRotation

public float getRotation()

setRotation

public void setRotation(float r)

getScaling

public Point getScaling(Point s)

setScaling

public void setScaling(Point s)

getTranslation

public Point getTranslation(Point t)

setTranslation

public void setTranslation(Point t)

getTransform

public TransformMatrix getTransform()

getInverseTransform

public TransformMatrix getInverseTransform()

updateTransform

protected void updateTransform()

reset

public void reset()

render

public void render()

convertToReferenceLength

public float convertToReferenceLength(int screenLength)
Converts a distance in the screen coordinate system into a distance in the reference coordinate system

Parameters:
pixels -
Returns:

vectorToRefCoordinates

public Point vectorToRefCoordinates(Point v)

vectorToRefCoordinates

public Point vectorToRefCoordinates(Point v,
                                    Point dest)

toModelCoordinates

public Point toModelCoordinates(Point p)
Converts a point from screen coordinates to model coordinates

Parameters:
p - The point to transfom (in screen coordinates)
Returns:
The transformed point

toModelCoordinates

public Point toModelCoordinates(Point p,
                                Point dest)

toScreenCoordinates

public Point toScreenCoordinates(Point p)

toScreenCoordinates

public Point toScreenCoordinates(Point p,
                                 Point dest)
Converts a point from model coordinates to screen coordinates

Parameters:
p - The point to transfom (in model coordinates)
Returns:
The transformed point

setCursor

public void setCursor(Cursor cursor)

setController

public void setController(IController controller)

getController

public IController getController()

getRenderer

public RenderVisitor getRenderer()

getPicker

public PickVisitor getPicker()

getStrokeStyleVisitor

public IStyleVisitor getStrokeStyleVisitor()

getFillStyleVisitor

public IStyleVisitor getFillStyleVisitor()

onLoad

protected void onLoad()
Overrides:
onLoad in class com.google.gwt.user.client.ui.Widget


Copyright © 2010. All Rights Reserved.