artisynth.core.workspace
Class RootModel

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.ComponentList<ModelComponent>
          extended by artisynth.core.modelbase.ModelBase
              extended by artisynth.core.modelbase.RenderableModelBase
                  extended by artisynth.core.workspace.RootModel
All Implemented Interfaces:
ComponentChangeListener, ComponentListView<ModelComponent>, CompositeComponent, HasState, IndexedComponentList, Model, ModelComponent, MutableCompositeComponent<ModelComponent>, ParameterizedClass, RenderableComponent, java.awt.event.ActionListener, java.lang.Cloneable, java.lang.Iterable<ModelComponent>, java.util.Collection<ModelComponent>, java.util.EventListener, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Disposable, ListView<ModelComponent>, Scannable
Direct Known Subclasses:
ArticulatedBeamBody, ArticulatedDemo, ArticulatedFem, AttachDemo, AttachedBeamDemo, BlockTest, CompliantConstraintDemo, ConstrainedParticle, CoupledSolveDemo, DoubleArmDemo, FallingSkull, Fem3dBlock, FemBeam3d, FemBeamMech, FemCollision, FemFrictionBeam, FemMuscleDemo, FemSingleTet, FemSkinDemo, FemSphere, FishDemo, FrameSpringDemo, HexFrame, HydrostatDemo, LaymanBowl, LaymanDemo, LockingDemo, LumbarSpringDemo, MassSpringDemo, MechModelCollide, MechModelDemo, MultiSpringDemo, MuscleArm, NetDemo, PlanarConnectorDemo, PointModel, PuddleDemo, QuadFishDemo, RigidBodyCollision, RigidBodyDemo, RigidTentacle, RollPitchJointDemo, SegmentedPlaneDemo, SheetDemo, SimpleCollide, SingleHex, SinglePyramid, SingleQuadhex, SingleQuadpyramid, SingleQuadtet, SingleQuadwedge, SingleTet, SingleWedge, SkinDemo, SkullParticles, SphericalJointDemo, SpongeDemo, SpringMeshDemo

public class RootModel
extends RenderableModelBase
implements Disposable, java.awt.event.ActionListener

RootModel is the top-most model of an ArtiSynth model hierarchy. It contains a list of models, plus a number of other workspace components such as probes, controller, monitors, and control panels.


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.CompositeComponent
CompositeComponent.NavpanelDisplay
 
Field Summary
static PropertyList myProps
           
static boolean testSaveAndRestoreState
           
 
Fields inherited from class artisynth.core.modelbase.ComponentList
DEFAULT_NAVPANEL_DISPLAY
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
RootModel()
          Empty constructor, for creating a basic class instance
