shady.sim.ui.multi
Class MultiSimUI

java.lang.Object
  extended by shady.common.ui.UI
      extended by shady.common.ui.multi.MultiUI
          extended by shady.sim.ui.multi.MultiSimUI

public class MultiSimUI
extends MultiUI

MultiShady simulator UI.

Copyright (C) 2006 Marsette A. Vona, III

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


Field Summary
static java.lang.String API_URL
          The JScheme API URL.
static java.lang.String APPNAME
          The default name of the application.
private static java.lang.String cvsid
           
static double[][] DEFAULT_MULTI_BARREL_ANGLE
          Barrel angles in default pose (degrees).
static int[] DEFAULT_MULTI_CONNECTED_BARREL
          Which gripper is connected in default pose.
static double[][] DEFAULT_MULTI_GRIPPER_STATE
          Gripper states in default pose.
static boolean[] DEFAULT_MULTI_INVERT_CONNECTION_SENSE
          Inverte connection sense of default pose.
static int[] DEFAULT_MULTI_SEGMENT
          Environment segment index connected in default pose.
static double[] DEFAULT_MULTI_WHERE
          Environment segment where connected in default pose (bottom of leftmost lower vertical).
static int DEFAULT_NUM_MEMBERS
          Default number of MemberShadys.
static java.lang.String JS_CHAIN_DEMO
          The name of the chain-demo scheme.
static java.lang.String JS_MULTI_SIM_EXTRA
          The name of the extra scheme for the multi simulator.
static java.lang.String JS_PROMPT
          The JScheme prompt.
static java.lang.String JS_TOWER_DEMO
          The name of the tower-demo scheme.
static java.lang.String JS_TREE_DEMO
          The name of the tree-demo scheme.
static java.lang.String MULTI_SIM_APPLET_INITIAL_FORMS
          Initial forms when running as applet.
static java.lang.String MULTI_SIM_APPLICATION_INITIAL_FORMS
          Initial forms when running as application.
static java.lang.String MULTI_SIM_STARTUP_MESSAGE
          The startup message.
static java.lang.String SHADY_JS_MULTI_SIM_API
          The name of the scheme bindings for the multi simulator api.
 
Fields inherited from class shady.common.ui.multi.MultiUI
DEFAULT_MULTI_APPNAME, DEFAULT_MULTI_JS_PROMPT, JS_CHAIN, multiShady, selectedIndex, SHADY_JS_MULTI_API, SHADY_JS_MULTI_EXTRA
 
Fields inherited from class shady.common.ui.UI
accountingDisplay, arg, BARREL_COLOR, BARREL_COLOR_SCHEME, box, controlsDisplay, DEFAULT_APPNAME, DEFAULT_BARREL_ANGLE, DEFAULT_CONNECTED_BARREL, DEFAULT_GRIPPER_STATE, DEFAULT_INVERT_CONNECTION_SENSE, DEFAULT_JS_PROMPT, DEFAULT_PATHFINDER_SEARCH_RADIUS_COEFFICIENT, DEFAULT_SEGMENT, DEFAULT_STARTUP_MESSAGE, DEFAULT_WHERE, environment, frame, graphicsDisplay, INITIAL_FORMS_MESSAGE, js, JS_COMMON_EXTRA, JS_INIT_FILENAME, JS_PATHFINDER, pathfinder, poseDisplay, replThread, shady, SHADY_JS_COMMON_API, stateDisplay, sunalg, UNSIGNED_APPLET_MSG
 
Constructor Summary
MultiSimUI()
          Covers MultiSimUI(String[]), no args.
MultiSimUI(java.lang.String[] arg)
          Make a new MultiSimUI.
 
Method Summary
 java.lang.String getAppletInitialForms()
          Initial scheme forms to eval at end of init in applet context.
protected  java.lang.String getApplicationInitialForms()
          Initial scheme forms to eval at end of init in application context.
 java.lang.String getAppname()
          Get the application name.
protected  ShadyPose getDefaultPose(Environment environment, int index)
          Get a the default pose for member at index in UI.environment.
 java.lang.String getJSchemePrompt()
          Get the JScheme interpreter prompt to use.
 java.lang.String getStartupMessage()
          Get the message to display before the first prompt in the JScheme interpreter.
protected  void loadJSchemeFiles()
          Load initial JScheme files iff UI.js is not null
static void main(java.lang.String[] arg)
          Application init.
protected  Environment makeDefaultEnvironment()
          Make a default environment to use if none is specified to the constructor.
protected  MultiShadyCommonAPI makeDefaultMultiShady(MultiEnvironment environment)
          Make a default MultiShady to use if none is specified to the constructor.
protected  ControlsDisplay makeMultiControlsDisplay(MultiShadyCommonAPI multiShady)
          Make the multi ControlsDisplay.
 
Methods inherited from class shady.common.ui.multi.MultiUI
getSelectedIndex, makeAccountingDisplay, makeControlsDisplay, makeDefaultShady, makeGraphicsDisplay, makeMultiGraphicsDisplay, makePathfinder, makePoseDisplay, makeStateDisplay, setJSGlobals, setSelectedIndex
 
Methods inherited from class shady.common.ui.UI
addAnnotation, addAnnotation, addAnnotation, addHotSpot, clearAnnotations, clearHotSpots, flashHotSpots, flashHotSpots, flashHotSpots, flashHotSpots, getBox, getCenterX, getCenterY, getClickPointCartesian, getDefaultBarrelAngle, getDefaultConnectedBarrel, getDefaultGripperState, getDefaultInvertConnectionSense, getDefaultSegment, getDefaultWhere, getGraphicsFPS, getGraphicsHeight, getGraphicsWidth, getJScheme, getPathfinderSearchRadiusCoeff, getStartupMessage, getZoom, isFlashOngoing, isGraphicsPaused, isTesserOngoing, loadJSchemeFile, loadJSchemeFileFromResource, mainImpl, makeDefaultPose, makeJScheme, makeSunalg, noGUI, packBox, pauseGraphics, removeAnnotation, removeHotSpot, resetWorldToView, resetWorldToView, resetWorldToView, resetWorldToView, resetWorldToView, setArrowLineWidth, setBoneLineWidth, setClickPointCartesian, setDefaultFrameFormat, setDrawBarrelArrows, setDrawBodyArrow, setDrawCCLineBody, setDrawLineBody, setDrawPaddles, setDrawShade, setEnableToolTip, setEnvironmentLineWidth, setGraphicsFPS, setGraphicsSize, setPaddleLineWidth, setRelativeLineWidth, setRenderFastest, setUseFaultColor, setVerboseGraphicsPerformance, sleep, startSavingFrames, startSavingFrames, startSavingFrames, stopSavingFrames, tesserTo, unPauseGraphics, unsetGraphicsSize, writeToFile, writeToFile, writeToFile, zoomWorldToView
 
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

DEFAULT_NUM_MEMBERS

public static final int DEFAULT_NUM_MEMBERS

Default number of MemberShadys.

See Also:
Constant Field Values

DEFAULT_MULTI_BARREL_ANGLE

public static final double[][] DEFAULT_MULTI_BARREL_ANGLE

Barrel angles in default pose (degrees).


DEFAULT_MULTI_GRIPPER_STATE

public static final double[][] DEFAULT_MULTI_GRIPPER_STATE

Gripper states in default pose.


DEFAULT_MULTI_CONNECTED_BARREL

public static final int[] DEFAULT_MULTI_CONNECTED_BARREL

Which gripper is connected in default pose.


DEFAULT_MULTI_SEGMENT

public static final int[] DEFAULT_MULTI_SEGMENT

Environment segment index connected in default pose.


DEFAULT_MULTI_WHERE

public static final double[] DEFAULT_MULTI_WHERE

Environment segment where connected in default pose (bottom of leftmost lower vertical).


DEFAULT_MULTI_INVERT_CONNECTION_SENSE

public static final boolean[] DEFAULT_MULTI_INVERT_CONNECTION_SENSE

Inverte connection sense of default pose.


APPNAME

public static final java.lang.String APPNAME

The default name of the application.

See Also:
Constant Field Values

SHADY_JS_MULTI_SIM_API

public static final java.lang.String SHADY_JS_MULTI_SIM_API

The name of the scheme bindings for the multi simulator api.

See Also:
Constant Field Values

JS_MULTI_SIM_EXTRA

public static final java.lang.String JS_MULTI_SIM_EXTRA

The name of the extra scheme for the multi simulator.

See Also:
Constant Field Values

JS_TOWER_DEMO

public static final java.lang.String JS_TOWER_DEMO

The name of the tower-demo scheme.

See Also:
Constant Field Values

JS_CHAIN_DEMO

public static final java.lang.String JS_CHAIN_DEMO

The name of the chain-demo scheme.

See Also:
Constant Field Values

JS_TREE_DEMO

public static final java.lang.String JS_TREE_DEMO

The name of the tree-demo scheme.

See Also:
Constant Field Values

JS_PROMPT

public static final java.lang.String JS_PROMPT

The JScheme prompt.

See Also:
Constant Field Values

API_URL

public static final java.lang.String API_URL

The JScheme API URL.

See Also:
Constant Field Values

MULTI_SIM_STARTUP_MESSAGE

public static final java.lang.String MULTI_SIM_STARTUP_MESSAGE

The startup message.

See Also:
Constant Field Values

MULTI_SIM_APPLICATION_INITIAL_FORMS

public static final java.lang.String MULTI_SIM_APPLICATION_INITIAL_FORMS

