easik.sketch.util
Class SketchSelectionListener

java.lang.Object
  extended by easik.sketch.util.SketchSelectionListener
All Implemented Interfaces:
java.util.EventListener, org.jgraph.event.GraphSelectionListener

public class SketchSelectionListener
extends java.lang.Object
implements org.jgraph.event.GraphSelectionListener

This class sits on the Sketch we've created and listens for selection events. Upon receiving them it updates a vector of currently selected objects (JGraphT, not JGraph cells), and allows the application to manipulate them.

Version:
2006-07-31 Kevin Green
Author:
Rob Fletcher 2005, Kevin Green 2006

Field Summary
(package private)  java.util.Vector<java.lang.Object> _currentSelection
          The current selection as defined by the user
(package private)  Sketch _ourSketch
          The current sketch
 
Constructor Summary
SketchSelectionListener(Sketch inSketch)
          Initialises the sketch listener.
 
Method Summary
 void emptySelection()
          Clears the selection buffer, should only ever be used when loading a new sketch or clearing an existing one.
 java.util.Vector getCurrentSelection()
          Returns the vector containing the current selection
 void valueChanged(org.jgraph.event.GraphSelectionEvent graphEvent)
          Overloaded listener event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_currentSelection

java.util.Vector<java.lang.Object> _currentSelection
The current selection as defined by the user


_ourSketch

Sketch _ourSketch
The current sketch

Constructor Detail

SketchSelectionListener

public SketchSelectionListener(Sketch inSketch)
Initialises the sketch listener. Give it a pointer to the sketch it is resting on so it can check attributes.

Parameters:
inSketch - Sketch it is watching
Method Detail

getCurrentSelection

public java.util.Vector getCurrentSelection()
Returns the vector containing the current selection

Returns:
Current selection in a vector

emptySelection

public void emptySelection()
Clears the selection buffer, should only ever be used when loading a new sketch or clearing an existing one.


valueChanged

public void valueChanged(org.jgraph.event.GraphSelectionEvent graphEvent)
Overloaded listener event. Whenever selection changes, this will update the contents of the selection vector

Specified by:
valueChanged in interface org.jgraph.event.GraphSelectionListener
Parameters:
graphEvent - The event object