|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.event.MouseAdapter com.alee.extended.window.ComponentMoveAdapter
public class ComponentMoveAdapter
This listener allows you to simplify window/component move action. Simply install this listener onto any component to make it move the window when dragged. You can specify moved window/component or simply let the listener detect it.
Field Summary | |
---|---|
protected java.awt.Component |
dragged
Currently dragged component. |
protected boolean |
dragging
Whether component is being dragged or not. |
protected java.awt.Rectangle |
initialBounds
Dragged component initial bounds. |
protected java.awt.Point |
initialPoint
Drag start point. |
protected java.awt.Component |
toDrag
Component that should be dragged. |
Constructor Summary | |
---|---|
ComponentMoveAdapter()
Constructs new component move adapter that alows source component parent window dragging. |
|
ComponentMoveAdapter(java.awt.Component toDrag)
Constructs new component move adapter that allows specified component dragging. |
Method Summary | |
---|---|
protected java.awt.Component |
getDraggedComponent(java.awt.event.MouseEvent e)
Returns actual dragged component. |
protected java.awt.Rectangle |
getDragStartBounds(java.awt.event.MouseEvent e)
Returns bounds within which component will act as a gripper. |
static void |
install(java.awt.Component component)
Installs window move adapter to the specified window component. |
static void |
install(java.awt.Component component,
java.awt.Component toDrag)
Installs component move adapter to the specified component. |
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
Methods inherited from class java.awt.event.MouseAdapter |
---|
mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.awt.Component toDrag
protected boolean dragging
protected java.awt.Component dragged
protected java.awt.Point initialPoint
protected java.awt.Rectangle initialBounds
Constructor Detail |
---|
public ComponentMoveAdapter()
public ComponentMoveAdapter(java.awt.Component toDrag)
toDrag
- component to dragMethod Detail |
---|
public static void install(java.awt.Component component)
component
- window component that will act as gripperpublic static void install(java.awt.Component component, java.awt.Component toDrag)
component
- component that will act as grippertoDrag
- component to be moved by the gripper componentpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class java.awt.event.MouseAdapter
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class java.awt.event.MouseAdapter
protected java.awt.Component getDraggedComponent(java.awt.event.MouseEvent e)
e
- occured mouse event
protected java.awt.Rectangle getDragStartBounds(java.awt.event.MouseEvent e)
e
- occured mouse event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |