msim
Class MSim

java.lang.Object
  extended by msim.MSim

@ThreadSafe
public class MSim
extends java.lang.Object

MSim entry point.

MSim may either be used as a stand-alone application or a library (TBD applet, webstart). See examples/Example1.java for an example of using it as a Java library. TBD do a similar example in JScheme.

The main(java.lang.String[]) function in this class is the entry point when running MSim as an application.

Command Line Arguments

Java System Properties

These are used no matter how MSim is run.

Copyright (C) 2008 Marsette A. Vona, III

Author:
Marsette A. Vona, III

Field Summary
protected static java.applet.Applet applet
          A reference to the MSimApplet instance iff running as an applet.
static java.lang.String APPNAME
          the application name
static java.lang.String APPNAME_LC
          the application name, all lower case
protected static java.lang.String[] arg
          the invocation args, null if none
protected static Controller controller
          the Controller instance
private static java.lang.String cvsid
           
static java.util.logging.Level DEF_LOG_LEVEL
          default log level
protected static double[] gravity
          Gravity vector, or null if none.
protected static boolean gravityEnabled
          gating enable for gravity
static java.lang.String ICON_DIR
          Directory containing ICON_FILES relative to application base package.
static java.lang.String[] ICON_FILES
          icons to load in getIcons()
protected  java.util.List<java.awt.Image> icons
          the icons loaded lazily by getIcons()
static java.lang.String JLAPACK_CLASS
          representative class name
static java.lang.String JSCHEME_GPC_CLASS
          representative class name
protected static Linkage linkage
          the top-level Linkage instance
static vona.log.Log LOG
          application-wide log
protected static MSim msim
          the singleton instance of the application object
protected static java.lang.Object msimVersion
          Versions, stored as Object in case VonaUtils is not available.
static java.lang.String[] NETLIB_JAVA_CLASSES
          representative class names
static int nextAnonymousJointNumber
          used to make unique names
static int nextAnonymousLinkageNumber
          used to make unique names
static int nextAnonymousLinkNumber
          used to make unique names
protected static java.awt.Container parentContainer
          the parent container, e.g.
protected static UI ui
          the UI instance
static java.util.regex.Pattern VALID_NAME_CONT_PATTERN
          Regex matching valid model entity names.
static java.lang.String VALID_NAME_CONT_REGEX
           
static java.util.regex.Pattern VALID_NAME_PATTERN
          Regex matching valid model entity names.
static java.lang.String VALID_NAME_REGEX
           
static java.util.regex.Pattern VALID_NAME_START_PATTERN
          Regex matching valid model entity names.
static java.lang.String VALID_NAME_START_REGEX
           
static java.lang.String VONAUTILS_CLASS
          representative class name
protected static java.lang.Object vonaUtilsVersion
          Versions, stored as Object in case VonaUtils is not available.
protected static boolean withDisplay
          whether to create a graphical Display
protected static boolean withJScheme
          whether to create a JScheme interpreter
protected static boolean withUI
          whether to create a UI
 
Constructor Summary
MSim()
          sets only msim
MSim(boolean withDisplay, boolean withJScheme)
          Constructor, enforces singleton instance.
 
Method Summary
 void appletDestroy(java.applet.Applet applet)
          Applet destroy method.
 boolean checkDependencies()
          checkDependencies(PrintStream) using System.err
 boolean checkDependencies(java.io.PrintStream errorStream)
          Check for the presence of all dependencies.
static void clearAll()
          aliases eponymous method in linkage
static int[] collectTreeMetrics()
          aliases eponymous method in getUltimateGroundLink()
static int[] collectTreeMetrics(int[] metrics)
          aliases eponymous method in getUltimateGroundLink()
static boolean disableGravity()
          setGravityEnabled(boolean) false
static void dumpAllLinkages()
          aliases eponymous method in linkage
 void dumpConfig()
          dumpConfig(java.io.PrintStream) to System.out
 void dumpConfig(java.io.PrintStream s)
          dump all config
static void dumpJ3D3DSProperties()
          dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library to System.out
static void dumpJ3D3DSProperties(java.io.PrintStream s)
          dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library
static void dumpJ3DProperties()
          dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library to System.out
static void dumpJ3DProperties(java.io.PrintStream s)
          dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library
static void dumpJ3DVRML97Properties()
          dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library to System.out
static void dumpJ3DVRML97Properties(java.io.PrintStream s)
          dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library
static void dumpJOGLProperties()
          dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library to System.out
static void dumpJOGLProperties(java.io.PrintStream s)
          dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library
 void dumpLibraryVersionInfo()
          dumpLibraryVersionInfo(PrintStream) to System.out
 void dumpLibraryVersionInfo(java.io.PrintStream s)
          dump library version info
protected static void dumpPackageProperties(java.lang.String pkgClass, java.io.PrintStream s)
          Dump package manifest properties.
static void dumpRuntime()
          dumpRuntime(PrintStream) to System.out
static void dumpRuntime(java.io.PrintStream s)
          dump key parameters of the JVM Runtime
static void dumpSystemProperties()
          dump system properties to System.out
static void dumpSystemProperties(java.io.PrintStream s)
          dump system properties
static void dumpTerminalProperties()
          dumpTerminalProperties(PrintStream) to System.out
static void dumpTerminalProperties(java.io.PrintStream s)
          dump console terminal properties
static void dumpTree()
          aliases eponymous method in getUltimateGroundLink()
static void dumpTree(java.io.PrintStream s)
          aliases eponymous method in getUltimateGroundLink()
static void dumpTreeMetrics()
          aliases eponymous method in getUltimateGroundLink()
static void dumpTreeMetrics(java.io.PrintStream s)
          aliases eponymous method in getUltimateGroundLink()
 void dumpVersionInfo()
          dumpVersionInfo(PrintStream) to System.out
 void dumpVersionInfo(java.io.PrintStream s)
          dump version info
static void enableDBGNormalsRecursively(boolean enable)
          aliases eponymous method in getUltimateGroundLink()
static void enableDBGSpheresRecursively(boolean enable)
          aliases eponymous method in getUltimateGroundLink()
static boolean enableGravity()
          setGravityEnabled(boolean) true
static void enableLinkCoMWidgetsRecursively(boolean enable)
          aliases eponymous method in getUltimateGroundLink()
static void enableSubtreeCoMWidgetsRecursively(boolean enable)
          aliases eponymous method in getUltimateGroundLink()
static void exit()
          exit(int) with code 0
static void exit(int code)
          Try to exit cleanly.
static Joint findJoint(java.lang.String namePattern)
          aliases eponymous method in getUltimateGroundLink()
static Joint findJoint(java.lang.String namePattern, int nth)
          aliases eponymous method in getUltimateGroundLink()
static java.util.Collection<Joint> findJoints(java.lang.String namePattern)
          aliases eponymous method in getUltimateGroundLink()
static java.util.Collection<Joint> findJoints(java.lang.String namePattern, java.util.Collection<Joint> joints)
          aliases eponymous method in getUltimateGroundLink()
static Link findLink(java.lang.String namePattern)
          aliases eponymous method in getUltimateGroundLink()
static Link findLink(java.lang.String namePattern, int nth)
          aliases eponymous method in getUltimateGroundLink()
static Linkage findLinkage(java.lang.String namePattern)
          aliases eponymous method in linkage
static Linkage findLinkage(java.lang.String namePattern, int nth)
          aliases eponymous method in linkage
static java.util.Collection<Linkage> findLinkages(java.lang.String namePattern)
          aliases eponymous method in linkage
static java.util.Collection<Linkage> findLinkages(java.lang.String namePattern, java.util.Collection<Linkage> linkages)
          aliases eponymous method in linkage
static java.util.Collection<Link> findLinks(java.lang.String namePattern)
          aliases eponymous method in getUltimateGroundLink()
static java.util.Collection<Link> findLinks(java.lang.String namePattern, java.util.Collection<Link> links)
          aliases eponymous method in getUltimateGroundLink()
static LinkageNode findNode(java.lang.String namePattern)
          aliases eponymous method in getUltimateGroundLink()
static LinkageNode findNode(java.lang.String namePattern, int nth)
          aliases eponymous method in getUltimateGroundLink()
static java.util.Collection<LinkageNode> findNodes(java.lang.String namePattern)
          aliases eponymous method in getUltimateGroundLink()
static java.util.Collection<LinkageNode> findNodes(java.lang.String namePattern, java.util.Collection<LinkageNode> nodes)
          aliases eponymous method in getUltimateGroundLink()
static void garbageCollect()
          request garbage collection
static java.applet.Applet getApplet()
          get applet
 java.lang.String getAppname()
          get the application name
 java.lang.String getAppSubname()
          get the application sub-name
static java.lang.String[] getArg()
          get arg
static Controller getController()
          get controller
 java.lang.String getFullAppname()
          Get a string containing both the application name and the subname, if any.
static double[] getGravity()
          covers getGravity(double[]), always conses
static double[] getGravity(double[] gravity)
          get a copy of gravity or null if unset
 java.util.List<? extends java.awt.Image> getIcons()
          load icons lazily from ICON_FILES
static java.lang.String getJ3D3DSVersion()
          getPackageVersion(java.lang.String) for indicated library
static java.lang.String getJ3DVersion()
          get version for indicated library
static java.lang.String getJ3DVRML97Version()
          getPackageVersion(java.lang.String) for indicated library
static java.lang.String getJOGLVersion()
          get version for indicated library
static java.lang.String getJREVersion()
          get JRE version
static java.lang.String getJVMVersion()
          get JVM version
static Linkage getLinkage()
          get linkage
static MSim getMSim()
          get msim
static java.lang.String getMSimRevision()
          get the MSim library revision
static java.lang.String getMSimVersion()
          get a string containing the full MSim version
static java.lang.String getMSimVersionDate()
          get the MSim library version date
protected static java.lang.String getPackageVersion(java.lang.String pkgClass)
          get package manifest version
static java.awt.Container getParentContainer()
          get parentContainer
static java.lang.Class getResourceClass()
          Get the class for getResourceURL(String).
static java.net.URL getResourceURL(java.lang.String resourcePath)
          getResourceURL(String, Class, boolean) with getResourceClass() and don't try ancestors.
static java.net.URL getResourceURL(java.lang.String resourcePath, boolean tryAncestors)
          getResourceURL(String, Class, boolean) with getResourceClass().
static java.net.URL getResourceURL(java.lang.String resourcePath, java.lang.Class clazz)
          getResourceURL(String, Class, boolean) and don't try ancestors.
static java.net.URL getResourceURL(java.lang.String resourcePath, java.lang.Class clazz, boolean tryAncestors)
          Get the URL for resourcePath associated with clazz, or null if not found.
 java.lang.String getRevision()
          get application revision
