|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.zaval.awt.gdp.Controller | +--org.zaval.awt.gdp.DragController
This controller is used to convert mouse events of the target component to
the mouse org.zaval.awt.gdp.event.MouseDragEvent events. To listen the events use
addMouseDragListener
and removeMouseDragListener
methods.
The main purpose of the class is to provide more handy method to handle mouse
drag events for the specified component.
Constructor Summary | |
DragController(java.awt.Component target)
Constructs a new drag controller with the specified target component. |
Method Summary | |
void |
addMouseDragListener(MouseDragListener l)
Adds the specified drag listener. |
boolean |
isDragged()
Tests if the mouse is dragged at the moment. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons no down). |
void |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component. |
protected void |
perform(MouseDragEvent e)
Performs the specified mouse drag event. |
void |
removeMouseDragListener(MouseDragListener l)
Removes the specified drag listener. |
protected void |
targetWasChanged(java.awt.Component n,
java.awt.Component o)
The method is called whenever the target component has been changed. |
Methods inherited from class org.zaval.awt.gdp.Controller |
getTarget, setTarget |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DragController(java.awt.Component target)
target
- the specified target component.
Method Detail |
public void addMouseDragListener(MouseDragListener l)
l
- the specified drag listener.
public void removeMouseDragListener(MouseDragListener l)
l
- the specified drag listener.
public boolean isDragged()
true
if the mouse is dragged; false
otherwise.
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
protected void targetWasChanged(java.awt.Component n, java.awt.Component o)
targetWasChanged
in class Controller
n
- the specified new target component.o
- the specified old target component.
protected void perform(MouseDragEvent e)
e
- the specified mouse drag event.
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |