NASA World Wind

gov.nasa.worldwind.util.tree
Class DragControl

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.util.AbstractHotSpot
          extended by gov.nasa.worldwind.util.tree.TreeHotSpot
              extended by gov.nasa.worldwind.util.tree.DragControl
All Implemented Interfaces:
AVList, SelectListener, HotSpot, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, EventListener
Direct Known Subclasses:
ScrollBar.ScrollKnob, ScrollFrame

public abstract class DragControl
extends TreeHotSpot

A TreeHotSpot that can handle drag events.


Field Summary
protected  boolean dragging
           
protected  Point dragRefPoint
           
 
Fields inherited from class gov.nasa.worldwind.util.tree.TreeHotSpot
parent
 
Fields inherited from class gov.nasa.worldwind.util.AbstractHotSpot
active
 
Constructor Summary
DragControl(HotSpot parent)
          Create a drag control.
 
Method Summary
protected  void beginDrag(Point point)
          Called when a drag begins.
protected abstract  void drag(Point point)
          Called for each point within a drag action.
protected  void endDrag()
          Called when a drag action ends.
 boolean isDragging()
          Is the control currently dragging?
 void selected(SelectEvent event)
          Handle a SelectEvent and call beginDrag(java.awt.Point), drag(java.awt.Point), endDrag() as appropriate.
 
Methods inherited from class gov.nasa.worldwind.util.tree.TreeHotSpot
mouseClicked, mousePressed, mouseReleased, mouseWheelMoved
 
Methods inherited from class gov.nasa.worldwind.util.AbstractHotSpot
getCursor, isActive, isConsumed, keyPressed, keyReleased, keyTyped, mouseDragged, mouseEntered, mouseExited, mouseMoved, setActive
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dragging

protected boolean dragging

dragRefPoint

protected Point dragRefPoint
Constructor Detail

DragControl

public DragControl(HotSpot parent)
Create a drag control.

Parameters:
parent - The screen area that contains this drag control. Input events that cannot be handled by this object will be passed to the parent. May be null.
Method Detail

beginDrag

protected void beginDrag(Point point)
Called when a drag begins. This implementation saves the first drag point to dragRefPoint.

Parameters:
point - Point at which dragging started.

drag

protected abstract void drag(Point point)
Called for each point within a drag action.

Parameters:
point - Current drag point.

endDrag

protected void endDrag()
Called when a drag action ends. This implementation sets dragRefPoint to null.


isDragging

public boolean isDragging()
Is the control currently dragging?

Returns:
True if the control is dragging.

selected

public void selected(SelectEvent event)
Handle a SelectEvent and call beginDrag(java.awt.Point), drag(java.awt.Point), endDrag() as appropriate. Subclasses may override this method if they need to handle events other than drag events.

Specified by:
selected in interface SelectListener
Specified by:
selected in interface HotSpot
Overrides:
selected in class TreeHotSpot
Parameters:
event - Select event.

NASA World Wind