Class Calibration
java.lang.Object
org.opensourcephysics.display.OSPRuntime.Supported
org.opensourcephysics.cabrillo.tracker.TTrack
org.opensourcephysics.cabrillo.tracker.Calibration
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,MarkingRequired
,Drawable
,Interactive
,Measurable
,Trackable
A Calibration is a pair of calibration points that control the
ImageCoordSystem of a TrackerPanel.
- Author:
- Douglas Brown
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
TTrack.NameDialog, TTrack.StepArray, TTrack.TextLineLabel, TTrack.TrackDecimalField, TTrack.TrackNumberField
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected ActionListener
protected JLabel
protected static final String[]
protected boolean
protected static final String[]
protected boolean[]
protected JLabel
protected JLabel
protected static final int
protected NumberField
protected TTrack.TextLineLabel
protected static final int
protected static final int
protected NumberField
protected TTrack.TextLineLabel
Fields inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
angleField, angleLabel, angleSeparator, attachmentNames, attachments, autoAdvance, autoAdvanceItem, autoTrackerMarking, circleFootprintListener, clearStepsItem, closeButton, colorItem, constantsLoadedFromXML, customNumberFormats, dataBuilderItem, dataDescriptions, dataFrames, dataProp, datasetManager, dataValid, defaultColors, defaultFootprint, deleteStepItem, deleteTrackItem, description, descriptionItem, enabled, fieldBorder, fixedItem, footprint, footprintListener, footprintMenu, footprints, formatAngleMouseListener, formatMouseListener, hint, HINT_STEP_ADDED_OR_REMOVED, HINT_STEPS_SELECTED, initialized, isMarking, keyFrames, labelFont, locked, lockedItem, magField, magLabel, magSeparator, markByDefault, markByDefaultItem, name, nameDialog, nameItem, nextID, NOMAP, NOMAPS, NOVARA, NOVARS, numberFields, partName, points, positionFields, preferredColumnOrder, properties, PROPERTY_TTRACK_COLOR, PROPERTY_TTRACK_DATA, PROPERTY_TTRACK_FOOTPRINT, PROPERTY_TTRACK_FORMAT, PROPERTY_TTRACK_LOCKED, PROPERTY_TTRACK_MASS, PROPERTY_TTRACK_MODELEND, PROPERTY_TTRACK_MODELSTART, PROPERTY_TTRACK_NAME, PROPERTY_TTRACK_STEP, PROPERTY_TTRACK_STEPS, PROPERTY_TTRACK_TEXTCOLUMN, PROPERTY_TTRACK_VISIBLE, refreshDataLater, skippedStepWarningCheckbox, skippedStepWarningDialog, skippedStepWarningOn, skippedStepWarningTextpane, stepLabel, steps, stepSeparator, stepSizeWhenFirstMarked, stepValueLabel, targetIndex, textColumnEntries, textColumnNames, tField, tframe, tLabel, toolbarPointComponents, toolbarTrackComponents, tp, trailLength, trailVisible, trailVisibleItem, tSeparator, ttype, tValueLabel, TYPE_CALIBRATION, TYPE_CIRCLEFITTER, TYPE_COORDAXES, TYPE_LINEPROFILE, TYPE_OFFSETORIGIN, TYPE_PERSPECTIVE, TYPE_POINTMASS, TYPE_PROTRACTOR, TYPE_RGBREGION, TYPE_TAPEMEASURE, TYPE_UNKNOWN, TYPE_VECTOR, viewable, visible, visibleItem, xField, xLabel, xSeparator, xSpinner, yField, yLabel, ySeparator, ySpinner
Fields inherited from interface org.opensourcephysics.media.core.Trackable
PROPERTY_ADJUSTING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoMarkAt
(int n, double x, double y) Used by autoTracker to mark a step at a match target position.createStep
(int n, double x, double y) Creates, adds a point to, or repositions a calibration step.createStep
(int n, double x1, double y1, double x2, double y2) Creates a new calibration step with two calibration points.protected void
Displays the world coordinates of the currently selected step.findInteractive
(DrawingPanel panel, int xpix, int ypix) Implements findInteractive method.int
Gets the length of the footprints required by this track.String[]
static XML.ObjectLoader
Returns an ObjectLoader to save and load data for this class.getMenu
(TrackerPanel trackerPanel, JMenu menu0) Overrides TTrack getMenu method.Map<String,
NumberField[]> Gets a map of number fields by name.getStep
(int n) Overrides TTrack getStep method.int
Gets the length of the steps created by this track.protected String
getTargetDescription
(int pointIndex) Returns a description of the point at a given index.protected int
Overrides TTrack methodgetToolbarTrackComponents
(TrackerPanel trackerPanel) Overrides TTrack getToolbarTrackComponents method.getVarDimsImpl
(String variable) protected boolean
Determines if at least one point in this track is autotrackable.boolean
Determines if the world coordinates are fixed.boolean
isLocked()
Overrides TTrack isLocked method.boolean
Gets the markByDefault property.void
Responds to property change events.protected void
refreshStep
(CalibrationStep step) Refreshes a step by setting it equal to the previous keyframe step.boolean
Implements MarkingRequired interface.void
setAxisType
(int axis) Sets the axis type.void
setFixedCoordinates
(boolean fixed) Sets the fixed coordinates property.void
setFontLevel
(int level) Sets the font level.void
setFootprint
(String name) Overrides TTrack setFootprint to handle PointAxesFootprints.void
setLocked
(boolean locked) Overrides TTrack method.void
setTrackerPanel
(TrackerPanel panel) Adds events for TrackerPanel.void
setTrailVisible
(boolean visible) Overrides TTrack setTrailVisible method.toString()
Overrides Object toString method.Methods inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
addFixedItem, addFootprint, addListener, addListenerNCF, addPanelEvents, addStepListener, addTextColumn, assembleMenu, clearColumns, convertTextToDataColumn, createAllVariables, createWarningDialog, delete, delete, deleteStep, dispose, draw, erase, erase, finalize, fireStepsChanged, getAllVariables, getAttachmentDescription, getAttachmentLength, getAttachments, getBaseTrackName, getBaseTypeInt, getColor, getCustomFormatPatterns, getData, getData, getDataDescription, getDataName, getDefaultFormatPatterns, getDefaultFormatPatterns, getDescription, getFootprint, getFootprint, getFootprintName, getFootprints, getFootprints, getFormatPatterns, getFrameForData, getIcon, getID, getMarkedPoint, getMarkingCursor, getMenuItems, getMessage, getName, getName, getNameDialog, getNextVisibleStep, getNumberFieldsForStep, getPlotViews, getPreferredDataOrder, getPreviousVisibleStep, getProperty, getPropertyNames, getSkippedStepWarningDialog, getStep, getSteps, getStepSizeWarningDialog, getTableViews, getTextColumnEntry, getTextColumnNames, getToolbarPointComponents, getTrack, getTrailLength, getValues, getVarFormatPattern, getVariableDimensions, getVariablesFromFormatterDisplayName, getX, getXMax, getXMin, getY, getYMax, getYMin, initialize, invalidateData, isAttached, isAutoAdvance, isAutoTrackable, isDataValid, isDependent, isEmpty, isEnabled, isFullyAttached, isMarking, isMeasured, isStepComplete, isStepVisible, isTrailVisible, isViewable, isVisible, loadAttachmentsFromNames, refreshAttachments, refreshAttachmentsLater, refreshData, refreshData, refreshDecimalSeparators, remark, remark, removeActiveTrack, removeDeleteTrackItem, removeListener, removeListenerNCF, removePanelEvents, removeStepListener, removeTextColumn, renameTextColumn, repaint, repaint, repaintAll, repaintStep, restorePatterns, savePatterns, setActive, setAnglesInRadians, setAutoAdvance, setColor, setColorToDefault, setDefaultNameAndColor, setDescription, setEnabled, setFixedPosition, setFootprint, setFootprints, setFootprints, setFormatPattern, setInitialFormatPatterns, setMarkByDefault, setMarking, setName, setProperty, setTargetIndex, setTargetIndex, setTargetIndex, setTextColumnEntry, setTrailLength, setViewable, setVisible, setX, setXY, setY, showAnglePopup, showFormatPopup, updateListenerVisible
Methods inherited from class org.opensourcephysics.display.OSPRuntime.Supported
addListeners, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListenerSafely, dispose, firePropertyChange, firePropertyChange, removeListeners, removePropertyChangeListener, removePropertyChangeListener
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opensourcephysics.display.Interactive
isInteractive
-
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
-
formatVariables
-
formatMap
-
formatDescriptionMap
-
allVariables
-
x1Field
-
y1Field
-
point1MissingLabel
-
point2MissingLabel
-
x1Label
-
y1Label
-
axisDropdown
-
axisDropdownAction
-
axisLabel
-
axes
protected int axes -
isWorldDataValid
protected boolean[] isWorldDataValid -
fixedCoordinates
protected boolean fixedCoordinates
-
-
Constructor Details
-
Calibration
public Calibration()Constructs a Calibration.
-
-
Method Details
-
getFormatVariables
- Specified by:
getFormatVariables
in classTTrack
-
getFormatMap
- Specified by:
getFormatMap
in classTTrack
-
getFormatDescMap
- Specified by:
getFormatDescMap
in classTTrack
-
getVarDimsImpl
- Specified by:
getVarDimsImpl
in classTTrack
-
getBaseType
- Specified by:
getBaseType
in classTTrack
-
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
Creates, adds a point to, or repositions a calibration step.- Specified by:
createStep
in classTTrack
- Parameters:
n
- the frame numberx
- the x coordinate in image spacey
- the y coordinate in image space- Returns:
- the new step
-
createStep
Creates a new calibration step with two calibration points.- Parameters:
n
- the frame numberx1
- the x coordinate of point 1 in image spacey1
- the y coordinate of point 1 in image spacex2
- the x coordinate of point 2 in image spacey2
- the y coordinate of point 2 in image space- Returns:
- the step
-
autoMarkAt
Used by autoTracker to mark a step at a match target position.- Overrides:
autoMarkAt
in classTTrack
- Parameters:
n
- the frame numberx
- the x target coordinate in image spacey
- the y target coordinate in image space- Returns:
- the TPoint that was automarked
-
getStep
Overrides TTrack getStep method. -
isLocked
public boolean isLocked()Overrides TTrack isLocked method. -
setTrailVisible
public void setTrailVisible(boolean visible) Overrides TTrack setTrailVisible method. Calibration trails are never visible.- Overrides:
setTrailVisible
in classTTrack
- Parameters:
visible
- ignored
-
isAutoTrackable
protected boolean isAutoTrackable()Determines if at least one point in this track is autotrackable.- Overrides:
isAutoTrackable
in classTTrack
- Returns:
- true if autotrackable
-
getStepLength
public int getStepLength()Gets the length of the steps created by this track.- Specified by:
getStepLength
in classTTrack
- Returns:
- the footprint length
-
getFootprintLength
public int getFootprintLength()Gets the length of the footprints required by this track.- Specified by:
getFootprintLength
in classTTrack
- 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
Overrides TTrack setFootprint to handle PointAxesFootprints.- Overrides:
setFootprint
in classTTrack
- Parameters:
name
- the name of the desired footprint
-
findInteractive
Implements findInteractive method.- Specified by:
findInteractive
in interfaceInteractive
- Overrides:
findInteractive
in classTTrack
- Parameters:
panel
- the drawing panelxpix
- the x pixel position on the panelypix
- the y pixel position on the panel- Returns:
- the first calibration point that is hit
-
setLocked
public void setLocked(boolean locked) Overrides TTrack method. -
getMenu
Overrides TTrack getMenu method. -
getToolbarTrackComponents
Overrides TTrack getToolbarTrackComponents method.- Overrides:
getToolbarTrackComponents
in classTTrack
- Parameters:
trackerPanel
- the tracker panel- Returns:
- a list of components
-
refreshStep
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 classTTrack
- Parameters:
level
- the desired font level
-
toString
Overrides Object toString method. -
getNumberFields
Description copied from class:TTrack
Gets a map of number fields by name.- Overrides:
getNumberFields
in classTTrack
- 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 classTTrack
- Returns:
true
if this marks by default
-
requiresMarking
public boolean requiresMarking()Implements MarkingRequired interface.- Specified by:
requiresMarking
in interfaceMarkingRequired
-
propertyChange
Responds to property change events. Overrides TTrack method.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classTTrack
- Parameters:
e
- the property change event
-
setTrackerPanel
Adds events for TrackerPanel.- Overrides:
setTrackerPanel
in classTTrack
- Parameters:
panel
- the new TrackerPanel
-
getTargetIndex
protected int getTargetIndex()Overrides TTrack method- Overrides:
getTargetIndex
in classTTrack
- Returns:
- the point index
-
getTargetDescription
Returns a description of the point at a given index. Used by AutoTracker.- Overrides:
getTargetDescription
in classTTrack
- Parameters:
pointIndex
- the points[] index- Returns:
- the description
-
displayWorldCoordinates
protected void displayWorldCoordinates()Displays the world coordinates of the currently selected step. -
getLoader
Returns an ObjectLoader to save and load data for this class.- Returns:
- the object loader
-