Class MultiPickedState<T>
- java.lang.Object
-
- edu.uci.ics.jung.visualization.picking.AbstractPickedState<T>
-
- edu.uci.ics.jung.visualization.picking.MultiPickedState<T>
-
- All Implemented Interfaces:
PickedInfo<T>
,PickedState<T>
,java.awt.ItemSelectable
public class MultiPickedState<T> extends AbstractPickedState<T> implements PickedState<T>
Maintains the state of what has been 'picked' in the graph. TheSets
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
Fields Modifier and Type Field Description protected java.util.Set<T>
picked
the 'picked' vertices-
Fields inherited from class edu.uci.ics.jung.visualization.picking.AbstractPickedState
listenerList
-
-
Constructor Summary
Constructors Constructor Description MultiPickedState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the "picked" state from all elements.java.util.Set<T>
getPicked()
T[]
getSelectedObjects()
for the ItemSelectable interface contractboolean
isPicked(T e)
boolean
pick(T v, boolean state)
Marksv
as "picked" ifb == true
, and unmarksv
as picked ifb == false
.-
Methods inherited from class edu.uci.ics.jung.visualization.picking.AbstractPickedState
addItemListener, fireItemStateChanged, removeItemListener
-
-
-
-
Field Detail
-
picked
protected java.util.Set<T> picked
the 'picked' vertices
-
-
Method Detail
-
pick
public boolean pick(T v, boolean state)
Description copied from interface:PickedState
Marksv
as "picked" ifb == true
, and unmarksv
as picked ifb == false
.- Specified by:
pick
in interfacePickedState<T>
- Parameters:
v
- the element to be picked/unpickedstate
- true ifv
is to be marked as picked, false if to be marked as unpicked- Returns:
- the "picked" state of
v
prior to this call
-
clear
public void clear()
Description copied from interface:PickedState
Clears the "picked" state from all elements.- Specified by:
clear
in interfacePickedState<T>
-
getPicked
public java.util.Set<T> getPicked()
- Specified by:
getPicked
in interfacePickedState<T>
- Returns:
- all "picked" elements.
-
isPicked
public boolean isPicked(T e)
- Specified by:
isPicked
in interfacePickedInfo<T>
- Specified by:
isPicked
in interfacePickedState<T>
- Returns:
true
ifv
is currently "picked".
-
getSelectedObjects
public T[] getSelectedObjects()
for the ItemSelectable interface contract- Specified by:
getSelectedObjects
in interfacejava.awt.ItemSelectable
-
-