shady.sim.ui
Class SimUI

java.lang.Object
  extended by shady.common.ui.UI
      extended by shady.sim.ui.SimUI

public class SimUI
extends UI

Shady 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 java.lang.String JS_PROMPT
          The JScheme prompt.
static java.lang.String JS_SIM_EXTRA
          The name of the extra scheme for the simulator.
static java.lang.String SHADY_JS_SIM_API
          The name of the scheme bindings for the simulator api.
static java.lang.String SIM_APPLET_INITIAL_FORMS
          Initial forms when running as applet.
static java.lang.String SIM_APPLICATION_INITIAL_FORMS
          Initial forms when running as application.
static java.lang.String SIM_STARTUP_MESSAGE
          The startup message.
 
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
SimUI()
          Covers SimUI(String[]), no args.
SimUI(java.lang.String[] arg)
          Make a new SimUI.
 
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.
 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  ControlsDisplay makeControlsDisplay(ShadyCommonAPI shady)
          Make the controls display.
protected  Environment makeDefaultEnvironment()
          Make a default environment to use if none is specified to the constructor.
protected  ShadyCommonAPI makeDefaultShady(Environment environment)
          Make a default shady to use if none is specified to the constructor.
 
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, makeAccountingDisplay, makeDefaultPose, makeGraphicsDisplay, makeJScheme, makePathfinder, makePoseDisplay, makeStateDisplay, 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, setJSGlobals, 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

APPNAME

public static final java.lang.String APPNAME

The default name of the application.

See Also:
Constant Field Values

SHADY_JS_SIM_API

public static final java.lang.String SHADY_JS_SIM_API

The name of the scheme bindings for the simulator api.

See Also:
Constant Field Values

JS_SIM_EXTRA

public static final java.lang.String JS_SIM_EXTRA

The name of the extra scheme for the simulator.

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

SIM_STARTUP_MESSAGE

public static final java.lang.String SIM_STARTUP_MESSAGE

The startup message.

See Also:
Constant Field Values

SIM_APPLICATION_INITIAL_FORMS

public static final java.lang.String SIM_APPLICATION_INITIAL_FORMS

Initial forms when running as application.

See Also:
Constant Field Values

SIM_APPLET_INITIAL_FORMS

public static final java.lang.String SIM_APPLET_INITIAL_FORMS

Initial forms when running as applet.

See Also:
Constant Field Values
Constructor Detail

SimUI

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

Make a new SimUI.

Throws:
java.lang.Exception

SimUI

public SimUI()
      throws java.lang.Exception

Covers SimUI(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 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 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 APPNAME.

Overrides:
getAppname in class UI
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 JS_PROMPT.

Overrides:
getJSchemePrompt in class UI
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 SIM_STARTUP_MESSAGE.

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

makeDefaultShady

protected ShadyCommonAPI makeDefaultShady(Environment environment)
                                   throws java.lang.Exception

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

This impl makes a ShadySim with UI.makeDefaultPose(shady.common.Environment).

Specified by:
makeDefaultShady in class UI
Parameters:
environment - the Environment, null if none
Returns:
a default shady to use if none is specified to the constructor
Throws:
java.lang.Exception

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 Environment.

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

makeControlsDisplay

protected ControlsDisplay makeControlsDisplay(ShadyCommonAPI shady)

Make the controls display.

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

Default impl returns a new ControlsDisplay.

This impl makes a SimControlsDisplay.

Overrides:
makeControlsDisplay in class UI
Parameters:
shady - the shady 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 calls superclass impl then loads SHADY_JS_SIM_API and JS_SIM_EXTRA.

Overrides:
loadJSchemeFiles in class UI

main

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

Application init.