|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectMouseAdapter
MouseInputAdapter
MouseDragBox
public class MouseDragBox
Draws a box on the parent component (e.g. JMapPane) as the mouse is dragged.
Constructor Summary | |
---|---|
MouseDragBox(JComponent component)
Creates a new instance to work with the given component. |
Method Summary | |
---|---|
void |
mouseDragged(MouseEvent ev)
If the box is enabled, draws the box with the diagonal running from the start position to the current mouse position. |
void |
mousePressed(MouseEvent ev)
If the box is enabled, records the start position for subsequent drawing as the mouse is dragged. |
void |
mouseReleased(MouseEvent ev)
If the box is enabled, removes the final box. |
void |
setEnabled(boolean state)
Enables or disables the drag box. |
Methods inherited from class MouseAdapter |
---|
mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface MouseListener |
---|
mouseClicked, mouseEntered, mouseExited |
Methods inherited from interface MouseMotionListener |
---|
mouseMoved |
Constructor Detail |
---|
public MouseDragBox(JComponent component)
component
- the component on which the box will be drawnMethod Detail |
---|
public void setEnabled(boolean state)
state
- true
to enable; false
to disablepublic void mousePressed(MouseEvent ev)
mousePressed
in interface MouseListener
mousePressed
in class MouseAdapter
ev
- input mouse eventpublic void mouseDragged(MouseEvent ev)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class MouseAdapter
ev
- input mouse eventpublic void mouseReleased(MouseEvent ev)
mouseReleased
in interface MouseListener
mouseReleased
in class MouseAdapter
ev
- the input mouse event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |