|
|||||||||
| 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.PointMass
org.opensourcephysics.cabrillo.tracker.ParticleModel
public abstract class ParticleModel
A ParticleModel is a point mass whose positions are determined by a model.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.TTrack |
|---|
TTrack.StepArray |
| Field Summary | |
|---|---|
protected double |
dt
|
protected int |
endFrame
|
protected UserFunctionEditor |
functionEditor
|
protected ModelFunctionPanel |
functionPanel
|
protected FunctionTool |
inspector
|
protected int |
inspectorH
|
protected int |
inspectorX
|
protected int |
inspectorY
|
protected boolean |
invalidWarningShown
|
protected int |
lastValidFrame
|
protected static boolean |
loading
|
protected static java.awt.geom.Point2D |
nan
|
protected double[] |
prevX
|
protected double[] |
prevY
|
protected boolean |
refreshDerivsLater
|
protected boolean |
refreshing
|
protected boolean |
refreshStepsLater
|
protected boolean |
showInspector
|
protected int |
startFrame
|
protected boolean |
startFrameUndefined
|
protected double |
t0
|
protected double |
time
|
protected static java.text.NumberFormat |
timeFormat
|
protected TPoint |
tracePt
|
protected static int |
tracePtsPerStep
|
protected double[] |
traceX
|
protected double[] |
traceY
|
protected static double |
xLimit
|
protected static double |
yLimit
|
| Fields inherited from class org.opensourcephysics.cabrillo.tracker.PointMass |
|---|
aAtOrigin, accelerationMenu, accelFootprintMenu, aDeriv, aDerivSpill, aFootprint, aFootprints, aMap, aTailsToOriginItem, aTailsToPositionItem, autotrackItem, aVisibleItem, aVisibleOnAll, aVisMap, dataDescriptions, derivData, mass, massField, massLabel, mSeparator, params, positionFootprintMenu, trace, traceStroke, traceVisible, validData, vAtOrigin, vDeriv, vDerivSpill, velocFootprintMenu, velocityMenu, vFootprint, vFootprints, vMap, vTailsToOriginItem, vTailsToPositionItem, vVisibleItem, vVisibleOnAll, vVisMap, xData, xVisibleOnAll, xVisMap, yData |
| Constructor Summary | |
|---|---|
ParticleModel()
Constructs a ParticleModel. |
|
| Method Summary | |
|---|---|
protected void |
cleanup()
Cleans up associated resources when this track is deleted or cleared. |
protected void |
createMassAndTimeParameters()
This adds the mass and initial time parameters to the function panel. |
void |
delete()
Removes this particle from all panels that draw it. |
void |
draw(DrawingPanel panel,
java.awt.Graphics _g)
Overrides PointMass draw method. |
void |
drawMe(DrawingPanel panel,
java.awt.Graphics _g)
Draws this without refreshing steps. |
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix)
Overrides PointMass findInteractive method. |
java.lang.String |
getDisplayName()
Gets a display name for this model. |
int |
getEndFrame()
Gets the end frame for this model. |
UserFunctionEditor |
getFunctionEditor()
Gets the function editor. |
InitialValueEditor |
getInitEditor()
Gets the initial value editor. |
double[] |
getInitialValues()
Gets the initial values. |
FunctionTool |
getInspector()
Gets the particle inspector. |
static XML.ObjectLoader |
getLoader()
Returns an ObjectLoader to save and load data for this class. |
double |
getMass()
Gets the mass. |
javax.swing.JMenu |
getMenu(TrackerPanel trackerPanel)
Returns a menu with items that control this track. |
protected ParticleModel[] |
getModels()
Gets the particle models associated with this model. |
ParamEditor |
getParamEditor()
Gets the parameter editor. |
int |
getStartFrame()
Gets the start frame for this model. |
java.util.ArrayList<java.awt.Component> |
getToolbarPointComponents(TrackerPanel trackerPanel,
TPoint point)
Overrides TTrack getToolbarPointComponents method. |
protected void |
initializeFunctionPanel()
Initializes the ModelFunctionPanel. |
protected boolean |
isAutoTrackable()
Determines if any point in this track is autotrackable. |
boolean |
isDependent()
Overrides TTrack method to report that this is a dependent track. |
protected boolean |
isModelsVisible()
|
boolean |
isStepComplete(int n)
Overrides TTrack isStepComplete method. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events. |
protected void |
refreshDerivsIfNeeded()
Refreshes the derivatives if they have not been refreshed in the refreshSteps() method (ie if the variable "refreshDerivs" is false). |
protected void |
refreshInitialTime()
Refreshes initial time parameter for this model. |
protected void |
refreshSteps()
Refreshes step positions. |
protected void |
reset()
Resets model parameters and sets position(s) for start frame. |
protected boolean |
restoreState(int frameNumber)
Restores the state to a previously saved state, if any. |
protected void |
saveState(int frameNumber)
Saves the current state. |
protected void |
setAnglesInRadians(boolean radians)
Sets the display format for angles. |
void |
setEndFrame(int n)
Sets the end frame for this model. |
void |
setLocked(boolean locked)
Overrides TTrack setLocked method. |
void |
setMass(double mass)
Sets the mass. |
void |
setName(java.lang.String name)
Sets the name. |
void |
setStartFrame(int n)
Sets the start frame for this model. |
protected void |
setTrackerPanel(TrackerPanel panel)
Identifies the controlling TrackerPanel for this track (by default, the first TrackerPanel that adds this track to its drawables). |
protected void |
trimSteps()
Trims all steps after endFrame. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static int tracePtsPerStep
protected static boolean loading
protected static java.awt.geom.Point2D nan
protected static double xLimit
protected static double yLimit
protected static java.text.NumberFormat timeFormat
protected FunctionTool inspector
protected ModelFunctionPanel functionPanel
protected UserFunctionEditor functionEditor
protected int inspectorX
protected int inspectorY
protected int inspectorH
protected boolean showInspector
protected boolean refreshing
protected double[] traceX
protected double[] traceY
protected double[] prevX
protected double[] prevY
protected TPoint tracePt
protected int lastValidFrame
protected double t0
protected double dt
protected double time
protected boolean refreshDerivsLater
protected boolean refreshStepsLater
protected boolean invalidWarningShown
protected boolean startFrameUndefined
protected int startFrame
protected int endFrame
| Constructor Detail |
|---|
public ParticleModel()
| Method Detail |
|---|
public void draw(DrawingPanel panel,
java.awt.Graphics _g)
draw in interface Drawabledraw in class PointMasspanel - the drawing panel requesting the drawing_g - the graphics context on which to draw
public void drawMe(DrawingPanel panel,
java.awt.Graphics _g)
panel - the drawing panel requesting the drawing_g - the graphics context on which to drawpublic void delete()
delete in class TTrackpublic void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class PointMasse - the property change eventpublic double getMass()
getMass in class PointMasspublic void setMass(double mass)
setMass in class PointMassmass - the masspublic void setName(java.lang.String name)
setName in class TTrackname - the namepublic java.lang.String getDisplayName()
protected boolean isAutoTrackable()
isAutoTrackable in class PointMass
public Interactive findInteractive(DrawingPanel panel,
int xpix,
int ypix)
findInteractive in interface InteractivefindInteractive in class PointMasspanel - the drawing panelxpix - the x pixel position on the panelypix - the y pixel position on the panel
public void setLocked(boolean locked)
setLocked in class TTracklocked - ignoredpublic boolean isDependent()
isDependent in class TTracktrue if this track is dependentpublic boolean isStepComplete(int n)
isStepComplete in class PointMassn - the frame number
true always since gets data from modelpublic javax.swing.JMenu getMenu(TrackerPanel trackerPanel)
getMenu in class PointMasstrackerPanel - the tracker panel
public java.util.ArrayList<java.awt.Component> getToolbarPointComponents(TrackerPanel trackerPanel,
TPoint point)
getToolbarPointComponents in class PointMasstrackerPanel - the tracker panelpoint - the TPoint
public void setStartFrame(int n)
n - the desired start framepublic int getStartFrame()
public void setEndFrame(int n)
n - the desired end framepublic int getEndFrame()
protected void setTrackerPanel(TrackerPanel panel)
setTrackerPanel in class TTrackpanel - the TrackerPanelprotected void setAnglesInRadians(boolean radians)
setAnglesInRadians in class TTrackradians - true for radians, false for degreesprotected void cleanup()
cleanup in class PointMassprotected void reset()
protected ParticleModel[] getModels()
protected boolean isModelsVisible()
protected void refreshInitialTime()
protected void refreshSteps()
protected void refreshDerivsIfNeeded()
protected void trimSteps()
protected void saveState(int frameNumber)
frameNumber - the frame numberprotected boolean restoreState(int frameNumber)
frameNumber - the frame number
public FunctionTool getInspector()
protected void initializeFunctionPanel()
protected void createMassAndTimeParameters()
public double[] getInitialValues()
public ParamEditor getParamEditor()
public InitialValueEditor getInitEditor()
public UserFunctionEditor getFunctionEditor()
public static XML.ObjectLoader getLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||