RootModel(java.lang.String name)
          Constructor used to build the model
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          By default, this method does nothing.
 WayPoint addBreakPoint(double t)
           
 void addComponentChangeListener(ComponentChangeListener l)
           
 void addController(Controller controller)
           
 void addController(Controller controller, Model model)
           
 void addControlPanel(ControlPanel panel)
           
 void addControlPanel(ControlPanel panel, int idx)
           
 void addInputProbe(Probe probe)
           
 void addInputProbe(Probe probe, int idx)
           
 void addModel(Model model)
           
 void addMonitor(Monitor monitor)
           
 void addMonitor(Monitor monitor, Model model)
           
 void addOutputProbe(Probe probe)
           
 void addOutputProbe(Probe probe, int idx)
           
 GLRenderableHolder addRenderable(GLRenderable renderable)
           
 void addRenderable(RenderableComponent comp)
           
 TracingProbe addTracingProbe(Tracable tracable, java.lang.String traceName, double startTime, double stopTime)
          Convenience routine to add a tracing probe to this RootModel.
 WayPoint addWayPoint(double t)
           
 void addWayPoint(WayPoint way)
           
 StepAdjustment advance(double t0, double t1, int flags)
          Advances this object from time t0 to time t1.
 void applyControllers(java.util.List<Controller> list, double t0, double t1)
           
 void applyInputProbes(java.util.List<Probe> list, double t)
           
 void applyMonitors(java.util.List<Monitor> list, double t0, double t1)
           
 void applyOutputProbes(java.util.List<Probe> list, double t1, artisynth.core.workspace.RootModel.ModelInfo info)
           
 void attach(DriverInterface driver)
          Attach this root model to a driver program
 void checkWrite(java.lang.String str)
           
 void clear()
           
 void clearRenderables()
           
 void clearTraces()
           
 void clearTracing(Tracable tr)
           
 void componentChanged(ComponentChangeEvent e)
          Notifies this composite component that a change has occured within one or more of its descendants.
 ComponentState createState(ComponentState prevState)
          Factory routine to create a state object for this component, which can then be used as an argument for HasState.setState(artisynth.core.modelbase.ComponentState) and HasState.getState(artisynth.core.modelbase.ComponentState).
 void detach(DriverInterface driver)
          Detach this root model from a driver program.
 void disableAllTracing()
           
 boolean disableTracing(Tracable tr)
           
 void dispose()
          Called when the model is discarded.
 void enableTracing(Tracable tr)
           
 java.lang.String getAbout()
          Returns a text string giving a short description of this model.
 boolean getAdaptiveStepping()
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 ComponentListView<Controller> getControllers()
           
 ComponentListView<ControlPanel> getControlPanels()
           
 javax.swing.JTabbedPane getControlPanelTabs()
           
 AxisAngle getDefaultViewOrientation()
          Obtains the default orientation that is used for viewing this model.
 void getInitialState(ComponentState newstate, ComponentState oldstate)
          Gets an initial state for this component and returns the value in state.
 ComponentList<Probe> getInputProbes()
           
 GLViewer getMainViewer()
           
 double getMinStepSize()
           
 java.lang.Object[] getModelMenuItems()
          Can be overriden by a subclass to generate a list of objects to be displayed under a "Model" menu in the main ArtiSynth frame.
 ComponentListView<Monitor> getMonitors()
           
 double getNextAdvanceTime(java.util.List<Probe> probes, double stepSize, double t0, double t1)
           
 int getNumTracables()
           
 RenderableComponentList<Probe> getOutputProbes()
           
static RootModel getRoot(ModelComponent comp)
          Find the most immediate RootModel, if any, that is an ancestor of a specified component.
 void getState(ComponentState state)
          Get the current state of this component.
 java.util.Collection<Tracable> getTraceSet()
           
 TracingProbe getTracingProbe(Tracable tr, java.lang.String propName)
           
 java.util.LinkedList<TracingProbe> getTracingProbes()
           
 Point3d getViewerCenter()
           
 Point3d getViewerEye()
           
 WayPoint getWayPoint(double t)
           
 boolean getWaypointChecking()
           
 WayPointProbe getWayPoints()
           
static boolean hasRoot(ModelComponent comp)
          Returns true if a specified component has a RootModel as an ancestor.
 boolean hasState()
          Returns true if this component has state.
 boolean hasTracingProbes()
           
 void initialize(double t)
          Causes this model to initialize itself at time t.
 boolean isCheckEnabled()
           
static boolean isFocusable()
           
 boolean isTracing(Tracable tr)
           
 ControlPanel loadControlPanel(java.lang.String filename)
           
 javax.swing.JMenuItem makeMenuItem(java.lang.String cmd, java.lang.String toolTip)
          Convenience method for creating menu items to be placed under the "Model" menu.
 void mergeAllControlPanels(boolean combine)
           
 void mergeControlPanel(boolean combine, ControlPanel panel)
           
 ComponentListView<Model> models()
           
 void notifyParentOfChange(ComponentChangeEvent e)
          Notifies the parent of this component (if any) of changes within in its descendants.
 void notifyStructureChanged(java.lang.Object comp)
           
 void postscan(java.util.Deque<ScanToken> tokens, CompositeComponent ancestor)
          Performs any required post-scanning for this component.
 void prerender(RenderList list)
          Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.
 void removeAllControllers()
           
 void removeAllControlPanels()
           
 void removeAllInputProbes()
           
 void removeAllModels()
           
 void removeAllMonitors()
           
 void removeAllOutputProbes()
           
 void removeAllWayPoints()
           
 boolean removeComponentChangeListener(ComponentChangeListener l)
           
 boolean removeController(Controller controller)
           
 boolean removeControlPanel(ControlPanel panel)
           
 boolean removeInputProbe(Probe probe)
           
 boolean removeModel(Model model)
           
 boolean removeMonitor(Monitor monitor)
           
 boolean removeOutputProbe(Probe probe)
           
 boolean removeRenderable(GLRenderable renderable)
           
 boolean removeRenderable(RenderableComponent comp)
           
 boolean removeWayPoint(WayPoint way)
           
 void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 RenderableComponentList<RenderableComponent> renderables()
           
 void requestStop()
          This is used by the scheduler to interrupts the current call to advance and cause state to be restored to that of the start time for the advance.
 void rerender()
           
 void scan(ReaderTokenizer rtok, java.lang.Object ref)
          Scans this element from a ReaderTokenizer.
 void setAdaptiveStepping(boolean enable)
           
 void setCheckEnabled(boolean enable)
           
 void setDefaultValues()
          Sets the attributes of this component to their default values.
 void setDefaultViewOrientation(AxisAngle R)
          Sets the default orientation that should be used for viewing this model.
static void setFocusable(boolean focusable)
           
 void setMainViewer(GLViewer v)
           
 void setMaxStepSize(double step)
          Sets the maximum step size by which this model should be advanced within a simulation loop.
 void setMinStepSize(double step)
           
 void setState(ComponentState state)
          Set the state of this component.
 void setTracingProbesVisible(boolean visible)
           
 void setViewerCenter(Point3d c)
           
 void setViewerEye(Point3d e)
           
 void setWaypointChecking(boolean enable)
           
 void updateBounds(Point3d pmin, Point3d pmax)
          Update the minimum and maximum points for this object.
 
Methods inherited from class artisynth.core.modelbase.RenderableModelBase
createRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, setRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelBase
copy, getInitialState, getMaxStepSize, hierarchyContainsReferences, preadvance, setInitialState
 
Methods inherited from class artisynth.core.modelbase.ComponentList
add, add, addAll, addComponents, addFixed, addNumbered, clone, contains, contains, containsAll, copy, ensureCapacity, findComponent, get, get, getByNumber, getChildren, getNavpanelDisplay, getNumberLimit, getShortName, getTypeParameter, hasChildren, hasParameterizedType, indexOf, isEmpty, iterator, nextComponentNumber, numComponents, remove, remove, removeAll, removeAll, removeComponents, retainAll, setNavpanelDisplay, setNumberingStartAtOne, setShortName, size, toArray, toArray, updateNameMap
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 
Methods inherited from interface artisynth.core.modelbase.ComponentListView
getName
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

testSaveAndRestoreState

public static boolean testSaveAndRestoreState

myProps

public static PropertyList myProps
Constructor Detail

RootModel

public RootModel()
Empty constructor, for creating a basic class instance


RootModel

public RootModel(java.lang.String name)
Constructor used to build the model

Parameters:
name - the name of the new model
Method Detail

setFocusable

public static void setFocusable(boolean focusable)

isFocusable

public static boolean isFocusable()

getAbout

public java.lang.String getAbout()
Returns a text string giving a short description of this model.

Returns:
text description of this model

setDefaultValues

public void setDefaultValues()
Description copied from class: ModelComponentBase
Sets the attributes of this component to their default values.


getAdaptiveStepping

public boolean getAdaptiveStepping()