static java.lang.Object getSolveParameter(java.lang.String name)
          aliases eponymous method in controller
static java.lang.String getSystemProperty(java.lang.String property)
          Covers getSystemProperty(String, String), default "<undefined>".
static boolean getSystemProperty(java.lang.String property, boolean def)
          Covers getSystemProperty(String, String), gets a boolean.
static int getSystemProperty(java.lang.String property, int def)
          covers getSystemProperty(String, String), gets an int
static java.lang.String getSystemProperty(java.lang.String property, java.lang.String def)
          Get the value the indicated system property.
static UI getUI()
          get ui
static Link getUltimateGroundLink()
          aliases Linkage.getGroundLink() in linkage
 java.lang.String getVersion()
          get a string containing the full application version
 java.lang.String getVersionDate()
          get application version date
static java.lang.String getVonaUtilsRevision()
          get the Vona library revision
static java.lang.String getVonaUtilsVersion()
          get a string containing the full VonaUtils library version
static java.lang.String getVonaUtilsVersionDate()
          get the Vona library version date
static boolean hasArg(java.lang.String a)
          Check for the presence of a command line argument.
static boolean hasClass(java.lang.String name)
          check if the named class is available
static boolean hasJ3D()
          check if Java3D is present
static boolean hasJ3D15()
          check if Java3D 1.5+ is present
static boolean hasJ3D3DS()
          check if Java3D 3DS loader is present
static boolean hasJ3DVRML97()
          check if Java3D VRML97 loader is present
static boolean hasJLAPACK()
          Check if JLAPACK is present.
static boolean hasJOGL()
          check if JOGL is present
static boolean hasJSchemeGPC()
          Check if JScheme-GPC is present.
static boolean hasLAPACK_JNI()
          Checkif the netlib-java implementation successfully loaded a native LAPACK backend.
static boolean hasNETLIB_JAVA()
          Check if netlib-java is present.
static boolean hasVonaUtils()
          Check if VonaUtils is present.
protected  void initJ3D()
          Hook to initialize the Java3D subsystem from instanceMain(boolean).
protected  void initLibraries()
          Hook to initialize libraries from instanceMain(boolean).
protected  void initLogging()
          Hook to initialize the logging subsystem from instanceMain(boolean).
protected  void initNETLIB_JAVA()
          Hook to initialize the NETLIB_JAVA subsystem from instanceMain(boolean).
static boolean initOK()
          See if everything is initialized.
protected  void initVersions()
          Hook to initialize version objects from instanceMain(boolean).
 boolean instanceMain()
          Covers instanceMain(boolean), with UI.
 boolean instanceMain(boolean withUI)
          Overrideable main method.
static boolean inUpdateThread()
          aliases eponymous method in controller
static boolean isApplet()
          check if running as an applet
static boolean isGravitySet()
          check if gravity is non-null
static boolean isGravitySetAndEnabled()
          check if gravity is both set and enabled
static boolean isWebstart()
          check if running under webstart
static javax.swing.ImageIcon loadImageIconFromResource(java.lang.String path)
          loadImageIconFromResource(String, String) using path as description.
static javax.swing.ImageIcon loadImageIconFromResource(java.lang.String path, java.lang.String description)
          Try to load an image icon via getResourceURL(String).
static void main(java.lang.String[] arg)
          Application (as opposed to applet) init.
protected  Controller makeController()
          Hook to make controller from instanceMain(boolean).
protected  Linkage makeLinkage()
          Hook to make linkage from instanceMain(boolean).
protected  UI makeUI()
          Hook to make ui from instanceMain(boolean).
protected  boolean preMain(java.io.PrintStream out, java.io.PrintStream err)
          checkDependencies(java.io.PrintStream) and arg and handle any off-nominal execution paths.
static int recomputeAllClosures()
          aliases eponymous method in Controller
static java.util.Iterator<Joint> recursiveJointIterator()
          aliases eponymous method in linkage
static java.util.Iterator<Linkage> recursiveLinkageIterator()
          aliases eponymous method in linkage
static java.util.Iterator<Link> recursiveLinkIterator()
          aliases eponymous method in linkage
static boolean recursivelyContains(Joint j)
          aliases eponymous method in linkage
static boolean recursivelyContains(Link l)
          aliases eponymous method in linkage
static boolean recursivelyContains(Linkage l)
          aliases eponymous method in linkage
static boolean recursivelyContains(LinkageNode n)
          aliases eponymous method in linkage
static void runUpdateTask(java.lang.Runnable task)
          aliases eponymous method in controller
static void scheduleUpdateTask(java.lang.Runnable task)
          aliases eponymous method in controller
static void setAllLocked(boolean locked)
          aliases corresp.
static void setAllTreeJointsToGoal(int goal)
          aliases eponymous method in getUltimateGroundLink()
static void setAllTreeJointsToHighestPrioritySoftGoal()
          aliases eponymous method in getUltimateGroundLink()
static void setAllTreeJointsToPosture()
          aliases eponymous method in getUltimateGroundLink()
static void setAllTreeJointsToTarget()
          aliases eponymous method in getUltimateGroundLink()
static void setCoMWidgetRadiusScaleFactorRecursively(float scaleFactor)
          aliases eponymous method in getUltimateGroundLink()
static void setGravity(double... gravity)
          Set gravity.
