Class CoordAxes

All Implemented Interfaces:
PropertyChangeListener, EventListener, Drawable, Interactive, Measurable, Trackable

public class CoordAxes extends TTrack
A CoordAxes displays and controls the image coordinate system of a specified tracker panel.
Author:
Douglas Brown
  • Field Details

    • gridOptionsIcon

      protected static final Icon gridOptionsIcon
    • dataVariables

      protected static final String[] dataVariables
    • formatVariables

      protected static final String[] formatVariables
    • formatMap

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

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

      protected static final ArrayList<String> allVariables
    • notyetShown

      protected boolean notyetShown
    • originLabel

      protected JLabel originLabel
    • grid

      protected WorldGrid grid
    • gridCheckbox

      protected JCheckBox gridCheckbox
    • gridButton

      protected TButton gridButton
    • gridSeparator

      protected Component gridSeparator
    • gridVisible

      protected boolean gridVisible
  • Constructor Details

    • CoordAxes

      public CoordAxes()
      Constructs a CoordAxes.
  • 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
    • getOrigin

      public TPoint getOrigin()
      Gets the origin.
      Returns:
      the current origin
    • isLocked

      public boolean isLocked()
      Overrides TTrack isLocked method.
      Overrides:
      isLocked in class TTrack
      Returns:
      true if this is locked
    • setVisible

      public void setVisible(boolean visible)
      Overrides TTrack setVisible method to change notyetShown flag.
      Overrides:
      setVisible in class TTrack
      Parameters:
      visible - true to show this track
    • setGridVisible

      public void setGridVisible(boolean visible)
      Sets the grid visibility.
      Parameters:
      visible - true to show the grid
    • setTrailVisible

      public void setTrailVisible(boolean visible)
      Overrides TTrack setTrailVisible method to keep trails hidden.
      Overrides:
      setTrailVisible in class TTrack
      Parameters:
      visible - ignored
    • createStep

      public Step createStep(int n, double x, double y)
      Mimics step creation by setting the origin position.
      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 step
    • deleteStep

      public Step deleteStep(int n)
      Overrides TTrack deleteStep method to prevent deletion.
      Overrides:
      deleteStep in class TTrack
      Parameters:
      n - the frame number
      Returns:
      the deleted step
    • getStep

      public Step getStep(int n)
      Overrides TTrack getStep method. Always return step 0.
      Overrides:
      getStep in class TTrack
      Parameters:
      n - the frame number (ignored)
      Returns:
      step 0
    • getStepLength

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

      protected boolean isAutoTrackable()
      Determines if at least one point in this track is autotrackable.
      Overrides:
      isAutoTrackable in class TTrack
      Returns:
      true if autotrackable
    • isAutoTrackable

      protected boolean isAutoTrackable(int pointIndex)
      Determines if the given point index is autotrackable.
      Overrides:
      isAutoTrackable in class TTrack
      Parameters:
      pointIndex - the points[] index
      Returns:
      true if autotrackable
    • getTargetDescription

      protected String getTargetDescription(int pointIndex)
      Returns a description of the point at a given index. Used by AutoTracker.
      Overrides:
      getTargetDescription in class TTrack
      Parameters:
      pointIndex - the points[] index
      Returns:
      the description
    • autoMarkAt

      public TPoint autoMarkAt(int n, double x, double y)
      Used by autoTracker to mark a step at a match target position.
      Overrides:
      autoMarkAt in class TTrack
      Parameters:
      n - the frame number
      x - the x target coordinate in image space
      y - the y target coordinate in image space
      Returns:
      the TPoint that was automarked
    • getMarkedPoint

      public TPoint getMarkedPoint(int n, int index)
      Used by autoTracker to get the marked point for a given frame and index. Overrides TTrack method.
      Overrides:
      getMarkedPoint in class TTrack
      Parameters:
      n - the frame number
      index - the index
      Returns:
      a TPoint
    • getFootprintLength

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

      public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
      Implements findInteractive method.
      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 that is hit
    • 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:
      a list of components
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Responds to property change events. This listens for the following events: "stepnumber" & "image" from TrackerPanel.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class TTrack
      Parameters:
      e - the property change event
    • setFontLevel

      public void setFontLevel(int level)
      Description copied from class: TTrack
      Sets the font level.
      Overrides:
      setFontLevel in class TTrack
      Parameters:
      level - the desired font level
    • 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