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, setModifiers
public RotatingGraphMousePlugin()
public RotatingGraphMousePlugin(int modifiers)
modifiers
- the event modifiers to trigger rotationpublic void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
e
- the eventpublic void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
protected double angleBetween(Point2D v1, Point2D v2)
v1
- the first pointv2
- the second pointpublic void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
Copyright © 2015. All rights reserved.