@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.
UI
is going to be created, then don't include a
graphical Display
UI
is going to be created, then don't include a
JScheme interpreter (the JScheme interpreter, if any, is always considered
part of the UI)UI
at allUI.JS_INIT
,
if listed, is always loaded firstThese are used no matter how MSim is run.
DEF_LOG_LEVEL
, where
levelname is the non-localized name of a java.util.logging.Level
, case insensitiveJOGLDisplay
properties under the classname msim.display
Copyright (C) 2008 Marsette A. Vona, III
Modifier and Type | Field and Description |
---|---|
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
|
static java.lang.String[] |
FOMMIL_NETLIB_CLASSES
representative class names
|
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_VONA_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
Version s, 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
representative class names
|
static java.util.regex.Pattern |
VALID_NAME_PATTERN
Regex matching valid model entity names.
|
static java.lang.String |
VALID_NAME_REGEX
representative class names
|
static java.util.regex.Pattern |
VALID_NAME_START_PATTERN
Regex matching valid model entity names.
|
static java.lang.String |
VALID_NAME_START_REGEX
representative class names
|
static java.lang.String |
VONAUTILS_CLASS
representative class name
|
protected static java.lang.Object |
vonaUtilsVersion
Version s, 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 and Description |
---|
MSim()
Covers
MSim(boolean, boolean) , enables display and
JScheme. |
MSim(boolean withDisplay,
boolean withJScheme)
Constructor, enforces singleton instance.
|
Modifier and Type | Method and Description |
---|---|
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()
|
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()
|
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)
|
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 |
hasFOMMIL_NETLIB()
Check if fommil-netlib is
present.
|
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 |
hasJSchemeVona()
Check if JScheme-Vona
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)
|
static void |
showMessageDialog(java.lang.String message,
int messageType)
|
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() |
private static final java.lang.String cvsid
public static final java.lang.String APPNAME
public static final java.lang.String APPNAME_LC
public static final vona.log.Log LOG
public static final java.util.logging.Level DEF_LOG_LEVEL
public static final java.lang.String ICON_DIR
Directory containing ICON_FILES
relative to application base
package.
Omits trailing directory separator.
public static final java.lang.String[] ICON_FILES
getIcons()
protected final java.util.List<java.awt.Image> icons
getIcons()
public static final java.lang.String VONAUTILS_CLASS
public static final java.lang.String JLAPACK_CLASS
public static final java.lang.String JSCHEME_VONA_CLASS
public static final java.lang.String[] NETLIB_JAVA_CLASSES
public static final java.lang.String[] FOMMIL_NETLIB_CLASSES
public static final java.lang.String VALID_NAME_START_REGEX
public static final java.lang.String VALID_NAME_CONT_REGEX
public static final java.lang.String VALID_NAME_REGEX
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.
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.
public static final java.util.regex.Pattern VALID_NAME_PATTERN
Regex matching valid model entity names.
Note: internally generated names may use reserved chars.
public static int nextAnonymousLinkageNumber
public static int nextAnonymousLinkNumber
public static int nextAnonymousJointNumber
protected static double[] gravity
Gravity vector, or null if none.
Magnitude gives gravitational acceleration constant. Direction is down in ground link frame.
protected static boolean gravityEnabled
gravity
protected static volatile java.lang.Object msimVersion
Version
s, stored as Object in case VonaUtils is not available.protected static volatile java.lang.Object vonaUtilsVersion
Version
s, stored as Object in case VonaUtils is not available.protected static volatile MSim msim
protected static volatile boolean withDisplay
Display
protected static volatile boolean withJScheme
protected static volatile boolean withUI
UI
protected static volatile Controller controller
Controller
instanceprotected static volatile UI ui
protected static volatile java.lang.String[] arg
protected static volatile java.awt.Container parentContainer
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.
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.
public MSim()
Covers MSim(boolean, boolean)
, enables display and
JScheme.
public static Controller getController()
controller
public static boolean initOK()
public static java.lang.String[] getArg()
arg
public static java.awt.Container getParentContainer()
parentContainer
public static java.applet.Applet getApplet()
applet
public static boolean isApplet()
public static boolean isWebstart()
public static void setGravity(double... gravity)
Set gravity
.
java.lang.IllegalArgumentException
- if gravity is not a 3D non-NaN
vector or nullpublic static void unsetGravity()
gravity
nullpublic static boolean isGravitySet()
gravity
is non-nullpublic static boolean setGravityEnabled(boolean enabled)
gravity
gating enablepublic static boolean enableGravity()
public static boolean disableGravity()
public static boolean isGravitySetAndEnabled()
public static double[] getGravity(double[] gravity)
gravity
or null if unsetpublic static double[] getGravity()
getGravity(double[])
, always consespublic static boolean hasVonaUtils()
Check if VonaUtils is present.
public static boolean hasJSchemeVona()
Check if JScheme-Vona is present.
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?).
public static boolean hasNETLIB_JAVA()
Check if netlib-java is present.
Note: what we refer to as netlib-java is actually an older version that
was in the namespace org.netlib.lapack
. That package has more
recently been moved to the namespace com.github.fommil.netlib
,
which we refer to as fommil-netlib. See hasFOMMIL_NETLIB()
.
public static boolean hasFOMMIL_NETLIB()
Check if fommil-netlib is present.
Note: what we refer to as fommil-netlib is actually the current version
of netlib-java, which is now in the namespace
com.github.fommil.netlib
. See hasNETLIB_JAVA()
.
public static boolean hasLAPACK_JNI()
Checkif the netlib-java implementation successfully loaded a native LAPACK backend.
public static boolean hasJOGL()
public static boolean hasJ3D()
public static boolean hasJ3D15()
public static boolean hasJ3DVRML97()
public static boolean hasJ3D3DS()
public static boolean hasClass(java.lang.String name)
public static java.lang.String getMSimRevision()
public static java.lang.String getMSimVersionDate()
public static java.lang.String getMSimVersion()
public static java.lang.String getVonaUtilsRevision()
public static java.lang.String getVonaUtilsVersionDate()
public static java.lang.String getVonaUtilsVersion()
public static void dumpJ3DProperties(java.io.PrintStream s)
dumpPackageProperties(java.lang.String, java.io.PrintStream)
for indicated librarypublic static void dumpJ3DProperties()
dumpPackageProperties(java.lang.String, java.io.PrintStream)
for indicated library to System.outpublic static void dumpJ3DVRML97Properties(java.io.PrintStream s)
dumpPackageProperties(java.lang.String, java.io.PrintStream)
for indicated librarypublic static void dumpJ3DVRML97Properties()
dumpPackageProperties(java.lang.String, java.io.PrintStream)
for indicated library to System.outpublic static void dumpJ3D3DSProperties(java.io.PrintStream s)
dumpPackageProperties(java.lang.String, java.io.PrintStream)
for indicated librarypublic static void dumpJ3D3DSProperties()
dumpPackageProperties(java.lang.String, java.io.PrintStream)
for indicated library to System.outpublic static void dumpJOGLProperties(java.io.PrintStream s)
dumpPackageProperties(java.lang.String, java.io.PrintStream)
for indicated librarypublic static void dumpJOGLProperties()
dumpPackageProperties(java.lang.String, java.io.PrintStream)
for indicated library to System.outpublic static java.lang.String getJ3DVersion()
public static java.lang.String getJ3DVRML97Version()
getPackageVersion(java.lang.String)
for indicated librarypublic static java.lang.String getJ3D3DSVersion()
getPackageVersion(java.lang.String)
for indicated librarypublic static java.lang.String getJOGLVersion()
public static java.lang.String getJREVersion()
public static java.lang.String getJVMVersion()
protected static void dumpPackageProperties(java.lang.String pkgClass, java.io.PrintStream s)
Dump package manifest properties.
pkgClass
- name of a representative class from the packageprotected static java.lang.String getPackageVersion(java.lang.String pkgClass)
public static void dumpSystemProperties(java.io.PrintStream s)
public static void dumpSystemProperties()
public static void dumpRuntime(java.io.PrintStream s)
Runtime
public static void dumpRuntime()
dumpRuntime(PrintStream)
to System.outpublic static void dumpTerminalProperties(java.io.PrintStream s)
public static void dumpTerminalProperties()
dumpTerminalProperties(PrintStream)
to System.outpublic static java.lang.String getSystemProperty(java.lang.String property, java.lang.String def)
Get the value the indicated system property.
def
- the default value to return if the property is not found or if
there was a SecurityException in trying to get itpublic static java.lang.String getSystemProperty(java.lang.String property)
Covers getSystemProperty(String, String)
, default
"<undefined>".
public static boolean getSystemProperty(java.lang.String property, boolean def)
Covers getSystemProperty(String, String)
, gets a
boolean.
public static int getSystemProperty(java.lang.String property, int def)
getSystemProperty(String, String)
, gets an intpublic static void showMessageDialog(java.awt.Container parent, java.lang.String message, int messageType)
Display an informational dialog using JOptionPane
, iff withDisplay
.
public static void showMessageDialog(java.lang.String message, int messageType)
public static void showMessageDialog(java.awt.Container parent, java.lang.String message)
showMessageDialog(Container, String, int)
a JOptionPane.PLAIN_MESSAGE
.
public static void showMessageDialog(java.lang.String message)
public static javax.swing.ImageIcon loadImageIconFromResource(java.lang.String path, java.lang.String description)
Try to load an image icon via getResourceURL(String)
.
public static javax.swing.ImageIcon loadImageIconFromResource(java.lang.String path)
loadImageIconFromResource(String, String)
using path as
description.
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.
public static java.net.URL getResourceURL(java.lang.String resourcePath, java.lang.Class clazz)
getResourceURL(String, Class, boolean)
and don't try
ancestors.
public static java.net.URL getResourceURL(java.lang.String resourcePath, boolean tryAncestors)
public static java.net.URL getResourceURL(java.lang.String resourcePath)
getResourceURL(String, Class, boolean)
with getResourceClass()
and don't try ancestors.
public static java.lang.Class getResourceClass()
Get the class for getResourceURL(String)
.
Default impl returns class of getMSim()
.
public static void garbageCollect()
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.
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
initLogging()
initLibraries()
makeLinkage()
makeController()
makeUI()
if withUI
this.notify
to wake up anybody waiting for initialization
to be complete (notify()
will also be called before return if
initialization fails)UI.applicationMain()
or UI.appletMain()
, if
withUI
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.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()
public boolean instanceMain()
instanceMain(boolean)
, with UI
.public static void exit(int code)
Try to exit cleanly.
If Controller.isUpdateThreadLive()
then schedules an update task
to exit. Else exits directly.
public static void exit()
exit(int)
with code 0public void appletDestroy(java.applet.Applet applet)
Applet destroy method.
Default impl chains to UI.appletDestroy(java.applet.Applet)
on ui
, if
any.
public java.lang.String getAppname()
public java.lang.String getAppSubname()
public java.lang.String getFullAppname()
Get a string containing both the application name and the subname, if any.
public java.lang.String getRevision()
public java.lang.String getVersionDate()
public java.lang.String getVersion()
public void dumpVersionInfo(java.io.PrintStream s)
public void dumpVersionInfo()
dumpVersionInfo(PrintStream)
to System.outpublic void dumpLibraryVersionInfo(java.io.PrintStream s)
public void dumpLibraryVersionInfo()
dumpLibraryVersionInfo(PrintStream)
to System.outpublic java.util.List<? extends java.awt.Image> getIcons()
ICON_FILES
public static java.util.Iterator<Linkage> recursiveLinkageIterator()
linkage
public static Linkage findLinkage(java.lang.String namePattern, int nth)
linkage
public static Linkage findLinkage(java.lang.String namePattern)
linkage
public static java.util.Collection<Linkage> findLinkages(java.lang.String namePattern, java.util.Collection<Linkage> linkages)
linkage
public static java.util.Collection<Linkage> findLinkages(java.lang.String namePattern)
linkage
public static boolean recursivelyContains(Linkage l)
linkage
public static Link getUltimateGroundLink()
Linkage.getGroundLink()
in linkage
public static java.util.Iterator<Link> recursiveLinkIterator()
linkage
public static java.util.Iterator<Joint> recursiveJointIterator()
linkage
public static boolean recursivelyContains(Link l)
linkage
public static boolean recursivelyContains(Joint j)
linkage
public static boolean recursivelyContains(LinkageNode n)
linkage
public static int recomputeAllClosures()
Controller
public static void clearAll()
linkage
public static void dumpAllLinkages()
linkage
public static boolean inUpdateThread()
controller
public static void scheduleUpdateTask(java.lang.Runnable task)
controller
public static void runUpdateTask(java.lang.Runnable task) throws java.lang.InterruptedException
controller
java.lang.InterruptedException
public static void structureChanged()
controller
public static void stateChanged()
controller
public static java.lang.Object setSolveParameter(java.lang.String name, java.lang.Object value)
controller
public static java.lang.Object getSolveParameter(java.lang.String name)
controller
public static boolean toggleSolveParameter(java.lang.String name)
controller
public static boolean traverseTree(LinkageNode.NodeHandler nodeHandler)
getUltimateGroundLink()
public static void updateAllCMTs()
Controller
public static void updateAllSubtreeCoMs()
Controller
public static void setAllLocked(boolean locked)
getUltimateGroundLink()
public static void setAllTreeJointsToHighestPrioritySoftGoal()
getUltimateGroundLink()
public static void setAllTreeJointsToGoal(int goal)
getUltimateGroundLink()
public static void setAllTreeJointsToPosture()
getUltimateGroundLink()
public static void setAllTreeJointsToTarget()
getUltimateGroundLink()
public static void updateWidgetsRecursively()
getUltimateGroundLink()
public static void enableDBGSpheresRecursively(boolean enable)
getUltimateGroundLink()
public static void enableDBGNormalsRecursively(boolean enable)
getUltimateGroundLink()
public static boolean setWidgetLengthRecursively(float widgetLength, boolean updateIfDifferent)
getUltimateGroundLink()
public static boolean setWidgetLengthRecursively(float widgetLength)
getUltimateGroundLink()
public static void setCoMWidgetRadiusScaleFactorRecursively(float scaleFactor)
getUltimateGroundLink()
public static void enableLinkCoMWidgetsRecursively(boolean enable)
getUltimateGroundLink()
public static void enableSubtreeCoMWidgetsRecursively(boolean enable)
getUltimateGroundLink()
public static LinkageNode findNode(java.lang.String namePattern, int nth)
getUltimateGroundLink()
public static LinkageNode findNode(java.lang.String namePattern)
getUltimateGroundLink()
public static Link findLink(java.lang.String namePattern, int nth)
getUltimateGroundLink()
public static Link findLink(java.lang.String namePattern)
getUltimateGroundLink()
public static Joint findJoint(java.lang.String namePattern, int nth)
getUltimateGroundLink()
public static Joint findJoint(java.lang.String namePattern)
getUltimateGroundLink()
public static java.util.Collection<LinkageNode> findNodes(java.lang.String namePattern, java.util.Collection<LinkageNode> nodes)
getUltimateGroundLink()
public static java.util.Collection<LinkageNode> findNodes(java.lang.String namePattern)
getUltimateGroundLink()
public static java.util.Collection<Link> findLinks(java.lang.String namePattern, java.util.Collection<Link> links)
getUltimateGroundLink()
public static java.util.Collection<Link> findLinks(java.lang.String namePattern)
getUltimateGroundLink()
public static java.util.Collection<Joint> findJoints(java.lang.String namePattern, java.util.Collection<Joint> joints)
getUltimateGroundLink()
public static java.util.Collection<Joint> findJoints(java.lang.String namePattern)
getUltimateGroundLink()
public static int[] collectTreeMetrics(int[] metrics)
getUltimateGroundLink()
public static int[] collectTreeMetrics()
getUltimateGroundLink()
public static void dumpTree(java.io.PrintStream s)
getUltimateGroundLink()
public static void dumpTree()
getUltimateGroundLink()
public static void dumpTreeMetrics(java.io.PrintStream s)
getUltimateGroundLink()
public static void dumpTreeMetrics()
getUltimateGroundLink()
protected Linkage makeLinkage()
Hook to make linkage
from instanceMain(boolean)
.
protected Controller makeController()
Hook to make controller
from instanceMain(boolean)
.
protected UI makeUI()
Hook to make ui
from instanceMain(boolean)
.
Uses withDisplay
and withJScheme
.
protected boolean preMain(java.io.PrintStream out, java.io.PrintStream err)
checkDependencies(java.io.PrintStream)
and arg and handle any off-nominal
execution paths.
out
- the stream to use as System.out, may not actually be System.outerr
- the stream to use as System.err, may not actually be System.errinstanceMain(boolean)
.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[])
.
a
- the command line argument to look forpublic boolean checkDependencies(java.io.PrintStream errorStream)
Check for the presence of all dependencies.
errorStream
- if not null then messages are printed here about the
failures, if anypublic boolean checkDependencies()
checkDependencies(PrintStream)
using System.errpublic void dumpConfig(java.io.PrintStream s)
public void dumpConfig()
dumpConfig(java.io.PrintStream)
to System.outprotected void initVersions()
Hook to initialize version objects from instanceMain(boolean)
.
protected void initLibraries()
Hook to initialize libraries from instanceMain(boolean)
.
Default impl does initJ3D()
and initNETLIB_JAVA()
.
protected void initLogging()
Hook to initialize the logging subsystem from instanceMain(boolean)
.
protected void initJ3D()
Hook to initialize the Java3D subsystem from instanceMain(boolean)
.
protected void initNETLIB_JAVA()
Hook to initialize the NETLIB_JAVA subsystem from instanceMain(boolean)
.