Class VectorSum
java.lang.Object
org.opensourcephysics.display.OSPRuntime.Supported
org.opensourcephysics.cabrillo.tracker.TTrack
org.opensourcephysics.cabrillo.tracker.Vector
org.opensourcephysics.cabrillo.tracker.VectorSum
- All Implemented Interfaces:
PropertyChangeListener,EventListener,Drawable,Interactive,Measurable,Trackable
A VectorSum draws a series of VectorSteps that represent a
vector sum of its set of vectors.
- Author:
- Douglas Brown
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.Vector
Vector.FrameDataNested 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 VectorSumInspectorprotected JMenuItemprotected Vector[]Fields inherited from class org.opensourcephysics.cabrillo.tracker.Vector
allVariables, dataVariables, fieldVariables, formatDescriptionMap, formatMap, formatVariables, labelsVisibleItem, tailsToOriginItem, visMapFields 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 TypeMethodDescriptionvoidAdds a vector to this sum.booleanDetermines if the specified vector is in this sum.createStep(int n, double x, double y, double xc, double yc) Overrides vector method.voiddispose()Cleans up associated resources when this track is deleted or cleared.voiddraw(DrawingPanel panel, Graphics _g) Overrides Vector draw method.findInteractive(DrawingPanel panel, int xpix, int ypix) Finds the interactive drawable object located at the specified pixel position.Gets the vector sum inspector.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.getToolbarPointComponents(TrackerPanel trackerPanel, TPoint point) Overrides TTrack getToolbarPointComponents method.Vector[]Gets the array of vectors in this sum.voidinitialize(TrackerPanel panel) Finish up any unfinished loading business that for whatever reason was not finished upon loading a track.booleanOverrides TTrack isDependent method to return true.booleanisStepComplete(int n) Overrides TTrack isStepComplete method.voidResponds to property change events.voidremoveVector(Vector vec) Removes a vector from this sum.voidsetFontLevel(int level) Sets the font level.voidsetLocked(boolean locked) Overrides TTrack setLocked method.voidsetTrackerPanel(TrackerPanel panel) Adds events for TrackerPanel.toString()Overrides Object toString method.Methods inherited from class org.opensourcephysics.cabrillo.tracker.Vector
createStep, getBaseType, getFootprintLength, getFormatDescMap, getFormatMap, getFormatVariables, getNumberFields, getStepLength, getToolbarTrackComponents, getVarDimsImpl, isLabelsVisible, isVectorsVisible, refreshData, setLabelsVisible, setMarking, setVectorsVisibleMethods inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
addFixedItem, addFootprint, addListener, addListenerNCF, addPanelEvents, addStepListener, addTextColumn, assembleMenu, autoMarkAt, clearColumns, convertTextToDataColumn, createAllVariables, createWarningDialog, delete, delete, deleteStep, 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, invalidateData, isAttached, isAutoAdvance, isAutoTrackable, isAutoTrackable, isDataValid, isEmpty, isEnabled, isFullyAttached, isLocked, isMarkByDefault, isMarking, isMeasured, 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, setFootprint, setFootprint, setFootprints, setFootprints, setFormatPattern, setInitialFormatPatterns, setMarkByDefault, setName, setProperty, setTargetIndex, setTargetIndex, setTargetIndex, setTextColumnEntry, setTrailLength, setTrailVisible, 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
-
vectors
-
vectorNames
-
inspectorItem
-
tails
-
inspector
-
-
Constructor Details
-
VectorSum
public VectorSum()Constructs an empty VectorSum. -
VectorSum
Constructs a VectorSum with specified vectors.- Parameters:
vectors- an array of vectors
-
-
Method Details
-
draw
Overrides Vector draw method. -
initialize
Description copied from class:TTrackFinish up any unfinished loading business that for whatever reason was not finished upon loading a track. For example, adding masses to a center-of-mass system, or adding particles to a DynamicSystem.- Overrides:
initializein classTTrack
-
findInteractive
Finds the interactive drawable object located at the specified pixel position.- Specified by:
findInteractivein interfaceInteractive- Overrides:
findInteractivein classVector- 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
-
addVector
Adds a vector to this sum.- Parameters:
vec- the vector
-
removeVector
Removes a vector from this sum.- Parameters:
vec- the vector
-
getVectors
Gets the array of vectors in this sum.- Returns:
- a shallow clone of the vectors array
-
contains
Determines if the specified vector is in this sum.- Parameters:
vec- the vector- Returns:
trueif vector is in this sum
-
createStep
Overrides vector method. Saves the specified tail position, then updates the step.- Overrides:
createStepin classVector- Parameters:
n- the frame numberx- the tail x coordinate in image spacey- the tail y coordinate in image spacexc- ignoredyc- ignored- Returns:
- the new step
-
setFontLevel
public void setFontLevel(int level) Description copied from class:TTrackSets the font level.- Overrides:
setFontLevelin classTTrack- Parameters:
level- the desired font level
-
setLocked
public void setLocked(boolean locked) Overrides TTrack setLocked method. VectorSum is always locked. -
isStepComplete
public boolean isStepComplete(int n) Overrides TTrack isStepComplete method. Always returns true.- Overrides:
isStepCompletein classTTrack- Parameters:
n- the frame number- Returns:
truealways since sum gets data from vectors
-
isDependent
public boolean isDependent()Overrides TTrack isDependent method to return true.- Overrides:
isDependentin classTTrack- Returns:
truesince sum is dependent on its vectors
-
setTrackerPanel
Adds events for TrackerPanel.- Overrides:
setTrackerPanelin classTTrack- Parameters:
panel- the new TrackerPanel
-
propertyChange
Responds to property change events.- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classVector- Parameters:
e- the property change event
-
dispose
public void dispose()Cleans up associated resources when this track is deleted or cleared. -
getMenu
Returns a menu with items that control this track. -
getToolbarPointComponents
Overrides TTrack getToolbarPointComponents method.- Overrides:
getToolbarPointComponentsin classVector- Parameters:
trackerPanel- the tracker panelpoint- the TPoint- Returns:
- a list of components
-
toString
Overrides Object toString method. -
getLoader
Returns an ObjectLoader to save and load data for this class.- Returns:
- the object loader
-
getInspector
Gets the vector sum inspector.- Returns:
- the vector sum inspector
-