public class RotatingGraphMousePlugin extends AbstractGraphMousePlugin implements MouseListener, MouseMotionListener
cursor, down, modifiers| Constructor and Description |
|---|
RotatingGraphMousePlugin()
create an instance with default modifier values
|
RotatingGraphMousePlugin(int modifiers)
create an instance with passed zoom in/out values
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
angleBetween(Point2D v1,
Point2D v2)
Returns the angle between two vectors from the origin
to points v1 and v2.
|
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e)
check the modifiers.
|
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e)
save the 'down' point and check the modifiers.
|
void |
mouseReleased(MouseEvent e)
unset the down point and change the cursor back to the default
|
checkModifiers, getCursor, getModifiers, setCursor, setModifierspublic RotatingGraphMousePlugin()
public RotatingGraphMousePlugin(int modifiers)
modifiers - the event modifiers to trigger rotationpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenere - the eventpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerprotected double angleBetween(Point2D v1, Point2D v2)
v1 - v2 - public void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerCopyright © 2015. All rights reserved.