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>, 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 Details

    • picked

      protected Set<T> picked
      the 'picked' vertices
  • Constructor Details

    • MultiPickedState

      public MultiPickedState()
  • Method Details

    • 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>
      Parameters:
      v - the element to be picked/unpicked
      state - true if v 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 interface PickedState<T>
    • getPicked

      public Set<T> getPicked()
      Specified by:
      getPicked in interface PickedState<T>
      Returns:
      all "picked" elements.
    • isPicked

      public boolean isPicked(T e)
      Specified by:
      isPicked in interface PickedInfo<T>
      Specified by:
      isPicked in interface PickedState<T>
      Returns:
      true if v is currently "picked".
    • getSelectedObjects

      public T[] getSelectedObjects()
      for the ItemSelectable interface contract
      Specified by:
      getSelectedObjects in interface ItemSelectable