edu.uci.ics.jung.visualization.picking
Class MultiPickedState<T>

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

public class MultiPickedState<T>
extends AbstractPickedState<T>
implements PickedState<T>

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, Joshua O'Madadhain

Field Summary
protected  Set<T> picked
          the 'picked' vertices
 
Fields inherited from class edu.uci.ics.jung.visualization.picking.AbstractPickedState
listenerList
 
Constructor Summary
MultiPickedState()
           
 
Method Summary
 void clear()
          Clears the "picked" state from all elements.
 Set<T> getPicked()
          Returns all "picked" elements.
 T[] getSelectedObjects()
          for the ItemSelectable interface contract
 boolean isPicked(T e)
          Returns true if v is currently "picked".
 boolean pick(T v, boolean state)
          Marks v as "picked" if b == true, and unmarks v as picked if b == false.
 
Methods inherited from class edu.uci.ics.jung.visualization.picking.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

picked

protected Set<T> picked
the 'picked' vertices

Constructor Detail

MultiPickedState

public MultiPickedState()
Method Detail

pick

public boolean pick(T v,
                    boolean state)
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<T>
Returns:
the "picked" state of v prior to this call
See Also:
PickedState#pick(ArchetypeVertex, boolean)

clear

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

Specified by:
clear in interface PickedState<T>
See Also:
edu.uci.ics.jung.visualization.picking.PickedState#clearPickedVertices()

getPicked

public Set<T> getPicked()
Description copied from interface: PickedState
Returns all "picked" elements.

Specified by:
getPicked in interface PickedState<T>
See Also:
edu.uci.ics.jung.visualization.picking.PickedState#getPickedEdges()

isPicked

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

Specified by:
isPicked in interface PickedInfo<T>
Specified by:
isPicked in interface PickedState<T>
See Also:
edu.uci.ics.jung.visualization.picking.PickedState#isPicked(ArchetypeEdge)

getSelectedObjects

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

Specified by:
getSelectedObjects in interface ItemSelectable


Copyright © 2009. All Rights Reserved.