setAdaptiveStepping

public void setAdaptiveStepping(boolean enable)

getMinStepSize

public double getMinStepSize()

setMinStepSize

public void setMinStepSize(double step)

setMaxStepSize

public void setMaxStepSize(double step)
Description copied from class: ModelBase
Sets the maximum step size by which this model should be advanced within a simulation loop.

Overrides:
setMaxStepSize in class ModelBase
Parameters:
step - maximum step size (seconds)

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Overrides:
getAllPropertyInfo in class RenderableModelBase
Returns:
static information for all exported properties

models

public ComponentListView<Model> models()

addModel

public void addModel(Model model)

removeModel

public boolean removeModel(Model model)

removeAllModels

public void removeAllModels()

addMonitor

public void addMonitor(Monitor monitor)

addController

public void addController(Controller controller)

addRenderable

public GLRenderableHolder addRenderable(GLRenderable renderable)

removeRenderable

public boolean removeRenderable(GLRenderable renderable)

addRenderable

public void addRenderable(RenderableComponent comp)

removeRenderable

public boolean removeRenderable(RenderableComponent comp)

clearRenderables

public void clearRenderables()

renderables

public RenderableComponentList<RenderableComponent> renderables()

getMainViewer

public GLViewer getMainViewer()

setMainViewer

public void setMainViewer(GLViewer v)

setViewerCenter

public void setViewerCenter(Point3d c)

getViewerCenter

public Point3d getViewerCenter()

setViewerEye

public void setViewerEye(Point3d e)

getViewerEye

public Point3d getViewerEye()

getDefaultViewOrientation

public AxisAngle getDefaultViewOrientation()
Obtains the default orientation that is used for viewing this model.

Returns:
default rotational transform from eye to world coordinates

setDefaultViewOrientation

public void setDefaultViewOrientation(AxisAngle R)
Sets the default orientation that should be used for viewing this model.

Parameters:
R - rotational transform from eye to world coordinates

addMonitor

public void addMonitor(Monitor monitor,
                       Model model)

removeMonitor

public boolean removeMonitor(Monitor monitor)

removeAllMonitors

public void removeAllMonitors()

getMonitors

public ComponentListView<Monitor> getMonitors()

addController

public void addController(Controller controller,
                          Model model)

removeController

public boolean removeController(Controller controller)

removeAllControllers

public void removeAllControllers()

getControllers

public ComponentListView<Controller> getControllers()

addControlPanel

public void addControlPanel(ControlPanel panel)

addControlPanel

public void addControlPanel(ControlPanel panel,
                            int idx)

removeControlPanel

public boolean removeControlPanel(ControlPanel panel)

removeAllControlPanels

public void removeAllControlPanels()

getControlPanels

public ComponentListView<ControlPanel> getControlPanels()

loadControlPanel

public ControlPanel loadControlPanel(java.lang.String filename)

addInputProbe

public void addInputProbe(Probe probe)

addInputProbe

public void addInputProbe(Probe probe,
                          int idx)

removeInputProbe

public boolean removeInputProbe(Probe probe)

removeAllInputProbes

public void removeAllInputProbes()

getInputProbes

public ComponentList<Probe> getInputProbes()

addTracingProbe

public TracingProbe addTracingProbe(Tracable tracable,
                                    java.lang.String traceName,
                                    double startTime,
                                    double stopTime)
Convenience routine to add a tracing probe to this RootModel. The probe is created for a specified trace of a Tracable component. Start and stop times are given in seconds. The probe's update interval is set to the maximum step size of this RootModel, and the render interval is set to 50 msec.

Parameters:
tracable - component to be traced
traceName - name of the trace
startTime - start time (seconds)
stopTime - stop time (seconds)
Returns:
created tracing probe

addOutputProbe

public void addOutputProbe(Probe probe)

addOutputProbe

public void addOutputProbe(Probe probe,
                           int idx)

