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

Variable Index

 o config
The configuration being used.
 o dragged
A flag indicating whether the cursor has been dragged (moved while a button is held down).
 o movingArea
The area (if any) being moved.
 o movingNode
The node (if any) being moved.
 o movingOffset
The offset from the cursor location to the upper left corner of the node or area being moved.
 o net
The network being displayed.
 o resizeArea
The area (if any) being resized.
 o resizeAreaCorner
The 'anchor' corner of an area being resized.
 o savedCursor
The original cursor.
 o SEL_SQ_SIZE
 o VCC_DELTA

Constructor Index

 o SelectListener(VisiFrame, DisplayCanvas, Network, VisiConfig)
Constructs a select listener.

Method Index

 o clearMouseVar()
Clear variables used by mouse movement routines.
 o findDirection(Point, Point)
Figure out the direction from one point to another.
 o mouseClicked(MouseEvent)
Handle a mouse button click.
 o mouseDragged(MouseEvent)
Handle a mouse movement with the button pressed.
 o mouseMoved(MouseEvent)
Handle a mouse movement with no button pressed.
 o mousePressed(MouseEvent)
Handle a mouse button press.
 o mouseReleased(MouseEvent)
Handle a mouse button release.
 o nodeMoved()
Update a node's location after it has moved.
 o popVCCInfo(Vector, Point)
Pop up a window with information about one or more VCCs.

Variables

 o SEL_SQ_SIZE
 public static final int SEL_SQ_SIZE
 o VCC_DELTA
 private static final int VCC_DELTA
 o net
 private Network net
The network being displayed.

 o config
 private VisiConfig config
The configuration being used.

 o dragged
 private boolean dragged
A flag indicating whether the cursor has been dragged (moved while a button is held down).

 o movingArea
 private Area movingArea
The area (if any) being moved.

 o resizeArea
 private Area resizeArea
The area (if any) being resized.

 o movingNode
 private Node movingNode
The node (if any) being moved.

 o savedCursor
 private Cursor savedCursor
The original cursor.

 o movingOffset
 private Point movingOffset
The offset from the cursor location to the upper left corner of the node or area being moved.

 o resizeAreaCorner
 private Point resizeAreaCorner
The 'anchor' corner of an area being resized.

Constructors

 o 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.

Methods

 o 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
 o 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
 o 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
 o 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.
 o 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.
 o 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
 o 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
 o clearMouseVar
 private void clearMouseVar()
Clear variables used by mouse movement routines.

 o 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.