All Implemented Interfaces:
PropertyChangeListener, EventListener, Drawable, Interactive, Measurable, Trackable
Direct Known Subclasses:
VectorSum

public class Vector extends TTrack
A Vector draws a series of VectorSteps that represent a generic time-dependent vector.
Author:
Douglas Brown
  • Field Details

    • dataVariables

      protected static final String[] dataVariables
    • formatVariables

      protected static final String[] formatVariables
    • fieldVariables

      protected static final String[] fieldVariables
    • formatMap

      protected static final Map<String,String[]> formatMap
    • formatDescriptionMap

      protected static final Map<String,String> formatDescriptionMap
    • allVariables

      protected static final ArrayList<String> allVariables
    • tailsToOriginItem

      protected JMenuItem tailsToOriginItem
    • labelsVisibleItem

      protected JCheckBoxMenuItem labelsVisibleItem
    • visMap

      protected static final Map<Integer,Boolean> visMap
  • Constructor Details

    • Vector

      public Vector()
      Constructs a Vector.
  • Method Details

    • getFormatVariables

      public String[] getFormatVariables()
      Specified by:
      getFormatVariables in class TTrack
    • getFormatMap

      public Map<String,String[]> getFormatMap()
      Specified by:
      getFormatMap in class TTrack
    • getFormatDescMap

      public Map<String,String> getFormatDescMap()
      Specified by:
      getFormatDescMap in class TTrack
    • getBaseType

      public String getBaseType()
      Specified by:
      getBaseType in class TTrack
    • getVarDimsImpl

      public String getVarDimsImpl(String variable)
      Specified by:
      getVarDimsImpl in class TTrack
    • createStep

      public Step createStep(int n, double x, double y)
      Implements createStep. When creating a vector the coordinates define both the tail and tip position, but when re-marking an existing vector they define the tip position only.
      Specified by:
      createStep in class TTrack
      Parameters:
      n - the frame number
      x - the x coordinate in image space
      y - the y coordinate in image space
      Returns:
      the new step
    • createStep

      public Step createStep(int n, double x, double y, double xc, double yc)
      Creates a vector step with specified tail position and vector components.
      Parameters:
      n - the frame number
      x - the tail x coordinate in image space
      y - the tail y coordinate in image space
      xc - the x component in image space
      yc - the y component in image space
      Returns:
      the new step
    • getStepLength

      public int getStepLength()
      Gets the length of the steps created by this track.
      Specified by:
      getStepLength in class TTrack
      Returns:
      the footprint length
    • getFootprintLength

      public int getFootprintLength()
      Gets the length of the footprints required by this track.
      Specified by:
      getFootprintLength in class TTrack
      Returns:
      the footprint length
    • draw

      public void draw(DrawingPanel panel, Graphics _g)
      Overrides TTrack draw method.
      Specified by:
      draw in interface Drawable
      Overrides:
      draw in class TTrack
      Parameters:
      panel - the drawing panel requesting the drawing
      _g - the graphics context on which to draw
    • setLocked

      public void setLocked(boolean locked)
      Overrides TTrack setLocked method.
      Overrides:
      setLocked in class TTrack
      Parameters:
      locked - true to lock this
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Responds to property change events.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class TTrack
      Parameters:
      e - the property change event
    • setMarking

      protected void setMarking(boolean marking)
      Description copied from class: TTrack
      Sets the marking flag. Flag should be true when ready to be marked by user.
      Overrides:
      setMarking in class TTrack
      Parameters:
      marking - true when marking
    • refreshData

      protected void refreshData(DatasetManager data, TrackerPanel trackerPanel)
      Refreshes the data.
      Overrides:
      refreshData in class TTrack
      Parameters:
      data - the DatasetManager
      trackerPanel - the tracker panel
    • findInteractive

      public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
      Finds the interactive drawable object located at the specified pixel position.
      Specified by:
      findInteractive in interface Interactive
      Overrides:
      findInteractive in class TTrack
      Parameters:
      panel - the drawing panel
      xpix - the x pixel position on the panel
      ypix - the y pixel position on the panel
      Returns:
      the first step TPoint that is hit
    • setLabelsVisible

      public void setLabelsVisible(boolean visible)
      Sets the visibility of force vector labels.
      Parameters:
      visible - true to show all labels
    • isLabelsVisible

      public boolean isLabelsVisible()
      Gets the labels visibility.
      Returns:
      true if labels are visible
    • setVectorsVisible

      public void setVectorsVisible(TrackerPanel panel, boolean visible)
      Sets the visibility of the vectors on the specified tracker panel.
      Parameters:
      panel - the tracker panel
      visible - true to show vectors
    • isVectorsVisible

      public boolean isVectorsVisible(TrackerPanel trackerPanel)
      Gets whether the vectors are visible on the specified panel.
      Parameters:
      trackerPanel - the tracker panel
      Returns:
      true if positions are visible
    • getMenu

      public JMenu getMenu(TrackerPanel trackerPanel, JMenu menu0)
      Overrides TTrack getMenu method.
      Overrides:
      getMenu in class TTrack
      Parameters:
      trackerPanel - the tracker panel
      menu0 - the menu. If null, a dynamic menu is returned that adds items only when selected
      Returns:
      a menu
    • getToolbarTrackComponents

      public ArrayList<Component> getToolbarTrackComponents(TrackerPanel trackerPanel)
      Overrides TTrack getToolbarTrackComponents method.
      Overrides:
      getToolbarTrackComponents in class TTrack
      Parameters:
      trackerPanel - the tracker panel
      Returns:
      the DataSetManager
    • getToolbarPointComponents

      public ArrayList<Component> getToolbarPointComponents(TrackerPanel trackerPanel, TPoint point)
      Overrides TTrack getToolbarPointComponents method.
      Overrides:
      getToolbarPointComponents in class TTrack
      Parameters:
      trackerPanel - the tracker panel
      point - the TPoint
      Returns:
      a list of components
    • toString

      public String toString()
      Overrides Object toString method.
      Overrides:
      toString in class TTrack
      Returns:
      a description of this object
    • getNumberFields

      public Map<String,NumberField[]> getNumberFields()
      Description copied from class: TTrack
      Gets a map of number fields by name.
      Overrides:
      getNumberFields in class TTrack
      Returns:
      a map of name to NumberField.
    • getLoader

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