gov.nasa.worldwind.util.tree
Class DragControl
java.lang.Object
gov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.util.AbstractHotSpot
gov.nasa.worldwind.util.tree.TreeHotSpot
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.
| 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 |
dragging
protected boolean dragging
dragRefPoint
protected Point dragRefPoint
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.
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.