Class OffsetOrigin

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

public class OffsetOrigin extends TTrack implements MarkingRequired
An OffsetOrigin controls the origin of an image coordinate system.
Author:
Douglas Brown
  • Field Details

    • 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
    • fixedCoordinates

      protected boolean fixedCoordinates
    • fixedCoordinatesItem

      protected JCheckBoxMenuItem fixedCoordinatesItem
    • unmarkedLabel

      protected JLabel unmarkedLabel
  • Constructor Details

    • OffsetOrigin

      public OffsetOrigin()
      Constructs an OffsetOrigin.
  • Method Details

    • getFormatMap

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

      public String[] getFormatVariables()
      Specified by:
      getFormatVariables 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)
      Creates a new offset origin step with specified image coordinates.
      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
    • 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
    • isAutoTrackable

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

      public boolean isFixedCoordinates()
      Determines if the world coordinates are fixed.
      Returns:
      true if fixed
    • setFixedCoordinates

      public void setFixedCoordinates(boolean fixed)
      Sets the fixed coordinates property. When fixed, the world coordinates are the same at all times.
      Parameters:
      fixed - true to fix the coordinates
    • getStep

      public Step getStep(int n)
      Overrides TTrack getStep method. This refreshes the step before returning it since its position and/or world coordinates may change due to external factors.
      Overrides:
      getStep in class TTrack
      Parameters:
      n - the frame number
      Returns:
      the step
    • isLocked

      public boolean isLocked()
      Overrides TTrack isLocked method. Returns true if this is locked or if the coordinate system is locked.
      Overrides:
      isLocked in class TTrack
      Returns:
      true if this is locked
    • setTrailVisible

      public void setTrailVisible(boolean visible)
      Overrides TTrack setTrailVisible method. Offset origin trails are never visible.
      Overrides:
      setTrailVisible in class TTrack
      Parameters:
      visible - ignored
    • 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
    • findInteractive

      public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
      Overrides TTrack 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 current step or null
    • 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 method.
      Overrides:
      getToolbarTrackComponents in class TTrack
      Parameters:
      trackerPanel - the tracker panel
      Returns:
      a list of components
    • setTrackerPanel

      public void setTrackerPanel(TrackerPanel panel)
      Adds events for TrackerPanel.
      Overrides:
      setTrackerPanel in class TTrack
      Parameters:
      panel - the new TrackerPanel
    • propertyChange

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

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

      public void setFontLevel(int level)
      Sets the font level.
      Overrides:
      setFontLevel in class TTrack
      Parameters:
      level - the desired font level
    • isMarkByDefault

      public boolean isMarkByDefault()
      Description copied from class: TTrack
      Gets the markByDefault property. When true, the mouse handler should mark a point whenever the active track reports itself incomplete.
      Overrides:
      isMarkByDefault in class TTrack
      Returns:
      true if this marks by default
    • requiresMarking

      public boolean requiresMarking()
      Implements MarkingRequired interface.
      Specified by:
      requiresMarking in interface MarkingRequired
    • toString

      public String toString()
      Overrides Object toString method.
      Overrides:
      toString in class TTrack
      Returns:
      the name of this track
    • 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.
    • 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
    • refreshStep

      protected void refreshStep(OffsetOriginStep step)
      Refreshes a step by setting it equal to the previous keyframe step.
      Parameters:
      step - the step to refresh
    • getLoader

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