static boolean setGravityEnabled(boolean enabled)
          set gravity gating enable
static java.lang.Object setSolveParameter(java.lang.String name, java.lang.Object value)
          aliases eponymous method in controller
static boolean setWidgetLengthRecursively(float widgetLength)
          aliases eponymous method in getUltimateGroundLink()
static boolean setWidgetLengthRecursively(float widgetLength, boolean updateIfDifferent)
          aliases eponymous method in getUltimateGroundLink()
static void showMessageDialog(java.awt.Container parent, java.lang.String message)
          showMessageDialog(Container, String, int) a JOptionPane.PLAIN_MESSAGE.
static void showMessageDialog(java.awt.Container parent, java.lang.String message, int messageType)
          Display an informational dialog using JOptionPane, iff withDisplay.
static void showMessageDialog(java.lang.String message)
          showMessageDialog(Container, String) using getParentContainer().
static void showMessageDialog(java.lang.String message, int messageType)
          showMessageDialog(Container, String, int) using getParentContainer().
static void stateChanged()
          aliases eponymous method in controller
static void structureChanged()
          aliases eponymous method in controller
static boolean toggleSolveParameter(java.lang.String name)
          aliases eponymous method in controller
static boolean traverseTree(LinkageNode.NodeHandler nodeHandler)
          aliases eponymous method in getUltimateGroundLink()
static void unsetGravity()
          set gravity null
static void updateAllCMTs()
          aliases eponymous method in Controller
static void updateAllSubtreeCoMs()
          aliases eponymous method in Controller
static void updateWidgetsRecursively()
          aliases eponymous method in getUltimateGroundLink()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cvsid

private static final java.lang.String cvsid
See Also:
Constant Field Values

APPNAME

public static final java.lang.String APPNAME
the application name

See Also:
Constant Field Values

APPNAME_LC

public static final java.lang.String APPNAME_LC
the application name, all lower case


LOG

public static final vona.log.Log LOG
application-wide log


DEF_LOG_LEVEL

public static final java.util.logging.Level DEF_LOG_LEVEL
default log level


ICON_DIR

public static final java.lang.String ICON_DIR

Directory containing ICON_FILES relative to application base package.

Omits trailing directory separator.

See Also:
Constant Field Values

ICON_FILES

public static final java.lang.String[] ICON_FILES
icons to load in getIcons()


icons

protected final java.util.List<java.awt.Image> icons
the icons loaded lazily by getIcons()


VONAUTILS_CLASS

public static final java.lang.String VONAUTILS_CLASS
representative class name

See Also:
Constant Field Values

JLAPACK_CLASS

public static final java.lang.String JLAPACK_CLASS
representative class name

See Also:
Constant Field Values

JSCHEME_GPC_CLASS

public static final java.lang.String JSCHEME_GPC_CLASS
representative class name

See Also:
Constant Field Values

NETLIB_JAVA_CLASSES

public static final java.lang.String[] NETLIB_JAVA_CLASSES
representative class names


VALID_NAME_START_REGEX

public static final java.lang.String VALID_NAME_START_REGEX
See Also:
Constant Field Values

VALID_NAME_CONT_REGEX

public static final java.lang.String VALID_NAME_CONT_REGEX
See Also:
Constant Field Values

VALID_NAME_REGEX

public static final java.lang.String VALID_NAME_REGEX
See Also:
Constant Field Values

VALID_NAME_START_PATTERN

public static final java.util.regex.Pattern VALID_NAME_START_PATTERN

Regex matching valid model entity names.

Note: internally generated names may use reserved chars.


VALID_NAME_CONT_PATTERN

public static final java.util.regex.Pattern VALID_NAME_CONT_PATTERN

Regex matching valid model entity names.

Note: internally generated names may use reserved chars.


VALID_NAME_PATTERN

public static final java.util.regex.Pattern VALID_NAME_PATTERN

Regex matching valid model entity names.

Note: internally generated names may use reserved chars.


nextAnonymousLinkageNumber

public static int nextAnonymousLinkageNumber
used to make unique names


nextAnonymousLinkNumber

public static int nextAnonymousLinkNumber
used to make unique names


nextAnonymousJointNumber

public static int nextAnonymousJointNumber
used to make unique names


gravity

protected static double[] gravity

Gravity vector, or null if none.

Magnitude gives gravitational acceleration constant. Direction is down in ground link frame.


gravityEnabled

protected static boolean gravityEnabled
gating enable for gravity


msimVersion

protected static volatile java.lang.Object msimVersion
Versions, stored as Object in case VonaUtils is not available.


vonaUtilsVersion

protected static volatile java.lang.Object vonaUtilsVersion
Versions, stored as Object in case VonaUtils is not available.


msim

protected static volatile MSim msim
the singleton instance of the application object


withDisplay

protected static volatile boolean withDisplay
whether to create a graphical Display


withJScheme

protected static volatile boolean withJScheme
whether to create a JScheme interpreter


withUI

protected static volatile boolean withUI
whether to create a UI


linkage

protected static volatile Linkage linkage
the top-level Linkage instance


controller

protected static volatile Controller controller
the Controller instance


ui

protected static volatile UI ui
the UI instance


arg

protected static volatile java.lang.String[] arg
the invocation args, null if none


parentContainer

protected static volatile java.awt.Container parentContainer
the parent container, e.g. when run as applet, null if none


applet

protected static volatile java.applet.Applet applet