Initial forms when running as application.

See Also:
Constant Field Values

MULTI_SIM_APPLET_INITIAL_FORMS

public static final java.lang.String MULTI_SIM_APPLET_INITIAL_FORMS

Initial forms when running as applet.

See Also:
Constant Field Values
Constructor Detail

MultiSimUI

public MultiSimUI(java.lang.String[] arg)
           throws java.lang.Exception

Make a new MultiSimUI.

Throws:
java.lang.Exception

MultiSimUI

public MultiSimUI()
           throws java.lang.Exception

Covers MultiSimUI(String[]), no args.

Throws:
java.lang.Exception
Method Detail

getApplicationInitialForms

protected java.lang.String getApplicationInitialForms()

Initial scheme forms to eval at end of init in application context.

Default impl returns null (no forms).

This impl returns MULTI_SIM_APPLICATION_INITIAL_FORMS.

Overrides:
getApplicationInitialForms in class UI
Returns:
Initial scheme forms to eval at end of init in application context

getAppletInitialForms

public java.lang.String getAppletInitialForms()

Initial scheme forms to eval at end of init in applet context.

Default impl returns null (no forms).

This impl returns MULTI_SIM_APPLET_INITIAL_FORMS.

Overrides:
getAppletInitialForms in class UI
Returns:
Initial scheme forms to eval at end of init in applet context

getAppname

public java.lang.String getAppname()

Get the application name.

Default impl returns UI.DEFAULT_APPNAME.

This impl returns MultiUI.DEFAULT_MULTI_APPNAME.

This impl returns APPNAME.

Overrides:
getAppname in class MultiUI
Returns:
the application name

getJSchemePrompt

public java.lang.String getJSchemePrompt()

Get the JScheme interpreter prompt to use.

Default impl returns UI.DEFAULT_JS_PROMPT.

This impl returns MultiUI.DEFAULT_MULTI_JS_PROMPT.

This impl returns JS_PROMPT.

Overrides:
getJSchemePrompt in class MultiUI
Returns:
the JScheme interpreter prompt to use

getStartupMessage

public java.lang.String getStartupMessage()

Get the message to display before the first prompt in the JScheme interpreter.

Default impl returns UI.DEFAULT_STARTUP_MESSAGE.

This impl returns MULTI_SIM_STARTUP_MESSAGE.

Overrides:
getStartupMessage in class UI
Returns:
the message to display before the first prompt in the JScheme interpreter, null for none

makeDefaultMultiShady

protected MultiShadyCommonAPI makeDefaultMultiShady(MultiEnvironment environment)

Make a default MultiShady to use if none is specified to the constructor.

This impl makes a MultiShadySim with DEFAULT_NUM_MEMBERS at poses given by getDefaultPose(Environment, int).

Specified by:
makeDefaultMultiShady in class MultiUI
Parameters:
environment - the MultiEnvironment, null if none
Returns:
a default MultiShady to use if none is specified to the constructor

makeDefaultEnvironment

protected Environment makeDefaultEnvironment()

Make a default environment to use if none is specified to the constructor.

Default impl returns null.

This impl makes a default MultiEnvironment.

Overrides:
makeDefaultEnvironment in class UI
Returns:
a default environment to use if none is specified to the constructor

makeMultiControlsDisplay

protected ControlsDisplay makeMultiControlsDisplay(MultiShadyCommonAPI multiShady)

Make the multi ControlsDisplay.

This is a hook so subclasses can use a specialized display or disable it.

Default impl returns null.

This impl makes a MultiSimControlsDisplay.

Overrides:
makeMultiControlsDisplay in class MultiUI
Parameters:
multiShady - the MultiShady to display
Returns:
the display, null for none

loadJSchemeFiles

protected void loadJSchemeFiles()

Load initial JScheme files iff UI.js is not null

Default impl loads UI.SHADY_JS_COMMON_API, UI.JS_COMMON_EXTRA, and UI.JS_PATHFINDER.

This impl also loads MultiUI.SHADY_JS_MULTI_API, MultiUI.SHADY_JS_MULTI_EXTRA, and MultiUI.JS_CHAIN.

This impl calls superclass impl then loads SimUI.SHADY_JS_SIM_API, SimUI.JS_SIM_EXTRA, SHADY_JS_MULTI_SIM_API, JS_MULTI_SIM_EXTRA, JS_TOWER_DEMO, JS_CHAIN_DEMO, and JS_TREE_DEMO.

Overrides:
loadJSchemeFiles in class MultiUI

getDefaultPose

protected ShadyPose getDefaultPose(Environment environment,
                                   int index)

Get a the default pose for member at index in UI.environment.

Uses the various DEFAULT_MULTI_* settings.

Parameters:
environment - the Environment, null if none
index - the member index

main

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

Application init.