public abstract class DragControl extends TreeHotSpot
TreeHotSpot
that can handle drag events.Modifier and Type | Field and Description |
---|---|
protected boolean |
dragging |
protected Point |
dragRefPoint |
parent
active
Constructor and Description |
---|
DragControl(HotSpot parent)
Create a drag control.
|
Modifier and Type | Method and Description |
---|---|
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. |
mouseClicked, mousePressed, mouseReleased, mouseWheelMoved
getCursor, isActive, isConsumed, keyPressed, keyReleased, keyTyped, mouseDragged, mouseEntered, mouseExited, mouseMoved, setActive
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
protected boolean dragging
protected Point dragRefPoint
public DragControl(HotSpot parent)
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.protected void beginDrag(Point point)
dragRefPoint
.point
- Point at which dragging started.protected abstract void drag(Point point)
point
- Current drag point.protected void endDrag()
dragRefPoint
to null.public boolean isDragging()
public void selected(SelectEvent event)
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.selected
in interface SelectListener
selected
in interface HotSpot
selected
in class TreeHotSpot
event
- Select event.