A reference to the MSimApplet instance iff running as an applet.

This also serves to determine whether we were invoked as an applet as opposed to an application, see isApplet(). There does not seem to be a better way to do this.

Constructor Detail

MSim

public MSim(boolean withDisplay,
            boolean withJScheme)

Constructor, enforces singleton instance.

Sets msim, withDisplay, and withJScheme.

This does not fully set up MSim. Typically instanceMain(boolean) should be called to finish the job. Here we record whether a display and JScheme interpreter are expected to be created should a UI be made in instanceMain(boolean), mainly so that an early checkDependencies(java.io.PrintStream) can be done that checks for the requisite dependencies.

Parameters:
withDisplay - whether to expect a graphical display to be created if a UI is later created
withJScheme - whether to expect a JScheme interpreter to be created if a UI is later created
Throws:
java.lang.IllegalStateException - if MSim instance has already been created

MSim

public MSim()
sets only msim

Method Detail

getMSim

public static MSim getMSim()
get msim


getLinkage

public static Linkage getLinkage()
get linkage


getController

public static Controller getController()
get controller


getUI

public static UI getUI()
get ui


initOK

public static boolean initOK()
See if everything is initialized.


getArg

public static java.lang.String[] getArg()
get arg


getParentContainer

public static java.awt.Container getParentContainer()
get parentContainer


getApplet

public static java.applet.Applet getApplet()
get applet


isApplet

public static boolean isApplet()
check if running as an applet


isWebstart

public static boolean isWebstart()
check if running under webstart


setGravity

public static void setGravity(double... gravity)

Set gravity.

Throws:
java.lang.IllegalArgumentException - if gravity is not a 3D non-NaN vector or null

unsetGravity

public static void unsetGravity()
set gravity null


isGravitySet

public static boolean isGravitySet()
check if gravity is non-null


setGravityEnabled

public static boolean setGravityEnabled(boolean enabled)
set gravity gating enable


enableGravity

public static boolean enableGravity()
setGravityEnabled(boolean) true


disableGravity

public static boolean disableGravity()
setGravityEnabled(boolean) false


isGravitySetAndEnabled

public static boolean isGravitySetAndEnabled()
check if gravity is both set and enabled


getGravity

public static double[] getGravity(double[] gravity)
get a copy of gravity or null if unset


getGravity

public static double[] getGravity()
covers getGravity(double[]), always conses


hasVonaUtils

public static boolean hasVonaUtils()

Check if VonaUtils is present.


hasJSchemeGPC

public static boolean hasJSchemeGPC()

Check if JScheme-GPC is present.


hasJLAPACK

public static boolean hasJLAPACK()

Check if JLAPACK is present.

TBD the current implementation cannot distinguish between jlapack.jar and arpack_combined_all.jar in netlib-java (and maybe it shouldnt?).


hasNETLIB_JAVA

public static boolean hasNETLIB_JAVA()

Check if netlib-java is present.


hasLAPACK_JNI

public static boolean hasLAPACK_JNI()

Checkif the netlib-java implementation successfully loaded a native LAPACK backend.


hasJOGL

public static boolean hasJOGL()
check if JOGL is present


hasJ3D

public static boolean hasJ3D()
check if Java3D is present


hasJ3D15

public static boolean hasJ3D15()
check if Java3D 1.5+ is present


hasJ3DVRML97

public static boolean hasJ3DVRML97()
check if Java3D VRML97 loader is present


hasJ3D3DS

public static boolean hasJ3D3DS()
check if Java3D 3DS loader is present


hasClass

public static boolean hasClass(java.lang.String name)
check if the named class is available


getMSimRevision

public static java.lang.String getMSimRevision()
get the MSim library revision


getMSimVersionDate

public static java.lang.String getMSimVersionDate()
get the MSim library version date


getMSimVersion

public static java.lang.String getMSimVersion()
get a string containing the full MSim version


getVonaUtilsRevision

public static java.lang.String getVonaUtilsRevision()
get the Vona library revision


getVonaUtilsVersionDate

public static java.lang.String getVonaUtilsVersionDate()
get the Vona library version date


getVonaUtilsVersion

public static java.lang.String getVonaUtilsVersion()
get a string containing the full VonaUtils library version


dumpJ3DProperties

public static void dumpJ3DProperties(java.io.PrintStream s)
dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library


dumpJ3DProperties

public static void dumpJ3DProperties()
dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library to System.out


dumpJ3DVRML97Properties

public static void dumpJ3DVRML97Properties(java.io.PrintStream s)
dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library


dumpJ3DVRML97Properties

public static void dumpJ3DVRML97Properties()
dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library to System.out


dumpJ3D3DSProperties

public static void dumpJ3D3DSProperties(java.io.PrintStream s)
dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library


dumpJ3D3DSProperties

public static void dumpJ3D3DSProperties()
dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library to System.out


dumpJOGLProperties

public static void dumpJOGLProperties(java.io.PrintStream s)
dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library


dumpJOGLProperties

public static void dumpJOGLProperties()
dumpPackageProperties(java.lang.String, java.io.PrintStream) for indicated library to System.out


getJ3DVersion

public static java.lang.String getJ3DVersion()
get version for indicated library


getJ3DVRML97Version

public static java.lang.String getJ3DVRML97Version()
getPackageVersion(java.lang.String) for indicated library


getJ3D3DSVersion

