Class TouchEditEvent
java.lang.Object
com.levigo.jadice.web.client.tool.events.EventObject
com.levigo.jadice.web.client.tool.events.EditEvent
com.levigo.jadice.web.client.tool.events.PointedEditEvent
com.levigo.jadice.web.client.tool.events.TouchEditEvent
-
Field Summary
Fields inherited from class com.levigo.jadice.web.client.tool.events.EditEvent
document, inputEvent, pageBoundsFields inherited from class com.levigo.jadice.web.client.tool.events.EventObject
source -
Method Summary
Modifier and TypeMethodDescriptiongetAbsolutePoint(int finger) com.google.gwt.core.client.JsArray<com.google.gwt.dom.client.Touch> Get an array of touches which have changed since the last touch event fired.getConstrainedDocumentPoint(int finger) Return the finger position in document coordinates.protected PointgetConstrainedPoint(int finger) Return the point relative to the RenderedPage's origin in screen coordinates.Return the point in document coordinates.getDocumentPoint(int finger) Return the finger position in document coordinates.com.google.gwt.event.dom.client.TouchEvent<?> Overridden in subclasses.Returns the first touch position contained in this Touch eventgetPoint(int finger) Return the point relative to the RenderedPage's origin in screen coordinates.com.google.gwt.core.client.JsArray<com.google.gwt.dom.client.Touch> Get an array of all current touches.intgetX(int finger) Returns the x Position of the given finger.intgetY(int finger) Returns the y Position of the given finger.booleanRuntime check for whether touch scrolling is supported in this browser.booleanbooleanisWithinPageBounds(int finger) Returns whether the finger is within the bounds.voidsetOldPosition(Point oldPos) Methods inherited from class com.levigo.jadice.web.client.tool.events.PointedEditEvent
getConstrainedDocumentPoint, getPointerRelativeX, getPointerRelativeYMethods inherited from class com.levigo.jadice.web.client.tool.events.EditEvent
consume, create, getDocument, getInputEventType, getModifiers, getModifiersEx, getPage, getPageIndex, getPageRenderControls, getRenderedPageBounds, getRenderedSize, getWhen, hasCanvasTargetSource, hasPageContext, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isPreventPageViewFocus, isShiftDown, preventPageViewFocus, toStringMethods inherited from class com.levigo.jadice.web.client.tool.events.EventObject
getSource
-
Method Details
-
getGwtEvent
public com.google.gwt.event.dom.client.TouchEvent<?> getGwtEvent()- Overrides:
getGwtEventin classEditEvent
-
isSupported
public boolean isSupported()Runtime check for whether touch scrolling is supported in this browser. Returns true if touch events are supported but touch based scrolling is not natively supported.- Returns:
- true if touch events are supported, false if not
-
getChangedTouches
public com.google.gwt.core.client.JsArray<com.google.gwt.dom.client.Touch> getChangedTouches()Get an array of touches which have changed since the last touch event fired. Note, that for touch end events, the touch which has just ended will not be present in the array. Moreover, if the touch which just ended was the last remaining touch, then a zero length array will be returned.- Returns:
- an array of touches
-
getTouches
public com.google.gwt.core.client.JsArray<com.google.gwt.dom.client.Touch> getTouches()Get an array of all current touches. Note, that for touch end events, the touch which has just ended will not be present in the array. Moreover, if the touch which just ended was the last remaining touch, then a zero length array will be returned.- Returns:
- an array of touches
-
getInputEvent
Description copied from class:EditEventOverridden in subclasses.Implement only for legacy purposes.
- Specified by:
getInputEventin classEditEvent- Returns:
- The inputEvent used for legacy purposes.
-
setOldPosition
- Overrides:
setOldPositionin classPointedEditEvent
-
getOldPosition
- Returns:
- the last Position of the first finger (zero index in the Touch array)
-
getNewPosition
Returns the first touch position contained in this Touch event- Returns:
- the first touch point
-
getAbsolutePoint
- Specified by:
getAbsolutePointin classPointedEditEvent- Parameters:
finger- the finger of the touch (only for touch event)- Returns:
- the Point relative to the PageView-TopLeft
-
getPoint
Description copied from class:PointedEditEventReturn the point relative to the RenderedPage's origin in screen coordinates.- Specified by:
getPointin classPointedEditEvent- Parameters:
finger- the finger of the touch (only for touch event)- Returns:
- The point relative to the RenderedPage's origin.
- See Also:
-
getConstrainedPoint
Return the point relative to the RenderedPage's origin in screen coordinates. If the point is outside the rendered page's bounds, the point is constrained to lie within the bounds.Caveat: Clients must not attempt to call this method unless
EditEvent.hasPageContext()returnedtrue.- Overrides:
getConstrainedPointin classPointedEditEvent- Returns:
- The point.
- Throws:
IllegalStateException- if the event does not have a page context.- See Also:
-
getDocumentPoint
Return the point in document coordinates.Caveat: Clients must not attempt to call this method unless
EditEvent.hasPageContext()returnedtrue.- Overrides:
getDocumentPointin classPointedEditEvent- Returns:
- The point.
- Throws:
IllegalStateException- if the event does not have a page context.- See Also:
-
getDocumentPoint
Return the finger position in document coordinates.Caveat: Clients must not attempt to call this method unless
EditEvent.hasPageContext()returnedtrue.- Overrides:
getDocumentPointin classPointedEditEvent- Parameters:
finger- the finger starting from index 0.- Returns:
- The point.
- Throws:
IllegalStateException- if the event does not have a page context.- See Also:
-
getConstrainedDocumentPoint
Return the finger position in document coordinates. If the positin is outside the page's bounds, the position is constrained to lie within the bounds.Caveat: Clients must not attempt to call this method unless
EditEvent.hasPageContext()returnedtrue.- Overrides:
getConstrainedDocumentPointin classPointedEditEvent- Parameters:
finger- the finger starting from index 0.- Returns:
- The position.
- Throws:
IllegalStateException- if the event does not have a page context.- See Also:
-
getX
public int getX(int finger) Returns the x Position of the given finger.- Overrides:
getXin classPointedEditEvent- Parameters:
finger- the finger starting from index 0.- Returns:
- The x coordinate of the finger.
-
getY
public int getY(int finger) Returns the y Position of the given finger.- Overrides:
getYin classPointedEditEvent- Parameters:
finger- the finger starting from index 0.- Returns:
- The y coordinate of the finger.
-
isWithinPageBounds
public boolean isWithinPageBounds()- Returns:
- True, if the event was fired within the bounds, false else.
-
isWithinPageBounds
public boolean isWithinPageBounds(int finger) Returns whether the finger is within the bounds.- Overrides:
isWithinPageBoundsin classPointedEditEvent- Parameters:
finger- the finger starting from index 0.- Returns:
- True, if the finger is within the bounds, false else.
-