Class Protractor
java.lang.Object
org.opensourcephysics.display.OSPRuntime.Supported
org.opensourcephysics.cabrillo.tracker.TTrack
org.opensourcephysics.cabrillo.tracker.InputTrack
org.opensourcephysics.cabrillo.tracker.Protractor
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,Drawable
,Interactive
,Measurable
,Trackable
A Protractor measures and displays angular arcs and arm lengths.
- 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 JMenuItem
protected static final String[]
protected Object[]
protected static final String[]
protected int
protected static final String[]
protected int[]
protected double[]
protected int
protected boolean[]
Fields inherited from class org.opensourcephysics.cabrillo.tracker.InputTrack
editing, editListener, fixedPosition, inputField, ruler, rulerCheckbox
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.protected boolean
protected NumberField
createStep
(int n, double x, double y) Implements createStep but only mimics step creation since steps are created automatically by the autofill StepArray.createStep
(int n, double x1, double y1, double x2, double y2) Mimics step creation by setting end positions of an existing step.protected void
endEditing
(Step step, String rawText) findInteractive
(DrawingPanel panel, int xpix, int ypix) Implements findInteractive method.getAttachmentDescription
(int n) Returns the description of a particular attachment point.int
Gets the length of the footprints required by this track.String[]
protected JPopupMenu
Returns a popup menu for the input field (readout).protected Rectangle
getLayoutBounds
(Step step) static XML.ObjectLoader
Returns an ObjectLoader to save and load data for this class.getMenu
(TrackerPanel trackerPanel, JMenu menu0) Returns a menu with items that control this track.Map<String,
NumberField[]> Gets a map of number fields by name.protected Object[]
Gets the rotational data.protected Ruler
getRuler()
Gets the Ruler.int
Gets the length of the steps created by this track.protected String
getTargetDescription
(int pointIndex) Returns a description of a target point with a given index.getToolbarTrackComponents
(TrackerPanel trackerPanel) Returns a list of point-related toolbar components.getVarDimsImpl
(String variable) protected boolean
Determines if any point in this track is autotrackable.void
Responds to property change events.protected void
refreshData
(DatasetManager data, TrackerPanel trackerPanel) Refreshes the data.protected void
refreshStep
(Step step) Refreshes a step by setting it equal to a keyframe step.protected void
setAnglesInRadians
(boolean radians) Overrides TTrack method.protected void
setInputValue
(Step step) void
setTrackerPanel
(TrackerPanel panel) Overrides TTrack setTrackerPanel method.toString()
Overrides Object toString method.Methods inherited from class org.opensourcephysics.cabrillo.tracker.InputTrack
deleteStep, getAttachmentLength, getKeyStep, getStep, getStep, isAutoTrackable, isFixedPosition, mouseClickedAction, setColor, setEditAction, setEditing, setFixedPosition, setFontLevel, setFootprint, setMagValue, setTrailVisible, stopEditing
Methods inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
addFixedItem, addFootprint, addListener, addListenerNCF, addPanelEvents, addStepListener, addTextColumn, assembleMenu, clearColumns, convertTextToDataColumn, createAllVariables, createWarningDialog, delete, delete, dispose, draw, erase, erase, finalize, fireStepsChanged, getAllVariables, 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, getSteps, getStepSizeWarningDialog, getTableViews, getTargetIndex, getTextColumnEntry, getTextColumnNames, getToolbarPointComponents, getTrack, getTrailLength, getValues, getVarFormatPattern, getVariableDimensions, getVariablesFromFormatterDisplayName, getX, getXMax, getXMin, getY, getYMax, getYMin, initialize, invalidateData, isAttached, isAutoAdvance, isDataValid, isDependent, isEmpty, isEnabled, isFullyAttached, isLocked, isMarkByDefault, isMarking, isMeasured, isStepComplete, isStepVisible, isTrailVisible, isViewable, isVisible, loadAttachmentsFromNames, refreshAttachments, refreshAttachmentsLater, refreshData, refreshDecimalSeparators, remark, remark, removeActiveTrack, removeDeleteTrackItem, removeListener, removeListenerNCF, removePanelEvents, removeStepListener, removeTextColumn, renameTextColumn, repaint, repaint, repaintAll, repaintStep, restorePatterns, savePatterns, setActive, setAutoAdvance, setColorToDefault, setDefaultNameAndColor, setDescription, setEnabled, setFootprint, setFootprints, setFootprints, setFormatPattern, setInitialFormatPatterns, setLocked, 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
-
dataVariables
-
fieldVariables
-
formatVariables
-
formatMap
-
formatDescriptionMap
-
allVariables
-
attachmentItem
-
firstDerivSpill
protected int firstDerivSpill -
secondDerivSpill
protected int secondDerivSpill -
params
protected int[] params -
rotationAngle
protected double[] rotationAngle -
validData
protected boolean[] validData -
derivData
-
-
Constructor Details
-
Protractor
public Protractor()Constructs a Protractor.
-
-
Method Details
-
getFormatVariables
- Specified by:
getFormatVariables
in classTTrack
-
getFormatMap
- Specified by:
getFormatMap
in classTTrack
-
getFormatDescMap
- Specified by:
getFormatDescMap
in classTTrack
-
getBaseType
- Specified by:
getBaseType
in classTTrack
-
getVarDimsImpl
- Specified by:
getVarDimsImpl
in classTTrack
-
propertyChange
Responds to property change events. Overrides TTrack method.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classTTrack
- Parameters:
e
- the property change event
-
createStep
Implements createStep but only mimics step creation since steps are created automatically by the autofill StepArray.- Specified by:
createStep
in classTTrack
- Parameters:
n
- the frame numberx
- the x coordinate in image spacey
- the y coordinate in image space- Returns:
- the step
-
createStep
Mimics step creation by setting end positions of an existing step.- Parameters:
n
- the frame numberx1
- the x coordinate of end1 in image spacey1
- the y coordinate of end1 in image spacex2
- the x coordinate of end2 in image spacey2
- the y coordinate of end2 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
-
getStepLength
public int getStepLength()Gets the length of the steps created by this track.- Specified by:
getStepLength
in classTTrack
- Returns:
- the footprint length
-
isAutoTrackable
protected boolean isAutoTrackable()Determines if any point in this track is autotrackable.- Overrides:
isAutoTrackable
in classTTrack
- Returns:
- true if autotrackable
-
getTargetDescription
Returns a description of a target point with a given index.- Overrides:
getTargetDescription
in classTTrack
- Parameters:
pointIndex
- the index- Returns:
- the description
-
getFootprintLength
public int getFootprintLength()Gets the length of the footprints required by this track.- Specified by:
getFootprintLength
in classTTrack
- Returns:
- the footprint length
-
refreshData
Refreshes the data.- Overrides:
refreshData
in classTTrack
- Parameters:
data
- the DatasetManagertrackerPanel
- the tracker panel
-
getRotationData
Gets the rotational data.- Returns:
- Object[] {theta, omega, alpha}
-
getAttachmentDescription
Returns the description of a particular attachment point.- Overrides:
getAttachmentDescription
in classTTrack
- Parameters:
n
- the attachment point index- Returns:
- the description
-
getMenu
Returns a menu with items that control this track. -
getToolbarTrackComponents
Returns a list of point-related toolbar components.- Overrides:
getToolbarTrackComponents
in classTTrack
- Parameters:
trackerPanel
- the tracker panel- Returns:
- a list of components
-
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 step or motion vector that is hit
-
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.
-
getInputFieldPopup
Returns a popup menu for the input field (readout).- Returns:
- the popup menu
-
setTrackerPanel
Overrides TTrack setTrackerPanel method.- Overrides:
setTrackerPanel
in classInputTrack
- Parameters:
panel
- the TrackerPanel
-
setAnglesInRadians
protected void setAnglesInRadians(boolean radians) Overrides TTrack method.- Overrides:
setAnglesInRadians
in classTTrack
- Parameters:
radians
-true
for radians, false for degrees
-
getRuler
Description copied from class:InputTrack
Gets the Ruler. Subclasses override to return the appropriate Ruler type.- Overrides:
getRuler
in classInputTrack
- Returns:
- the Ruler
-
refreshStep
Refreshes a step by setting it equal to a keyframe step.- Specified by:
refreshStep
in classInputTrack
- Parameters:
step
- the step to refresh
-
createInputField
- Specified by:
createInputField
in classInputTrack
-
getLayoutBounds
- Specified by:
getLayoutBounds
in classInputTrack
-
checkKeyFrame
protected boolean checkKeyFrame()- Specified by:
checkKeyFrame
in classInputTrack
-
endEditing
- Specified by:
endEditing
in classInputTrack
-
setInputValue
- Specified by:
setInputValue
in classInputTrack
-
getLoader
Returns an ObjectLoader to save and load data for this class.- Returns:
- the object loader
-