public static java.lang.String getJ3D3DSVersion()
getPackageVersion(java.lang.String) for indicated library


getJOGLVersion

public static java.lang.String getJOGLVersion()
get version for indicated library


getJREVersion

public static java.lang.String getJREVersion()
get JRE version


getJVMVersion

public static java.lang.String getJVMVersion()
get JVM version


dumpPackageProperties

protected static void dumpPackageProperties(java.lang.String pkgClass,
                                            java.io.PrintStream s)

Dump package manifest properties.

Parameters:
pkgClass - name of a representative class from the package

getPackageVersion

protected static java.lang.String getPackageVersion(java.lang.String pkgClass)
get package manifest version


dumpSystemProperties

public static void dumpSystemProperties(java.io.PrintStream s)
dump system properties


dumpSystemProperties

public static void dumpSystemProperties()
dump system properties to System.out


dumpRuntime

public static void dumpRuntime(java.io.PrintStream s)
dump key parameters of the JVM Runtime


dumpRuntime

public static void dumpRuntime()
dumpRuntime(PrintStream) to System.out


dumpTerminalProperties

public static void dumpTerminalProperties(java.io.PrintStream s)
dump console terminal properties


dumpTerminalProperties

public static void dumpTerminalProperties()
dumpTerminalProperties(PrintStream) to System.out


getSystemProperty

public static java.lang.String getSystemProperty(java.lang.String property,
                                                 java.lang.String def)

Get the value the indicated system property.

Parameters:
def - the default value to return if the property is not found or if there was a SecurityException in trying to get it

getSystemProperty

public static java.lang.String getSystemProperty(java.lang.String property)

Covers getSystemProperty(String, String), default "<undefined>".


getSystemProperty

public static boolean getSystemProperty(java.lang.String property,
                                        boolean def)

Covers getSystemProperty(String, String), gets a boolean.


getSystemProperty

public static int getSystemProperty(java.lang.String property,
                                    int def)
covers getSystemProperty(String, String), gets an int


showMessageDialog

public static void showMessageDialog(java.awt.Container parent,
                                     java.lang.String message,
                                     int messageType)

Display an informational dialog using JOptionPane, iff withDisplay.


showMessageDialog

public static void showMessageDialog(java.lang.String message,
                                     int messageType)

showMessageDialog(Container, String, int) using getParentContainer().


showMessageDialog

public static void showMessageDialog(java.awt.Container parent,
                                     java.lang.String message)

showMessageDialog(Container, String, int) a JOptionPane.PLAIN_MESSAGE.


showMessageDialog

public static void showMessageDialog(java.lang.String message)

showMessageDialog(Container, String) using getParentContainer().


loadImageIconFromResource

public static javax.swing.ImageIcon loadImageIconFromResource(java.lang.String path,
                                                              java.lang.String description)

Try to load an image icon via getResourceURL(String).

Returns:
the image icon or null if not found

loadImageIconFromResource

public static javax.swing.ImageIcon loadImageIconFromResource(java.lang.String path)

loadImageIconFromResource(String, String) using path as description.


getResourceURL

public static java.net.URL getResourceURL(java.lang.String resourcePath,
                                          java.lang.Class clazz,
                                          boolean tryAncestors)

Get the URL for resourcePath associated with clazz, or null if not found.


getResourceURL

public static java.net.URL getResourceURL(java.lang.String resourcePath,
                                          java.lang.Class clazz)

getResourceURL(String, Class, boolean) and don't try ancestors.


getResourceURL

public static java.net.URL getResourceURL(java.lang.String resourcePath,
                                          boolean tryAncestors)

getResourceURL(String, Class, boolean) with getResourceClass().


getResourceURL

public static java.net.URL getResourceURL(java.lang.String resourcePath)

getResourceURL(String, Class, boolean) with getResourceClass() and don't try ancestors.


getResourceClass

public static java.lang.Class getResourceClass()

Get the class for getResourceURL(String).

Default impl returns class of getMSim().


garbageCollect

public static void garbageCollect()
request garbage collection


main

public static void main(java.lang.String[] arg)

Application (as opposed to applet) init.

Default impl sets arg, conses a new msim.MSim, and chains to instanceMain(boolean).

Derived applications will need to override this to instantiate their own application object. They may also want to override instanceMain(boolean) and/or the hooks it calls.


instanceMain

public boolean instanceMain(boolean withUI)

Overrideable main method.

For applet init, see MSimApplet.init().

Default impl does initVersions(), preMain(java.io.PrintStream, java.io.PrintStream), and if reuturn is nominal

  1. initLogging()
  2. initLibraries()
  3. makeLinkage()
  4. makeController()
  5. makeUI() if withUI
  6. call this.notify to wake up anybody waiting for initialization to be complete (notify() will also be called before return if initialization fails)
  7. either UI.applicationMain() or UI.appletMain(), if withUI

Parameters:
withUI - whether to make a UI (will be saved to withUI); if so then the default impl of makeUI() will make a Display iff withDisplay is set and a JScheme interpreter iff withJScheme is set.
Returns:
true if all initialization succeeded, except if withUI and withJScheme are both set (and initialiation succeeds) then this call will block until the JScheme interpreter exits, but the initialization status can be retrieved from initOK()

instanceMain

public boolean instanceMain()
Covers instanceMain(boolean), with UI.


exit

public static void exit(int code)

Try to exit cleanly.

If Controller.isUpdateThreadLive() then schedules an update task to exit. Else exits directly.


exit

public static void exit()
exit(int) with code 0


appletDestroy

public void appletDestroy(java.applet.Applet applet)

Applet destroy method.

Default impl chains to UI.appletDestroy(java.applet.Applet) on ui, if any.


getAppname

public java.lang.String getAppname()
get the application name


getAppSubname

public java.lang.String getAppSubname()
get the application sub-name


getFullAppname

public java.lang.String getFullAppname()

Get a string containing both the application name and the subname, if any.


getRevision

public java.lang.String getRevision()
get application revision


getVersionDate

public java.lang.String getVersionDate()
get application version date


getVersion

public java.lang.String getVersion()
get a string containing the full application version


dumpVersionInfo

public void dumpVersionInfo(java.io.PrintStream s)
dump version info


dumpVersionInfo

public void dumpVersionInfo()
dumpVersionInfo(PrintStream) to System.out


dumpLibraryVersionInfo

public void dumpLibraryVersionInfo(java.io.PrintStream s)
dump library version info


dumpLibraryVersionInfo

public void dumpLibraryVersionInfo()
dumpLibraryVersionInfo(PrintStream) to System.out


getIcons

public java.util.List<? extends java.awt.Image> getIcons()
load icons lazily from ICON_FILES


recursiveLinkageIterator

public static java.util.Iterator<Linkage> recursiveLinkageIterator()
aliases eponymous method in linkage


findLinkage

public static Linkage findLinkage(java.lang.String namePattern,
                                  int nth)
aliases eponymous method in linkage


findLinkage

public static Linkage findLinkage(java.lang.String namePattern)
aliases eponymous method in linkage


findLinkages

public static java.util.Collection<Linkage> findLinkages(java.lang.String namePattern,
                                                         java.util.Collection<Linkage> linkages)
aliases eponymous method in linkage


findLinkages

public static java.util.Collection<Linkage> findLinkages(java.lang.String namePattern)
aliases eponymous method in linkage


recursivelyContains

public static boolean recursivelyContains(Linkage l)
aliases eponymous method in linkage


getUltimateGroundLink

public static Link getUltimateGroundLink()
aliases Linkage.getGroundLink() in linkage


recursiveLinkIterator

public static java.util.Iterator<Link> recursiveLinkIterator()
aliases eponymous method in linkage


recursiveJointIterator

public static java.util.Iterator<Joint> recursiveJointIterator()
aliases eponymous method in linkage


recursivelyContains

public static boolean recursivelyContains(Link l)
aliases eponymous method in linkage


recursivelyContains

public static boolean recursivelyContains(Joint j)
aliases eponymous method in linkage


recursivelyContains

public static boolean recursivelyContains(LinkageNode n)
aliases eponymous method in linkage


recomputeAllClosures

public static int recomputeAllClosures()
aliases eponymous method in Controller


clearAll

public static void clearAll()
aliases eponymous method in linkage


dumpAllLinkages

public static void dumpAllLinkages()
aliases eponymous method in linkage


inUpdateThread

public static boolean inUpdateThread()
aliases eponymous method in controller


scheduleUpdateTask

public static void scheduleUpdateTask(java.lang.Runnable task)
aliases eponymous method in controller


runUpdateTask

public static void runUpdateTask(java.lang.Runnable task)
                          throws java.lang.InterruptedException
aliases eponymous method in controller

Throws:
java.lang.InterruptedException

structureChanged

public static void structureChanged()
aliases eponymous method in controller


stateChanged

public static void stateChanged()
aliases eponymous method in controller


setSolveParameter

public static java.lang.Object setSolveParameter(java.lang.String name,
                                                 java.lang.Object value)
aliases eponymous method in controller


getSolveParameter

public static java.lang.Object getSolveParameter(java.lang.String name)
aliases eponymous method in controller


toggleSolveParameter

public static boolean toggleSolveParameter(java.lang.String name)
aliases eponymous method in controller


traverseTree

public static boolean traverseTree(LinkageNode.NodeHandler nodeHandler)
aliases eponymous method in getUltimateGroundLink()


updateAllCMTs

public static void updateAllCMTs()
aliases eponymous method in Controller


updateAllSubtreeCoMs

public static void updateAllSubtreeCoMs()
aliases eponymous method in Controller


setAllLocked

public static void setAllLocked(boolean locked)
aliases corresp. recursive method in getUltimateGroundLink()


setAllTreeJointsToHighestPrioritySoftGoal

public static void setAllTreeJointsToHighestPrioritySoftGoal()
aliases eponymous method in getUltimateGroundLink()


setAllTreeJointsToGoal

public static void setAllTreeJointsToGoal(int goal)
aliases eponymous method in getUltimateGroundLink()


setAllTreeJointsToPosture

public static void setAllTreeJointsToPosture()
aliases eponymous method in getUltimateGroundLink()


setAllTreeJointsToTarget

public static void setAllTreeJointsToTarget()
aliases eponymous method in getUltimateGroundLink()


updateWidgetsRecursively

public static void updateWidgetsRecursively()
aliases eponymous method in getUltimateGroundLink()


enableDBGSpheresRecursively

public static void enableDBGSpheresRecursively(boolean enable)
aliases eponymous method in getUltimateGroundLink()


enableDBGNormalsRecursively

public static void enableDBGNormalsRecursively(boolean enable)
aliases eponymous method in getUltimateGroundLink()


