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 JMenuItemprotected static final String[]protected Object[]protected static final String[]protected intprotected static final String[]protected int[]protected double[]protected intprotected boolean[]Fields inherited from class org.opensourcephysics.cabrillo.tracker.InputTrack
editing, editListener, fixedPosition, inputField, ruler, rulerCheckboxFields 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.protected booleanprotected NumberFieldcreateStep(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 voidendEditing(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.intGets the length of the footprints required by this track.String[]protected JPopupMenuReturns a popup menu for the input field (readout).protected RectanglegetLayoutBounds(Step step) static XML.ObjectLoaderReturns 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 RulergetRuler()Gets the Ruler.intGets the length of the steps created by this track.protected StringgetTargetDescription(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 booleanDetermines if any point in this track is autotrackable.voidResponds to property change events.protected voidrefreshData(DatasetManager data, TrackerPanel trackerPanel) Refreshes the data.protected voidrefreshStep(Step step) Refreshes a step by setting it equal to a keyframe step.protected voidsetAnglesInRadians(boolean radians) Overrides TTrack method.protected voidsetInputValue(Step step) voidsetTrackerPanel(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, stopEditingMethods 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, 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
-
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:
getFormatVariablesin classTTrack
-
getFormatMap
- Specified by:
getFormatMapin classTTrack
-
getFormatDescMap
- Specified by:
getFormatDescMapin classTTrack
-
getBaseType
- Specified by:
getBaseTypein classTTrack
-
getVarDimsImpl
- Specified by:
getVarDimsImplin classTTrack
-
propertyChange
Responds to property change events. Overrides TTrack method.- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein 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:
createStepin 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:
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
-
getStepLength
public int getStepLength()Gets the length of the steps created by this track.- Specified by:
getStepLengthin classTTrack- Returns:
- the footprint length
-
isAutoTrackable
protected boolean isAutoTrackable()Determines if any point in this track is autotrackable.- Overrides:
isAutoTrackablein classTTrack- Returns:
- true if autotrackable
-
getTargetDescription
Returns a description of a target point with a given index.- Overrides:
getTargetDescriptionin classTTrack- Parameters:
pointIndex- the index- Returns:
- the description
-
getFootprintLength
public int getFootprintLength()Gets the length of the footprints required by this track.- Specified by:
getFootprintLengthin classTTrack- Returns:
- the footprint length
-
refreshData
Refreshes the data.- Overrides:
refreshDatain 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:
getAttachmentDescriptionin 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:
getToolbarTrackComponentsin classTTrack- Parameters:
trackerPanel- the tracker panel- Returns:
- a list of components
-
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 step or motion vector that is hit
-
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.
-
getInputFieldPopup
Returns a popup menu for the input field (readout).- Returns:
- the popup menu
-
setTrackerPanel
Overrides TTrack setTrackerPanel method.- Overrides:
setTrackerPanelin classInputTrack- Parameters:
panel- the TrackerPanel
-
setAnglesInRadians
protected void setAnglesInRadians(boolean radians) Overrides TTrack method.- Overrides:
setAnglesInRadiansin classTTrack- Parameters:
radians-truefor radians, false for degrees
-
getRuler
Description copied from class:InputTrackGets the Ruler. Subclasses override to return the appropriate Ruler type.- Overrides:
getRulerin classInputTrack- Returns:
- the Ruler
-
refreshStep
Refreshes a step by setting it equal to a keyframe step.- Specified by:
refreshStepin classInputTrack- Parameters:
step- the step to refresh
-
createInputField
- Specified by:
createInputFieldin classInputTrack
-
getLayoutBounds
- Specified by:
getLayoutBoundsin classInputTrack
-
checkKeyFrame
protected boolean checkKeyFrame()- Specified by:
checkKeyFramein classInputTrack
-
endEditing
- Specified by:
endEditingin classInputTrack
-
setInputValue
- Specified by:
setInputValuein classInputTrack
-
getLoader
Returns an ObjectLoader to save and load data for this class.- Returns:
- the object loader
-