|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.standard.AbstractTool
org.jhotdraw.contrib.dnd.DragNDropTool
public class DragNDropTool
This is a tool which handles drag and drop between Components in JHotDraw and drags from JHotDraw. It also indirectly handles management of Drops from extra-JVM sources. Drag and Drop is about information moving, not images or objects. Its about moving a JHD rectangle to another application and that application understanding both its shape, color, attributes, and everything about it. not how it looks. There can be only 1 such tool in an application. A view can be registered with only a single DropSource as far as I know (maybe not).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jhotdraw.standard.AbstractTool |
---|
AbstractTool.EventDispatcher |
Constructor Summary | |
---|---|
DragNDropTool(DrawingEditor editor)
|
Method Summary | |
---|---|
void |
activate()
Turn on drag by adding a DragGestureRegognizer to all Views which are based on Components. |
void |
deactivate()
Deactivates the tool. |
void |
mouseDown(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse down events and starts the corresponding tracker. |
void |
mouseDrag(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse drag events. |
void |
mouseMove(java.awt.event.MouseEvent evt,
int x,
int y)
Handles mouse moves (if the mouse button is up). |
void |
mouseUp(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse up events. |
static void |
setCursor(int x,
int y,
DrawingView view)
Sets the type of cursor based on what is under the coordinates in the active view. |
Methods inherited from class org.jhotdraw.standard.AbstractTool |
---|
addToolListener, drawing, editor, getActiveDrawing, getActiveView, getUndoActivity, isActive, isEnabled, isUsable, keyDown, removeToolListener, setEnabled, setUndoActivity, setUsable, view |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DragNDropTool(DrawingEditor editor)
Method Detail |
---|
public void activate()
activate
in interface Tool
activate
in class AbstractTool
public void deactivate()
AbstractTool
deactivate
in interface Tool
deactivate
in class AbstractTool
public static void setCursor(int x, int y, DrawingView view)
public void mouseMove(java.awt.event.MouseEvent evt, int x, int y)
mouseMove
in interface Tool
mouseMove
in class AbstractTool
public void mouseUp(java.awt.event.MouseEvent e, int x, int y)
mouseUp
in interface Tool
mouseUp
in class AbstractTool
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)
mouseDown
in interface Tool
mouseDown
in class AbstractTool
public void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
mouseDrag
in interface Tool
mouseDrag
in class AbstractTool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |