|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.cabrillo.tracker.TTrack
org.opensourcephysics.cabrillo.tracker.Vector
org.opensourcephysics.cabrillo.tracker.VectorSum
public class VectorSum
A VectorSum draws a series of VectorSteps that represent a vector sum of its set of vectors.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.TTrack |
|---|
TTrack.StepArray |
| Field Summary | |
|---|---|
protected VectorSumInspector |
inspector
|
protected javax.swing.JMenuItem |
inspectorItem
|
protected java.util.Map<java.lang.Integer,TPoint> |
tails
|
protected java.util.ArrayList<java.lang.String> |
vectorNames
|
protected Vector[] |
vectors
|
| Fields inherited from class org.opensourcephysics.cabrillo.tracker.Vector |
|---|
dataDescriptions, labelsVisibleItem, tailsToOriginItem, visMap |
| Constructor Summary | |
|---|---|
VectorSum()
Constructs an empty VectorSum. |
|
VectorSum(Vector[] vectors)
Constructs a VectorSum with specified vectors. |
|
| Method Summary | |
|---|---|
void |
addVector(Vector vec)
Adds a vector to this sum. |
protected void |
cleanup()
Cleans up associated resources when this track is deleted or cleared. |
boolean |
contains(Vector vec)
Determines if the specified vector is in this sum. |
Step |
createStep(int n,
double x,
double y,
double xc,
double yc)
Overrides vector method. |
void |
draw(DrawingPanel panel,
java.awt.Graphics _g)
Overrides Vector draw method. |
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix)
Finds the interactive drawable object located at the specified pixel position. |
VectorSumInspector |
getInspector()
Gets the vector sum inspector. |
static XML.ObjectLoader |
getLoader()
Returns an ObjectLoader to save and load data for this class. |
javax.swing.JMenu |
getMenu(TrackerPanel trackerPanel)
Returns a menu with items that control this track. |
java.util.ArrayList<java.awt.Component> |
getToolbarPointComponents(TrackerPanel trackerPanel,
TPoint point)
Overrides TTrack getToolbarPointComponents method. |
Vector[] |
getVectors()
Gets the array of vectors in this sum. |
boolean |
isDependent()
Overrides TTrack isDependent method to return true. |
boolean |
isStepComplete(int n)
Overrides TTrack isStepComplete method. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events. |
void |
removeVector(Vector vec)
Removes a vector from this sum. |
void |
setLocked(boolean locked)
Overrides TTrack setLocked method. |
java.lang.String |
toString()
Overrides Object toString method. |
| Methods inherited from class org.opensourcephysics.cabrillo.tracker.Vector |
|---|
createStep, getDataDescription, getDefaultAutoTrackerIndex, getFootprintLength, getStepLength, getToolbarTrackComponents, isLabelsVisible, isVectorsVisible, refreshData, setLabelsVisible, setVectorsVisible |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Vector[] vectors
protected java.util.ArrayList<java.lang.String> vectorNames
protected javax.swing.JMenuItem inspectorItem
protected java.util.Map<java.lang.Integer,TPoint> tails
protected VectorSumInspector inspector
| Constructor Detail |
|---|
public VectorSum()
public VectorSum(Vector[] vectors)
vectors - an array of vectors| Method Detail |
|---|
public void draw(DrawingPanel panel,
java.awt.Graphics _g)
draw in interface Drawabledraw in class Vectorpanel - the drawing panel requesting the drawing_g - the graphics context on which to draw
public Interactive findInteractive(DrawingPanel panel,
int xpix,
int ypix)
findInteractive in interface InteractivefindInteractive in class Vectorpanel - the drawing panelxpix - the x pixel position on the panelypix - the y pixel position on the panel
public void addVector(Vector vec)
vec - the vectorpublic void removeVector(Vector vec)
vec - the vectorpublic Vector[] getVectors()
public boolean contains(Vector vec)
vec - the vector
true if vector is in this sum
public Step createStep(int n,
double x,
double y,
double xc,
double yc)
createStep in class Vectorn - the frame numberx - the tail x coordinate in image spacey - the tail y coordinate in image spacexc - ignoredyc - ignored
public void setLocked(boolean locked)
setLocked in class Vectorlocked - ignoredpublic boolean isStepComplete(int n)
isStepComplete in class Vectorn - the frame number
true always since sum gets data from vectorspublic boolean isDependent()
isDependent in class TTracktrue since sum is dependent on its vectorspublic void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class Vectore - the property change eventprotected void cleanup()
cleanup in class TTrackpublic javax.swing.JMenu getMenu(TrackerPanel trackerPanel)
getMenu in class VectortrackerPanel - the tracker panel
public java.util.ArrayList<java.awt.Component> getToolbarPointComponents(TrackerPanel trackerPanel,
TPoint point)
getToolbarPointComponents in class VectortrackerPanel - the tracker panelpoint - the TPoint
public java.lang.String toString()
toString in class Vectorpublic static XML.ObjectLoader getLoader()
public VectorSumInspector getInspector()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||