setWidgetLengthRecursively

public static boolean setWidgetLengthRecursively(float widgetLength,
                                                 boolean updateIfDifferent)
aliases eponymous method in getUltimateGroundLink()


setWidgetLengthRecursively

public static boolean setWidgetLengthRecursively(float widgetLength)
aliases eponymous method in getUltimateGroundLink()


setCoMWidgetRadiusScaleFactorRecursively

public static void setCoMWidgetRadiusScaleFactorRecursively(float scaleFactor)
aliases eponymous method in getUltimateGroundLink()


enableLinkCoMWidgetsRecursively

public static void enableLinkCoMWidgetsRecursively(boolean enable)
aliases eponymous method in getUltimateGroundLink()


enableSubtreeCoMWidgetsRecursively

public static void enableSubtreeCoMWidgetsRecursively(boolean enable)
aliases eponymous method in getUltimateGroundLink()


findNode

public static LinkageNode findNode(java.lang.String namePattern,
                                   int nth)
aliases eponymous method in getUltimateGroundLink()


findNode

public static LinkageNode findNode(java.lang.String namePattern)
aliases eponymous method in getUltimateGroundLink()


findLink

public static Link findLink(java.lang.String namePattern,
                            int nth)
aliases eponymous method in getUltimateGroundLink()


findLink

public static Link findLink(java.lang.String namePattern)
aliases eponymous method in getUltimateGroundLink()


findJoint

public static Joint findJoint(java.lang.String namePattern,
                              int nth)
aliases eponymous method in getUltimateGroundLink()


findJoint

public static Joint findJoint(java.lang.String namePattern)
aliases eponymous method in getUltimateGroundLink()


findNodes

public static java.util.Collection<LinkageNode> findNodes(java.lang.String namePattern,
                                                          java.util.Collection<LinkageNode> nodes)
aliases eponymous method in getUltimateGroundLink()


findNodes

public static java.util.Collection<LinkageNode> findNodes(java.lang.String namePattern)
aliases eponymous method in getUltimateGroundLink()


findLinks

public static java.util.Collection<Link> findLinks(java.lang.String namePattern,
                                                   java.util.Collection<Link> links)
aliases eponymous method in getUltimateGroundLink()


findLinks

public static java.util.Collection<Link> findLinks(java.lang.String namePattern)
aliases eponymous method in getUltimateGroundLink()


findJoints

public static java.util.Collection<Joint> findJoints(java.lang.String namePattern,
                                                     java.util.Collection<Joint> joints)
aliases eponymous method in getUltimateGroundLink()


findJoints

public static java.util.Collection<Joint> findJoints(java.lang.String namePattern)
aliases eponymous method in getUltimateGroundLink()


collectTreeMetrics

public static int[] collectTreeMetrics(int[] metrics)
aliases eponymous method in getUltimateGroundLink()


collectTreeMetrics

public static int[] collectTreeMetrics()
aliases eponymous method in getUltimateGroundLink()


dumpTree

public static void dumpTree(java.io.PrintStream s)
aliases eponymous method in getUltimateGroundLink()


dumpTree

public static void dumpTree()
aliases eponymous method in getUltimateGroundLink()


dumpTreeMetrics

public static void dumpTreeMetrics(java.io.PrintStream s)
aliases eponymous method in getUltimateGroundLink()


dumpTreeMetrics

public static void dumpTreeMetrics()
aliases eponymous method in getUltimateGroundLink()


makeLinkage

protected Linkage makeLinkage()

Hook to make linkage from instanceMain(boolean).


makeController

protected Controller makeController()

Hook to make controller from instanceMain(boolean).


makeUI

protected UI makeUI()

Hook to make ui from instanceMain(boolean).

Uses withDisplay and withJScheme.


preMain

protected boolean preMain(java.io.PrintStream out,
                          java.io.PrintStream err)

checkDependencies(java.io.PrintStream) and arg and handle any off-nominal execution paths.

Parameters:
out - the stream to use as System.out, may not actually be System.out
err - the stream to use as System.err, may not actually be System.err
Returns:
true iff execution should continue with rest of instanceMain(boolean).


hasArg

public static boolean hasArg(java.lang.String a)

Check for the presence of a command line argument.

Works only after arg has been set, which is done for example in main(java.lang.String[]).

Parameters:
a - the command line argument to look for

checkDependencies

public boolean checkDependencies(java.io.PrintStream errorStream)

Check for the presence of all dependencies.

Parameters:
errorStream - if not null then messages are printed here about the failures, if any
Returns:
true iff all deps present

checkDependencies

public boolean checkDependencies()
checkDependencies(PrintStream) using System.err


dumpConfig

public void dumpConfig(java.io.PrintStream s)
dump all config


dumpConfig

public void dumpConfig()
dumpConfig(java.io.PrintStream) to System.out


initVersions

protected void initVersions()

Hook to initialize version objects from instanceMain(boolean).


initLibraries

protected void initLibraries()

Hook to initialize libraries from instanceMain(boolean).

Default impl does initJ3D() and initNETLIB_JAVA().


initLogging

protected void initLogging()

Hook to initialize the logging subsystem from instanceMain(boolean).


initJ3D

protected void initJ3D()

Hook to initialize the Java3D subsystem from instanceMain(boolean).


initNETLIB_JAVA

protected void initNETLIB_JAVA()

Hook to initialize the NETLIB_JAVA subsystem from instanceMain(boolean).