public class MouseDragBox extends MouseInputAdapter
| Constructor and Description |
|---|
MouseDragBox(JComponent component)
Creates a new instance to work with the given component.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelMovedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmouseClicked, mouseEntered, mouseExitedmouseMovedpublic MouseDragBox(JComponent component)
component - the component on which the box will be drawnpublic void setEnabled(boolean state)
state - true to enable; false to disablepublic void mousePressed(MouseEvent ev)
mousePressed in interface MouseListenermousePressed in class MouseAdapterev - input mouse eventpublic void mouseDragged(MouseEvent ev)
mouseDragged in interface MouseMotionListenermouseDragged in class MouseAdapterev - input mouse eventpublic void mouseReleased(MouseEvent ev)
mouseReleased in interface MouseListenermouseReleased in class MouseAdapterev - the input mouse eventCopyright © 1996–2019 Geotools. All rights reserved.