Class Vector
java.lang.Object
org.opensourcephysics.display.OSPRuntime.Supported
org.opensourcephysics.cabrillo.tracker.TTrack
org.opensourcephysics.cabrillo.tracker.Vector
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,Drawable
,Interactive
,Measurable
,Trackable
- Direct Known Subclasses:
VectorSum
A Vector draws a series of VectorSteps that represent a generic
time-dependent vector.
- Author:
- Douglas Brown
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Inner class containing the vector data for a single frame number.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 static final String[]
protected static final String[]
protected static final String[]
protected JCheckBoxMenuItem
protected JMenuItem
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 TypeMethodDescriptioncreateStep
(int n, double x, double y) Implements createStep.createStep
(int n, double x, double y, double xc, double yc) Creates a vector step with specified tail position and vector components.void
draw
(DrawingPanel panel, Graphics _g) Overrides TTrack draw method.findInteractive
(DrawingPanel panel, int xpix, int ypix) Finds the interactive drawable object located at the specified pixel position.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.int
Gets the length of the steps created by this track.getToolbarPointComponents
(TrackerPanel trackerPanel, TPoint point) Overrides TTrack getToolbarPointComponents method.getToolbarTrackComponents
(TrackerPanel trackerPanel) Overrides TTrack getToolbarTrackComponents method.getVarDimsImpl
(String variable) boolean
Gets the labels visibility.boolean
isVectorsVisible
(TrackerPanel trackerPanel) Gets whether the vectors are visible on the specified panel.void
Responds to property change events.protected void
refreshData
(DatasetManager data, TrackerPanel trackerPanel) Refreshes the data.void
setLabelsVisible
(boolean visible) Sets the visibility of force vector labels.void
setLocked
(boolean locked) Overrides TTrack setLocked method.protected void
setMarking
(boolean marking) Sets the marking flag.void
setVectorsVisible
(TrackerPanel panel, boolean visible) Sets the visibility of the vectors on the specified tracker panel.toString()
Overrides Object toString method.Methods inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
addFixedItem, addFootprint, addListener, addListenerNCF, addPanelEvents, addStepListener, addTextColumn, assembleMenu, autoMarkAt, clearColumns, convertTextToDataColumn, createAllVariables, createWarningDialog, delete, delete, deleteStep, dispose, 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, getStep, getSteps, getStepSizeWarningDialog, getTableViews, getTargetDescription, getTargetIndex, getTextColumnEntry, getTextColumnNames, getTrack, getTrailLength, getValues, getVarFormatPattern, getVariableDimensions, getVariablesFromFormatterDisplayName, getX, getXMax, getXMin, getY, getYMax, getYMin, initialize, invalidateData, isAttached, isAutoAdvance, isAutoTrackable, isAutoTrackable, 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, setAnglesInRadians, setAutoAdvance, setColor, setColorToDefault, setDefaultNameAndColor, setDescription, setEnabled, setFixedPosition, setFontLevel, setFootprint, setFootprint, setFootprints, setFootprints, setFormatPattern, setInitialFormatPatterns, setMarkByDefault, setName, setProperty, setTargetIndex, setTargetIndex, setTargetIndex, setTextColumnEntry, setTrackerPanel, setTrailLength, setTrailVisible, 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
-
formatVariables
-
fieldVariables
-
formatMap
-
formatDescriptionMap
-
allVariables
-
tailsToOriginItem
-
labelsVisibleItem
-
visMap
-
-
Constructor Details
-
Vector
public Vector()Constructs a Vector.
-
-
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
-
createStep
Implements createStep. When creating a vector the coordinates define both the tail and tip position, but when re-marking an existing vector they define the tip position only.- 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 vector step with specified tail position and vector components.- Parameters:
n
- the frame numberx
- the tail x coordinate in image spacey
- the tail y coordinate in image spacexc
- the x component in image spaceyc
- the y component in image space- Returns:
- the new step
-
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
-
draw
Overrides TTrack draw method. -
setLocked
public void setLocked(boolean locked) Overrides TTrack setLocked method. -
propertyChange
Responds to property change events.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classTTrack
- Parameters:
e
- the property change event
-
setMarking
protected void setMarking(boolean marking) Description copied from class:TTrack
Sets the marking flag. Flag should be true when ready to be marked by user.- Overrides:
setMarking
in classTTrack
- Parameters:
marking
- true when marking
-
refreshData
Refreshes the data.- Overrides:
refreshData
in classTTrack
- Parameters:
data
- the DatasetManagertrackerPanel
- the tracker panel
-
findInteractive
Finds the interactive drawable object located at the specified pixel position.- 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 TPoint that is hit
-
setLabelsVisible
public void setLabelsVisible(boolean visible) Sets the visibility of force vector labels.- Parameters:
visible
-true
to show all labels
-
isLabelsVisible
public boolean isLabelsVisible()Gets the labels visibility.- Returns:
true
if labels are visible
-
setVectorsVisible
Sets the visibility of the vectors on the specified tracker panel.- Parameters:
panel
- the tracker panelvisible
-true
to show vectors
-
isVectorsVisible
Gets whether the vectors are visible on the specified panel.- Parameters:
trackerPanel
- the tracker panel- Returns:
true
if positions are visible
-
getMenu
Overrides TTrack getMenu method. -
getToolbarTrackComponents
Overrides TTrack getToolbarTrackComponents method.- Overrides:
getToolbarTrackComponents
in classTTrack
- Parameters:
trackerPanel
- the tracker panel- Returns:
- the DataSetManager
-
getToolbarPointComponents
Overrides TTrack getToolbarPointComponents method.- Overrides:
getToolbarPointComponents
in classTTrack
- Parameters:
trackerPanel
- the tracker panelpoint
- the TPoint- Returns:
- a list of components
-
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.
-
getLoader
Returns an ObjectLoader to save and load data for this class.- Returns:
- the object loader
-