Class SelectListener
java.lang.Object
|
+----java.awt.event.MouseAdapter
|
+----VisiMouseListener
|
+----SelectListener
- public class SelectListener
- extends VisiMouseListener
- implements MouseListener, MouseMotionListener
Class definition for a mouse listener to handle selection events.
- Version:
- $Revision: 1.12 $, $Date: 2000/10/30 17:02:54 $
- Author:
- John Cavanaugh
-
config
- The configuration being used.
-
dragged
- A flag indicating whether the cursor has been dragged (moved
while a button is held down).
-
movingArea
- The area (if any) being moved.
-
movingNode
- The node (if any) being moved.
-
movingOffset
- The offset from the cursor location to the upper left corner
of the node or area being moved.
-
net
- The network being displayed.
-
resizeArea
- The area (if any) being resized.
-
resizeAreaCorner
- The 'anchor' corner of an area being resized.
-
savedCursor
- The original cursor.
-
SEL_SQ_SIZE
-
-
VCC_DELTA
-
-
SelectListener(VisiFrame, DisplayCanvas, Network, VisiConfig)
- Constructs a select listener.
-
clearMouseVar()
- Clear variables used by mouse movement routines.
-
findDirection(Point, Point)
- Figure out the direction from one point to another.
-
mouseClicked(MouseEvent)
- Handle a mouse button click.
-
mouseDragged(MouseEvent)
- Handle a mouse movement with the button pressed.
-
mouseMoved(MouseEvent)
- Handle a mouse movement with no button pressed.
-
mousePressed(MouseEvent)
- Handle a mouse button press.
-
mouseReleased(MouseEvent)
- Handle a mouse button release.
-
nodeMoved()
- Update a node's location after it has moved.
-
popVCCInfo(Vector, Point)
- Pop up a window with information about one or more VCCs.
SEL_SQ_SIZE
public static final int SEL_SQ_SIZE
VCC_DELTA
private static final int VCC_DELTA
net
private Network net
- The network being displayed.
config
private VisiConfig config
- The configuration being used.
dragged
private boolean dragged
- A flag indicating whether the cursor has been dragged (moved
while a button is held down).
movingArea
private Area movingArea
- The area (if any) being moved.
resizeArea
private Area resizeArea
- The area (if any) being resized.
movingNode
private Node movingNode
- The node (if any) being moved.
savedCursor
private Cursor savedCursor
- The original cursor.
movingOffset
private Point movingOffset
- The offset from the cursor location to the upper left corner
of the node or area being moved.
resizeAreaCorner
private Point resizeAreaCorner
- The 'anchor' corner of an area being resized.
SelectListener
public SelectListener(VisiFrame frame,
DisplayCanvas canvas,
Network net,
VisiConfig config)
- Constructs a select listener.
- Parameters:
- frame - the parent frame.
- net - the network being displayed.
mouseClicked
public void mouseClicked(MouseEvent e)
- Handle a mouse button click.
- Parameters:
- e - the event that caused the method to be invoked.
- Overrides:
- mouseClicked in class MouseAdapter
mousePressed
public void mousePressed(MouseEvent e)
- Handle a mouse button press.
- Parameters:
- e - the event that caused the method to be invoked.
- Overrides:
- mousePressed in class MouseAdapter
mouseReleased
public void mouseReleased(MouseEvent e)
- Handle a mouse button release.
- Parameters:
- e - the event that caused the method to be invoked.
- Overrides:
- mouseReleased in class MouseAdapter
nodeMoved
private boolean nodeMoved()
- Update a node's location after it has moved.
- Returns:
- true if the configuration was modified as a
result of the move; false if it wasn't.
findDirection
private double findDirection(Point a,
Point b)
- Figure out the direction from one point to another.
- Parameters:
- a - the starting point.
- b - the destination.
- Returns:
- the direction in radians from point A to
point B.
mouseDragged
public void mouseDragged(MouseEvent e)
- Handle a mouse movement with the button pressed.
- Parameters:
- e - the event that caused the method to be invoked.
- Overrides:
- mouseDragged in class VisiMouseListener
mouseMoved
public void mouseMoved(MouseEvent e)
- Handle a mouse movement with no button pressed.
- Parameters:
- e - the event that caused the method to be invoked.
- Overrides:
- mouseMoved in class VisiMouseListener
clearMouseVar
private void clearMouseVar()
- Clear variables used by mouse movement routines.
popVCCInfo
private void popVCCInfo(Vector vccList,
Point cursorLoc)
- Pop up a window with information about one or more VCCs.
- Parameters:
- vccList - a list of the VCCs that information should
be displayed for.
- cursorLoc - the location of the mouse click that
caused the window to be displayed.