removeOutputProbe

public boolean removeOutputProbe(Probe probe)

removeAllOutputProbes

public void removeAllOutputProbes()

getOutputProbes

public RenderableComponentList<Probe> getOutputProbes()

hasTracingProbes

public boolean hasTracingProbes()

setTracingProbesVisible

public void setTracingProbesVisible(boolean visible)

getWayPoints

public WayPointProbe getWayPoints()

addWayPoint

public void addWayPoint(WayPoint way)

addWayPoint

public WayPoint addWayPoint(double t)

addBreakPoint

public WayPoint addBreakPoint(double t)

removeWayPoint

public boolean removeWayPoint(WayPoint way)

getWayPoint

public WayPoint getWayPoint(double t)

removeAllWayPoints

public void removeAllWayPoints()

getTracingProbe

public TracingProbe getTracingProbe(Tracable tr,
                                    java.lang.String propName)

enableTracing

public void enableTracing(Tracable tr)

isTracing

public boolean isTracing(Tracable tr)

disableTracing

public boolean disableTracing(Tracable tr)

clearTracing

public void clearTracing(Tracable tr)

getTracingProbes

public java.util.LinkedList<TracingProbe> getTracingProbes()

disableAllTracing

public void disableAllTracing()

clearTraces

public void clearTraces()

getTraceSet

public java.util.Collection<Tracable> getTraceSet()

getNumTracables

public int getNumTracables()

clear

public void clear()
Specified by:
clear in interface java.util.Collection<ModelComponent>
Overrides:
clear in class ComponentList<ModelComponent>

prerender

public void prerender(RenderList list)
Description copied from interface: GLRenderable
Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.

Specified by:
prerender in interface GLRenderable
Overrides:
prerender in class RenderableModelBase

updateBounds

public void updateBounds(Point3d pmin,
                         Point3d pmax)
Description copied from interface: GLRenderable
Update the minimum and maximum points for this object. In an x-y-z coordinate system with x directed to the right and y directed upwards, the minimum and maximum points can be thought of as defining the left-lower-far and right-upper-near corners of a bounding cube. This method should only reduce the elements of the minimum point and increase the elements of the maximum point, since it may be used as part of an iteration to determine the bounding cube for several different objects.

Specified by:
updateBounds in interface GLRenderable
Overrides:
updateBounds in class RenderableModelBase
Parameters:
pmin - minimum point
pmax - maximum point

render

public void render(GLRenderer renderer,
                   int flags)
Description copied from interface: GLRenderable
Render this object using Open GL via the JOGL.

Specified by:
render in interface GLRenderable
Specified by:
render in class RenderableModelBase
Parameters:
renderer - renderer object which is used to perform the rendering. Provides pointers to GL and GLU, along with helper functions.
flags - supplies flags that may be used to control different aspects of the rendering. Flags are defined in GLRenderer and currently include GLRenderer.SELECTED, GLRenderer.VERTEX_COLORING, GLRenderer.HSV_COLOR_INTERPOLATION, GLRenderer.SORT_FACES, and GLRenderer.CLEAR_MESH_DISPLAY_LISTS.

rerender

public void rerender()

initialize

public void initialize(double t)
Causes this model to initialize itself at time t. This method will be called at the very beginning of the simulation (with t = 0), or immediately after the model's state has been reset using HasState.setState(artisynth.core.modelbase.ComponentState), in which case t may have an arbitrary value.

Specified by:
initialize in interface Model
Overrides:
initialize in class ModelBase
Parameters:
t - initialization time (seconds)

attach

public void attach(DriverInterface driver)
Attach this root model to a driver program

Parameters:
driver - Interface giving access to the frame and viewer

detach

public void detach(DriverInterface driver)
Detach this root model from a driver program.


addComponentChangeListener

public void addComponentChangeListener(ComponentChangeListener l)

removeComponentChangeListener

public boolean removeComponentChangeListener(ComponentChangeListener l)

