Class Calibration

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

public class Calibration extends TTrack implements MarkingRequired
A Calibration is a pair of calibration points that control the ImageCoordSystem of a TrackerPanel.
Author:
Douglas Brown
  • Field Details

    • XY_AXES

      protected static final int XY_AXES
      See Also:
    • X_AXIS

      protected static final int X_AXIS
      See Also:
    • Y_AXIS

      protected static final int Y_AXIS
      See Also:
    • 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
    • x1Field

      protected NumberField x1Field
    • y1Field

      protected NumberField y1Field
    • point1MissingLabel

      protected JLabel point1MissingLabel
    • point2MissingLabel

      protected JLabel point2MissingLabel
    • x1Label

      protected TTrack.TextLineLabel x1Label
    • y1Label

      protected TTrack.TextLineLabel y1Label
    • axisDropdown

      protected JComboBox<String> axisDropdown
    • axisDropdownAction

      protected ActionListener axisDropdownAction
    • axisLabel

      protected JLabel axisLabel
    • axes

      protected int axes
    • isWorldDataValid

      protected boolean[] isWorldDataValid
    • fixedCoordinates

      protected boolean fixedCoordinates
  • Constructor Details

    • Calibration

      public Calibration()
      Constructs a Calibration.
  • 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
    • getVarDimsImpl

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

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

      public void setAxisType(int axis)
      Sets the axis type.
      Parameters:
      axis - one of the type constants X_AXIS, Y_AXIS or XY_AXES
    • createStep

      public Step createStep(int n, double x, double y)
      Creates, adds a point to, or repositions a calibration step.
      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 x1, double y1, double x2, double y2)
      Creates a new calibration step with two calibration points.
      Parameters:
      n - the frame number
      x1 - the x coordinate of point 1 in image space
      y1 - the y coordinate of point 1 in image space
      x2 - the x coordinate of point 2 in image space
      y2 - the y coordinate of point 2 in image space
      Returns:
      the 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
    • getStep

      public Step getStep(int n)
      Overrides TTrack getStep method.
      Overrides:
      getStep in class TTrack
      Parameters:
      n - the frame number
      Returns:
      the step
    • isLocked

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

      public void setTrailVisible(boolean visible)
      Overrides TTrack setTrailVisible method. Calibration trails are never visible.
      Overrides:
      setTrailVisible in class TTrack
      Parameters:
      visible - ignored
    • isAutoTrackable

      protected boolean isAutoTrackable()
      Determines if at least one point in this track is autotrackable.
      Overrides:
      isAutoTrackable in class TTrack
      Returns:
      true if autotrackable
    • 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
    • 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
    • setFootprint

      public void setFootprint(String name)
      Overrides TTrack setFootprint to handle PointAxesFootprints.
      Overrides:
      setFootprint in class TTrack
      Parameters:
      name - the name of the desired footprint
    • 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 calibration point that is hit
    • setLocked

      public void setLocked(boolean locked)
      Overrides TTrack method.
      Overrides:
      setLocked in class TTrack
      Parameters:
      locked - true to lock this
    • 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
    • refreshStep

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

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

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

      protected int getTargetIndex()
      Overrides TTrack method
      Overrides:
      getTargetIndex in class TTrack
      Returns:
      the point index
    • 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
    • displayWorldCoordinates

      protected void displayWorldCoordinates()
      Displays the world coordinates of the currently selected step.
    • getLoader

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