Class 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. 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

      Fields 
      Modifier and Type Field Description
      protected java.util.Set<T> picked
      the 'picked' vertices
    • Field Detail

      • picked

        protected java.util.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>
        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 java.util.Set<T> getPicked()
        Specified by:
        getPicked in interface PickedState<T>
        Returns:
        all "picked" elements.
      • getSelectedObjects

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