componentChanged

public void componentChanged(ComponentChangeEvent e)
Description copied from class: ComponentList
Notifies this composite component that a change has occured within one or more of its descendants. When this occurs, the composite may need to invalidate cached information that depends on the descendants.

This method should propagate the notification up the component hierarchy by calling notifyParentOfChange.

Specified by:
componentChanged in interface ComponentChangeListener
Specified by:
componentChanged in interface CompositeComponent
Overrides:
componentChanged in class ComponentList<ModelComponent>
Parameters:
e - optional argument giving specific information about the change

notifyStructureChanged

public void notifyStructureChanged(java.lang.Object comp)

hasState

public boolean hasState()
Description copied from interface: ModelComponent
Returns true if this component has state. Structure change events involving components that have state will cause the current state history of of the system to be cleared.

Specified by:
hasState in interface ModelComponent
Overrides:
hasState in class ModelComponentBase

createState

public ComponentState createState(ComponentState prevState)
Factory routine to create a state object for this component, which can then be used as an argument for HasState.setState(artisynth.core.modelbase.ComponentState) and HasState.getState(artisynth.core.modelbase.ComponentState). The state object does not have to be set to the component's current state. If the component does not have any state information, this method should return an instance of EmptyState.

Specified by:
createState in interface HasState
Overrides:
createState in class ModelBase
Parameters:
prevState - If non-null, supplies a previous state that was created by this component and which can be used to provide pre-sizing hints.
Returns:
new object for storing this component's state

setState

public void setState(ComponentState state)
Set the state of this component.

Specified by:
setState in interface HasState
Overrides:
setState in class ModelBase
Parameters:
state - state to be copied

getState

public void getState(ComponentState state)
Get the current state of this component.

Specified by:
getState in interface HasState
Overrides:
getState in class ModelBase
Parameters:
state - receives the state information

getInitialState

public void getInitialState(ComponentState newstate,
                            ComponentState oldstate)
Description copied from interface: HasState
Gets an initial state for this component and returns the value in state. If prevstate is non-null, then it is assumed to contain a previous initial state value returned by this method, and state should be set to be as consistent with this previous state as possible. For example, suppose that this component currently contains subcomponents A, B, and C, while the prevstate contains the state from a previous time when it had components B, C, and D. Then state should contain substate values for B and C that are taken from prevstate. To facilitate this, the information returned in state should contain additional information such as the identities of all the (current) sub-components.

Specified by:
getInitialState in interface HasState
Overrides:
getInitialState in class ModelBase
Parameters:
newstate - receives the state information
oldstate - previous state information; may be null.

advance

public StepAdjustment advance(double t0,
                              double t1,
                              int flags)
Description copied from class: ModelBase
Advances this object from time t0 to time t1.

If the method determines that the step size should be reduced, it can return a StepAdjustment object indicating the recommended reduction. Otherwise, the method may return null

Specified by:
advance in interface Model
Specified by:
advance in class ModelBase
Parameters:
t0 - current time (seconds)
t1 - new time to advance to (seconds)
flags - reserved for future use
Returns:
null, or a step adjustment recommendation

applyInputProbes

public void applyInputProbes(java.util.List<Probe> list,
                             double t)

applyControllers

public void applyControllers(java.util.List<Controller> list,
                             double t0,
                             double t1)

applyMonitors

public void applyMonitors(java.util.List<Monitor> list,
                          double t0,
                          double t1)

applyOutputProbes

public void applyOutputProbes(java.util.List<Probe> list,
                              double t1,
                              artisynth.core.workspace.RootModel.ModelInfo info)

getNextAdvanceTime

public double getNextAdvanceTime(java.util.List<Probe> probes,
                                 double stepSize,
                                 double t0,
                                 double t1)

requestStop

public void requestStop()
This is used by the scheduler to interrupts the current call to advance and cause state to be restored to that of the start time for the advance.


