com.google.gwt.maps.client
Class DraggableObject

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.maps.client.DraggableObject

public class DraggableObject
extends com.google.gwt.core.client.JavaScriptObject

This class makes a DOM element draggable. The static members for changing the drag cursors affect all subsequently created draggable objects, such as the map, zoom control slider, and overview map rectangles. The per-instance members affect only their particular instance. For example, before creating the map, you can call DraggableObject.setDraggableCursorDefault('default') and DraggableObject.setDraggingCursorDefault('move') to get the pre-API 2.56 style. Alternatively, the Map constructor can take options to set its DraggableObject's cursor style. See the W3C CSS specification for allowable cursor values.


Constructor Summary
protected DraggableObject()
           
 
Method Summary
static java.lang.String getDraggableCursorDefault()
          Returns the current dragging cursor in use by the map.
static java.lang.String getDraggingCursorDefault()
          Returns the current draggable cursor in use by the map.
 void moveBy(Point point)
          Moves the DraggableObject by a given size offset.
 void moveTo(Point point)
          Moves the GDraggableObject to a given absolute position.
static DraggableObject newInstance(com.google.gwt.dom.client.Element element)
          Sets up event handlers so that the source element can be dragged.
static DraggableObject newInstance(com.google.gwt.dom.client.Element element, DraggableObjectOptions options)
          Sets up event handlers so that the source element can be dragged.
 void setDraggableCursor(java.lang.String cursor)
          Sets the cursor when the mouse is over this draggable object.
static void setDraggableCursorDefault(java.lang.String cursor)
          Sets the draggable cursor for subsequently created draggable objects.
 void setDraggingCursor(java.lang.String cursor)
          Sets the cursor when the mouse is held down, dragging this draggable object.
static void setDraggingCursorDefault(java.lang.String cursor)
          Sets the dragging cursor for subsequently created draggable objects.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DraggableObject

protected DraggableObject()
Method Detail

getDraggableCursorDefault

public static java.lang.String getDraggableCursorDefault()
Returns the current dragging cursor in use by the map. If not set through the static setDraggingCursor() method, this returns the default cursor used by the map for its controls and markers.

Returns:
the current dragging cursor.

getDraggingCursorDefault

public static java.lang.String getDraggingCursorDefault()
Returns the current draggable cursor in use by the map. If not set through the static setDraggableCursor() method, this returns the default cursor used by the map for its controls and markers.

Returns:
the current draggable cursor.

newInstance

public static final DraggableObject newInstance(com.google.gwt.dom.client.Element element)
Sets up event handlers so that the source element can be dragged. Left and top optionally position the element, and the optional container serves as a bounding box.

Parameters:
element - the element to turn into a draggable object.

newInstance

public static final DraggableObject newInstance(com.google.gwt.dom.client.Element element,
                                                DraggableObjectOptions options)
Sets up event handlers so that the source element can be dragged. Left and top optionally position the element, and the optional container serves as a bounding box.

Parameters:
element - the element to turn into a draggable object.
options - optional parameters.

setDraggableCursorDefault

public static void setDraggableCursorDefault(java.lang.String cursor)
Sets the draggable cursor for subsequently created draggable objects.

Parameters:
cursor - the draggable cursor for subsequently created draggable objects.

setDraggingCursorDefault

public static void setDraggingCursorDefault(java.lang.String cursor)
Sets the dragging cursor for subsequently created draggable objects.

Parameters:
cursor - the dragging cursor for subsequently created draggable objects.

moveBy

public final void moveBy(Point point)
Moves the DraggableObject by a given size offset. This method uses the DOM coordinate system, i.e. width increases to the left, and height increases downwards.

Parameters:
point - offset to move object.

moveTo

public final void moveTo(Point point)
Moves the GDraggableObject to a given absolute position. The position is in pixel coordinates relative to the parent node. This method uses the DOM coordinate system, i.e. the X coordinate increases to the left, and the Y coordinate increases downwards.

Parameters:
point - absolute position to move to.

setDraggableCursor

public final void setDraggableCursor(java.lang.String cursor)
Sets the cursor when the mouse is over this draggable object.

Parameters:
cursor - CSS specification of cursor type.

setDraggingCursor

public final void setDraggingCursor(java.lang.String cursor)
Sets the cursor when the mouse is held down, dragging this draggable object.

Parameters:
cursor - CSS specification of cursor type.