edu.uci.ics.jung.visualization
Class MultiPickedState

java.lang.Object
  extended by edu.uci.ics.jung.visualization.AbstractPickedState
      extended by edu.uci.ics.jung.visualization.MultiPickedState
All Implemented Interfaces:
PickedInfo, PickedState, ItemSelectable

public class MultiPickedState
extends AbstractPickedState
implements PickedState

Maintains the state of what has been 'picked' in the graph. The Sets are constructed so that their iterators will traverse them in the order in which they are picked.

Author:
Tom Nelson - RABA Technologies, Joshua O'Madadhain

Field Summary
protected  Set pickedEdges
          the 'picked' edges
protected  Set pickedVertices
          the 'picked' vertices
 
Fields inherited from class edu.uci.ics.jung.visualization.AbstractPickedState
listenerList
 
Constructor Summary
MultiPickedState()
           
 
Method Summary
 void addListener(PickEventListener pel)
          Deprecated. Use addItemListener
 void clearPickedEdges()
          Clears the "picked" state from all edges.
 void clearPickedVertices()
          Clears the "picked" state from all vertices.
protected  void firePickEvent(Object object, boolean picked)
           
 Set getPickedEdges()
          Returns all "picked" edges.
 Set getPickedVertices()
          Returns all "picked" vertices.
 Object[] getSelectedObjects()
          for the ItemSelectable interface contract
 boolean isPicked(ArchetypeEdge e)
          Returns true if e is currently "picked".
 boolean isPicked(ArchetypeVertex v)
          Returns true if v is currently "picked".
 boolean isPicked(Edge e)
           
 boolean isPicked(Vertex v)
           
 boolean pick(ArchetypeEdge e, boolean picked)
          Marks e as "picked" if b == true, and unmarks e as picked if b == false.
 boolean pick(ArchetypeVertex v, boolean picked)
          Marks v as "picked" if b == true, and unmarks v as picked if b == false.
 void removeListener(PickEventListener pel)
          Deprecated. Use removeItemListener
 
Methods inherited from class edu.uci.ics.jung.visualization.AbstractPickedState
addItemListener, fireItemStateChanged, removeItemListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.ItemSelectable
addItemListener, removeItemListener
 

Field Detail

pickedVertices

protected Set pickedVertices
the 'picked' vertices


pickedEdges

protected Set pickedEdges
the 'picked' edges

Constructor Detail

MultiPickedState

public MultiPickedState()
Method Detail

pick

public boolean pick(ArchetypeVertex v,
                    boolean picked)
Description copied from interface: PickedState
Marks v as "picked" if b == true, and unmarks v as picked if b == false.

Specified by:
pick in interface PickedState
Returns:
the "picked" state of v prior to this call
See Also:
PickedState.pick(ArchetypeVertex, boolean)

pick

public boolean pick(ArchetypeEdge e,
                    boolean picked)
Description copied from interface: PickedState
Marks e as "picked" if b == true, and unmarks e as picked if b == false.

Specified by:
pick in interface PickedState
Returns:
the "picked" state of e prior to this call
See Also:
PickedState.pick(ArchetypeVertex, boolean)

clearPickedVertices

public void clearPickedVertices()
Description copied from interface: PickedState
Clears the "picked" state from all vertices.

Specified by:
clearPickedVertices in interface PickedState
See Also:
PickedState.clearPickedVertices()

clearPickedEdges

public void clearPickedEdges()
Description copied from interface: PickedState
Clears the "picked" state from all edges.

Specified by:
clearPickedEdges in interface PickedState
See Also:
PickedState.clearPickedEdges()

getPickedEdges

public Set getPickedEdges()
Description copied from interface: PickedState
Returns all "picked" edges.

Specified by:
getPickedEdges in interface PickedState
See Also:
PickedState.getPickedEdges()

isPicked

public boolean isPicked(ArchetypeEdge e)
Description copied from interface: PickedState
Returns true if e is currently "picked".

Specified by:
isPicked in interface PickedInfo
Specified by:
isPicked in interface PickedState
See Also:
PickedState.isPicked(ArchetypeEdge)

getPickedVertices

public Set getPickedVertices()
Description copied from interface: PickedState
Returns all "picked" vertices.

Specified by:
getPickedVertices in interface PickedState
See Also:
PickedState.getPickedVertices()

isPicked

public boolean isPicked(ArchetypeVertex v)
Description copied from interface: PickedState
Returns true if v is currently "picked".

Specified by:
isPicked in interface PickedInfo
Specified by:
isPicked in interface PickedState
See Also:
PickedState.isPicked(ArchetypeVertex)

addListener

public void addListener(PickEventListener pel)
Deprecated. Use addItemListener

Description copied from interface: PickedState
Adds a listener to this instance.

Specified by:
addListener in interface PickedState
See Also:
PickedState.addListener(edu.uci.ics.jung.visualization.PickEventListener)

removeListener

public void removeListener(PickEventListener pel)
Deprecated. Use removeItemListener

Description copied from interface: PickedState
Removes a listener from this instance.

Specified by:
removeListener in interface PickedState
See Also:
PickedState.removeListener(edu.uci.ics.jung.visualization.PickEventListener)

isPicked

public boolean isPicked(Vertex v)
See Also:
isPicked(ArchetypeVertex)

isPicked

public boolean isPicked(Edge e)
See Also:
isPicked(ArchetypeEdge)

getSelectedObjects

public Object[] getSelectedObjects()
for the ItemSelectable interface contract

Specified by:
getSelectedObjects in interface ItemSelectable

firePickEvent

protected void firePickEvent(Object object,
                             boolean picked)