public abstract class ModelBase extends ComponentList<ModelComponent> implements Model, HasMenuItems, java.awt.event.ActionListener
ModelComponent.NavpanelVisibilityCompositeComponent.NavpanelDisplay| Modifier and Type | Field and Description | 
|---|---|
| static PropertyList | myProps | 
DEFAULT_NAVPANEL_DISPLAYenforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames| Constructor and Description | 
|---|
| ModelBase() | 
| ModelBase(java.lang.String name) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | actionPerformed(java.awt.event.ActionEvent event)By default, this method does nothing. | 
| abstract StepAdjustment | advance(double t0,
       double t1,
       int flags)Advances this object from time t0 to time t1. | 
| ModelBase | copy(java.util.Map<ModelComponent,ModelComponent> copyMap,
    int flags) | 
| 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)andHasState.getState(artisynth.core.modelbase.ComponentState). | 
| void | dispose()Called when the model is discarded. | 
| PropertyList | getAllPropertyInfo()Returns a list giving static information about all properties exported by
 this object. | 
| void | getInitialState(ComponentState state) | 
| void | getInitialState(ComponentState newstate,
               ComponentState oldstate)Gets an initial state for this component and returns the value in
  state. | 
| double | getMaxStepSize()Returns the maximum step size by which this model should be advanced
 within a simulation loop. | 
| boolean | getMenuItems(java.util.List<java.lang.Object> items)Returns objects to be displayed under a "Model" menu in the main
 ArtiSynth frame. | 
| void | getState(ComponentState state)Get the current state of this component. | 
| boolean | hierarchyContainsReferences()Returns true if the component hierarchy formed by this component and its
 descendents is closed with respect to references. | 
| void | initialize(double t)Causes this model to initialize itself at time t. | 
| StepAdjustment | preadvance(double t0,
          double t1,
          int flags)Prepares this object for advance from time t0 to time t1. | 
| void | setInitialState(ComponentState state) | 
| void | setMaxStepSize(double sec)Sets the maximum step size by which this model should be advanced within a
 simulation loop. | 
| void | setState(ComponentState state)Set the state of this component. | 
add, add, addAll, addComponents, addFixed, addNumbered, clear, clone, componentChanged, contains, contains, containsAll, copy, ensureCapacity, findComponent, get, get, getByNumber, getChildren, getNavpanelDisplay, getNumberLimit, getShortName, getTypeParameter, hasChildren, hasParameterizedType, indexOf, invalidateNumbers, isEmpty, iterator, nextComponentNumber, numComponents, postscan, remove, remove, removeAll, removeAll, removeComponents, retainAll, scan, set, setNavpanelDisplay, setNumbered, setNumberingStartAtOne, setShortName, size, toArray, toArray, updateNameMapcheckFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasState, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferencesgetPropertygetChildren, hasChildrenisWritable, writegetNamepublic static PropertyList myProps
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class ComponentList<ModelComponent>public void setState(ComponentState state)
public void getState(ComponentState state)
public void setInitialState(ComponentState state)
public void getInitialState(ComponentState state)
public void getInitialState(ComponentState newstate, ComponentState oldstate)
HasStatestate. 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.getInitialState in interface HasStatenewstate - receives the state informationoldstate - previous state information; may be null.public void initialize(double t)
HasState.setState(artisynth.core.modelbase.ComponentState), in which case t may have an arbitrary value.initialize in interface Modelt - initialization time (seconds)public StepAdjustment preadvance(double t0, double t1, int flags)
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
preadvance in interface Modelt0 - current time (seconds)t1 - new time to advance to (seconds)flags - reserved for future usepublic abstract StepAdjustment advance(double t0, double t1, int flags)
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
public double getMaxStepSize()
getMaxStepSize in interface Modelpublic void setMaxStepSize(double sec)
sec - maximum step size (seconds)public ComponentState createState(ComponentState prevState)
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.createState in interface HasStateprevState - If non-null, supplies a previous state that
 was created by this component and which can be used to provide
 pre-sizing hints.public void dispose()
dispose in interface Modeldispose in interface Disposablepublic boolean hierarchyContainsReferences()
In particular, this means that one does not need to search outside the hierarchy when looking for dependencies.
hierarchyContainsReferences in interface CompositeComponenthierarchyContainsReferences in class ComponentList<ModelComponent>public ModelBase copy(java.util.Map<ModelComponent,ModelComponent> copyMap, int flags)
public boolean getMenuItems(java.util.List<java.lang.Object> items)
list
 argument. The objects should be be items capable of being added to a
 JMenu, including Component, JMenuItem, and String.
 
 If the method returns false (the default behavior), that is
 taken to indicate that this component has no menu items.getMenuItems in interface HasMenuItemsitems - collects the objects that should be addedfalse if there are no items to add to the
 model menu.GuiUtils.createMenuItem(java.awt.event.ActionListener, java.lang.String, java.lang.String)public void actionPerformed(java.awt.event.ActionEvent event)
getMenuItems(java.util.List<java.lang.Object>).actionPerformed in interface java.awt.event.ActionListener