org.vectomatic.svg.edit.client.widget
Class Compass
java.lang.Object
org.vectomatic.svg.edit.client.widget.Compass
- All Implemented Interfaces:
- com.google.gwt.event.shared.HasHandlers, HasRotationHandlers
- Direct Known Subclasses:
- CompassWebkit
public class Compass
- extends java.lang.Object
- implements HasRotationHandlers
An compass widget implemented using an SVG image.
- Author:
- laaglu
|
Field Summary |
protected int |
angle
|
protected org.vectomatic.dom.svg.OMSVGSVGElement |
compass
|
protected com.google.gwt.event.shared.HandlerManager |
handlerManager
|
protected boolean |
rotate
|
protected org.vectomatic.dom.svg.OMSVGTransform |
rotation
|
protected org.vectomatic.dom.svg.OMSVGGElement |
textGroup
|
|
Constructor Summary |
Compass()
Constructor. |
|
Method Summary |
com.google.gwt.event.shared.HandlerRegistration |
addRotationHandler(RotationHandler handler)
|
void |
fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
|
org.vectomatic.dom.svg.OMSVGPoint |
getLocalCoordinates(com.google.gwt.event.dom.client.MouseEvent<? extends com.google.gwt.event.shared.EventHandler> e)
Returns the coordinates of a mouse event, converted
to the compass coordinate system |
org.vectomatic.dom.svg.OMSVGSVGElement |
getSvgElement()
|
void |
setRotation(int angle)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rotation
protected org.vectomatic.dom.svg.OMSVGTransform rotation
rotate
protected boolean rotate
angle
protected int angle
compass
protected org.vectomatic.dom.svg.OMSVGSVGElement compass
handlerManager
protected com.google.gwt.event.shared.HandlerManager handlerManager
textGroup
protected org.vectomatic.dom.svg.OMSVGGElement textGroup
Compass
public Compass()
- Constructor.
setRotation
public void setRotation(int angle)
getSvgElement
public org.vectomatic.dom.svg.OMSVGSVGElement getSvgElement()
getLocalCoordinates
public org.vectomatic.dom.svg.OMSVGPoint getLocalCoordinates(com.google.gwt.event.dom.client.MouseEvent<? extends com.google.gwt.event.shared.EventHandler> e)
- Returns the coordinates of a mouse event, converted
to the compass coordinate system
- Parameters:
e - A mouse event
- Returns:
- The coordinates of the mouse event, converted
to the compass coordinate system
fireEvent
public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
- Specified by:
fireEvent in interface com.google.gwt.event.shared.HasHandlers
addRotationHandler
public com.google.gwt.event.shared.HandlerRegistration addRotationHandler(RotationHandler handler)
- Specified by:
addRotationHandler in interface HasRotationHandlers
Copyright © 2010. All Rights Reserved.