scan

public void scan(ReaderTokenizer rtok,
                 java.lang.Object ref)
          throws java.io.IOException
Scans this element from a ReaderTokenizer. The expected text format is assumed to be compatible with that produced by write.

Specified by:
scan in interface ModelComponent
Specified by:
scan in interface Scannable
Overrides:
scan in class ComponentList<ModelComponent>
Parameters:
rtok - Tokenizer from which to scan the element
ref - optional reference object which can be used for resolving references to other objects
Throws:
java.io.IOException - if an I/O or formatting error occured

postscan

public void postscan(java.util.Deque<ScanToken> tokens,
                     CompositeComponent ancestor)
              throws java.io.IOException
Performs any required post-scanning for this component. This involves handling any information whose processing was deferred during the scan() method and stored in the token queue. The most common use of this method is to resolve the paths of component references, which may not have been created at the time of the initial scan() call.

Specified by:
postscan in interface ModelComponent
Overrides:
postscan in class ComponentList<ModelComponent>
Parameters:
tokens - token information that was stored during scan().
ancestor - ancestor component with respect to which reference component paths are defined.
Throws:
java.io.IOException

dispose

public void dispose()
Description copied from class: ModelBase
Called when the model is discarded. Disposes of any resources used.

Specified by:
dispose in interface Model
Specified by:
dispose in interface Disposable
Overrides:
dispose in class ModelBase

setWaypointChecking

public void setWaypointChecking(boolean enable)

getWaypointChecking

public boolean getWaypointChecking()

isCheckEnabled

public boolean isCheckEnabled()

setCheckEnabled

public void setCheckEnabled(boolean enable)

checkWrite

public void checkWrite(java.lang.String str)

mergeAllControlPanels

public void mergeAllControlPanels(boolean combine)

getControlPanelTabs

public javax.swing.JTabbedPane getControlPanelTabs()

mergeControlPanel

public void mergeControlPanel(boolean combine,
                              ControlPanel panel)

makeMenuItem

public javax.swing.JMenuItem makeMenuItem(java.lang.String cmd,
                                          java.lang.String toolTip)
Convenience method for creating menu items to be placed under the "Model" menu. Creates and returns a JMenuItem with name and command text as specified by cmd, this RootModel as an ActionListener, and optional tool-tip text as specified by toolTip.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
By default, this method does nothing. Subclasses should override this to handle events, such as those generated from menu items such those generated by getModelMenuItems().

Specified by:
actionPerformed in interface java.awt.event.ActionListener

getModelMenuItems

public java.lang.Object[] getModelMenuItems()
Can be overriden by a subclass to generate a list of objects to be displayed under a "Model" menu in the main ArtiSynth frame. If this method returns null (the default behavior), that is taken to indicate that this RootModel has no application menu items and no "Model" menu should be created. Otherwise, the method should return an array of Objects, which should be items capable of being added to a JMenu, including Component, JMenuItem, and String.

Returns:
a list of components to be added to the ArtiSynth "Model" menu, or null if no such menu is to be created.
See Also:
makeMenuItem(java.lang.String, java.lang.String)

notifyParentOfChange

public void notifyParentOfChange(ComponentChangeEvent e)
Notifies the parent of this component (if any) of changes within in its descendants. This is done by calling the parent's componentChanged method.

Specified by:
notifyParentOfChange in interface ModelComponent
Overrides:
notifyParentOfChange in class ModelComponentBase
Parameters:
e - optional argument giving specific information about the change

getRoot

public static RootModel getRoot(ModelComponent comp)
Find the most immediate RootModel, if any, that is an ancestor of a specified component.

Parameters:
comp - component to seek RootModel for
Returns:
Most immediate RootModel ancestor, or null

hasRoot

public static boolean hasRoot(ModelComponent comp)
Returns true if a specified component has a RootModel as an ancestor.

Returns:
true if comp has a RootModel as an ancestor.