java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<Step>
org.opensourcephysics.cabrillo.tracker.StepSet
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Step>, Collection<Step>, Set<Step>

public class StepSet extends HashSet<Step>
A StepSet is a HashSet of Steps that can be saved in an XMLControl.
Author:
Douglas Brown
See Also:
  • Constructor Details

    • StepSet

      public StepSet(TFrame frame, Integer panelID)
      Constructs a StepSet.
      Parameters:
      panel - the TrackerPanel that draws the Steps
  • Method Details

    • add

      public boolean add(Step step)
      Adds a step to this set.
      Specified by:
      add in interface Collection<Step>
      Specified by:
      add in interface Set<Step>
      Overrides:
      add in class HashSet<Step>
      Parameters:
      step - the step to add
      Returns:
      true if added
    • remove

      public boolean remove(Object step)
      Removes a step from this set.
      Specified by:
      remove in interface Collection<Step>
      Specified by:
      remove in interface Set<Step>
      Overrides:
      remove in class HashSet<Step>
      Parameters:
      step - the step to remove
    • clear

      public void clear()
      Clears this set.
      Specified by:
      clear in interface Collection<Step>
      Specified by:
      clear in interface Set<Step>
      Overrides:
      clear in class HashSet<Step>
    • setChanged

      public void setChanged(boolean changed)
      Sets the changed property. When true, the steps in this set have been changed.
      Parameters:
      changed - true if changed
    • isChanged

      public boolean isChanged()
      Gets the changed property. When true, the steps in this set have been changed.
      Returns:
      true if changed
    • getStepsUndoControl

      public XMLControl getStepsUndoControl()
      Gets the XMLControl that defines the Undo state for this set.
      Returns:
      the undo XMLControl
    • getTrackUndoControl

      public XMLControl getTrackUndoControl()
      Gets the XMLControl that defines the Undo state for the track.
      Returns:
      the track XMLControl
    • getTracks

      public TTrack[] getTracks()
      Returns all tracks associated with the steps.
      Returns:
      a track array
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an ObjectLoader to save and load data for this class.
      Returns:
      the object loader
    • panel

      protected TrackerPanel panel()
    • dispose

      public void dispose()
    • finalize

      public void finalize()
      Overrides:
      finalize in class Object