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 intprotected ActionListenerprotected JLabelprotected static final String[]protected booleanprotected static final String[]protected boolean[]protected JLabelprotected JLabelprotected static final intprotected NumberFieldprotected TTrack.TextLineLabelprotected static final intprotected static final intprotected NumberFieldprotected TTrack.TextLineLabelFields 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, ySpinnerFields 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 voidDisplays the world coordinates of the currently selected step.findInteractive(DrawingPanel panel, int xpix, int ypix) Implements findInteractive method.intGets the length of the footprints required by this track.String[]static XML.ObjectLoaderReturns 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.intGets the length of the steps created by this track.protected StringgetTargetDescription(int pointIndex) Returns a description of the point at a given index.protected intOverrides TTrack methodgetToolbarTrackComponents(TrackerPanel trackerPanel) Overrides TTrack getToolbarTrackComponents method.getVarDimsImpl(String variable) protected booleanDetermines if at least one point in this track is autotrackable.booleanDetermines if the world coordinates are fixed.booleanisLocked()Overrides TTrack isLocked method.booleanGets the markByDefault property.voidResponds to property change events.protected voidrefreshStep(CalibrationStep step) Refreshes a step by setting it equal to the previous keyframe step.booleanImplements MarkingRequired interface.voidsetAxisType(int axis) Sets the axis type.voidsetFixedCoordinates(boolean fixed) Sets the fixed coordinates property.voidsetFontLevel(int level) Sets the font level.voidsetFootprint(String name) Overrides TTrack setFootprint to handle PointAxesFootprints.voidsetLocked(boolean locked) Overrides TTrack method.voidsetTrackerPanel(TrackerPanel panel) Adds events for TrackerPanel.voidsetTrailVisible(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, updateListenerVisibleMethods inherited from class org.opensourcephysics.display.OSPRuntime.Supported
addListeners, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListenerSafely, dispose, firePropertyChange, firePropertyChange, removeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
getFormatVariablesin classTTrack
-
getFormatMap
- Specified by:
getFormatMapin classTTrack
-
getFormatDescMap
- Specified by:
getFormatDescMapin classTTrack
-
getVarDimsImpl
- Specified by:
getVarDimsImplin classTTrack
-
getBaseType
- Specified by:
getBaseTypein 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:
createStepin 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:
autoMarkAtin 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:
setTrailVisiblein classTTrack- Parameters:
visible- ignored
-
isAutoTrackable
protected boolean isAutoTrackable()Determines if at least one point in this track is autotrackable.- Overrides:
isAutoTrackablein classTTrack- Returns:
- true if autotrackable
-
getStepLength
public int getStepLength()Gets the length of the steps created by this track.- Specified by:
getStepLengthin classTTrack- Returns:
- the footprint length
-
getFootprintLength
public int getFootprintLength()Gets the length of the footprints required by this track.- Specified by:
getFootprintLengthin classTTrack- Returns:
- the footprint length
-
isFixedCoordinates
public boolean isFixedCoordinates()Determines if the world coordinates are fixed.- Returns:
trueif 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-trueto fix the coordinates
-
setFootprint
Overrides TTrack setFootprint to handle PointAxesFootprints.- Overrides:
setFootprintin classTTrack- Parameters:
name- the name of the desired footprint
-
findInteractive
Implements findInteractive method.- Specified by:
findInteractivein interfaceInteractive- Overrides:
findInteractivein 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:
getToolbarTrackComponentsin 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:
setFontLevelin classTTrack- Parameters:
level- the desired font level
-
toString
Overrides Object toString method. -
getNumberFields
Description copied from class:TTrackGets a map of number fields by name.- Overrides:
getNumberFieldsin classTTrack- Returns:
- a map of name to NumberField.
-
isMarkByDefault
public boolean isMarkByDefault()Description copied from class:TTrackGets the markByDefault property. When true, the mouse handler should mark a point whenever the active track reports itself incomplete.- Overrides:
isMarkByDefaultin classTTrack- Returns:
trueif this marks by default
-
requiresMarking
public boolean requiresMarking()Implements MarkingRequired interface.- Specified by:
requiresMarkingin interfaceMarkingRequired
-
propertyChange
Responds to property change events. Overrides TTrack method.- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classTTrack- Parameters:
e- the property change event
-
setTrackerPanel
Adds events for TrackerPanel.- Overrides:
setTrackerPanelin classTTrack- Parameters:
panel- the new TrackerPanel
-
getTargetIndex
protected int getTargetIndex()Overrides TTrack method- Overrides:
getTargetIndexin classTTrack- Returns:
- the point index
-
getTargetDescription
Returns a description of the point at a given index. Used by AutoTracker.- Overrides:
getTargetDescriptionin 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
-