|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y25.view.ViewMode25D
Handles mouse events coming from a Graph25DView
.
A view mode has to be bound to a Graph25DView
by calling
setActiveView
before it receives any mouse input
events. When a view mode is added to a Graph25DView
via a call
to
Graph25DView#addViewMode25D
,
this happens automatically.
As a convenience, this class stores the mouse position of an event relative
to the mouse position of the last event inside deltaDrag
,
which can be read inside the event handling methods.
When deriving from this class, make sure that all overriden methods you implement first call the respective super method first.
Field Summary | |
protected Point |
deltaDrag
The mouse position relative to the last drag event. |
protected MouseEvent |
lastClickEvent
The last mouse click event. |
protected MouseEvent |
lastDragEvent
The last mouse drag event. |
protected MouseEvent |
lastPressEvent
The last mouse press event. |
protected MouseEvent |
lastReleaseEvent
The last mouse release event. |
protected Graph25DView |
view
The view this mode gets mouse events from. |
Constructor Summary | |
ViewMode25D()
|
Method Summary | |
protected Point |
delta(MouseEvent from,
MouseEvent to)
Returns the difference vector from from to to . |
void |
mouseClicked(MouseEvent e)
|
void |
mouseDragged(MouseEvent e)
|
void |
mouseDraggedLeft(MouseEvent e)
|
void |
mouseDraggedMiddle(MouseEvent e)
|
void |
mouseDraggedRight(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
mouseShiftDraggedLeft(MouseEvent e)
|
void |
mouseShiftDraggedMiddle(MouseEvent e)
|
void |
mouseShiftDraggedRight(MouseEvent e)
|
void |
mouseWheelMoved(MouseWheelEvent e)
|
void |
setActiveView(Graph25DView v)
Sets the view this mode receives mouse events from. |
protected boolean |
shiftPressed(MouseEvent e)
Determines if the SHIFT modifier key has been pressed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Graph25DView view
protected MouseEvent lastClickEvent
protected MouseEvent lastPressEvent
protected MouseEvent lastReleaseEvent
protected MouseEvent lastDragEvent
protected Point deltaDrag
Constructor Detail |
public ViewMode25D()
Method Detail |
protected Point delta(MouseEvent from, MouseEvent to)
from
to to
.
public void setActiveView(Graph25DView v)
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
public void mouseDraggedLeft(MouseEvent e)
public void mouseDraggedMiddle(MouseEvent e)
public void mouseDraggedRight(MouseEvent e)
public void mouseShiftDraggedLeft(MouseEvent e)
public void mouseShiftDraggedMiddle(MouseEvent e)
public void mouseShiftDraggedRight(MouseEvent e)
protected boolean shiftPressed(MouseEvent e)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |