shady.common.ui.multi
Class MultiUI

java.lang.Object
  extended by shady.common.ui.UI
      extended by shady.common.ui.multi.MultiUI
Direct Known Subclasses:
MultiSimUI

public abstract class MultiUI
extends UI

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

Author:
Marsette (Marty) A. Vona, III, Peter Osagie

Field Summary
private static java.lang.String cvsid
           
static java.lang.String DEFAULT_MULTI_APPNAME
          The default name of the application.
static java.lang.String DEFAULT_MULTI_JS_PROMPT
          The default JScheme prompt.
static java.lang.String JS_CHAIN
          The name of the chain scheme.
protected  MultiShadyCommonAPI multiShady
          The MultiShady.
protected  int selectedIndex
          Index of the currently selected member (which UI.shady references), or negative if none (shady null).
static java.lang.String SHADY_JS_MULTI_API
          The name of the scheme bindings for the multi api.
static java.lang.String SHADY_JS_MULTI_EXTRA
          The name of the scheme bindings for the multi extra stuff.
 
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
MultiUI()
          Covers MultiUI(String[]), no args.
MultiUI(MultiEnvironment environment, MultiShadyCommonAPI multiShady, int selectedIndex, java.lang.String[] arg)
          Create a new MultiUI.
MultiUI(java.lang.String[] arg)
          Covers MultiUI(MultiEnvironment, MultiShadyCommonAPI, int, String[]), always makeDefaultMultiShady(shady.common.multi.MultiEnvironment) and UI.makeDefaultEnvironment() and select no member.
 
Method Summary
protected  java.lang.String getAppname()
          Get the application name.
 java.lang.String getJSchemePrompt()
          Get the JScheme interpreter prompt to use.
 int getSelectedIndex()
          Get the index of the current selected MemberShady, if any.
protected  void loadJSchemeFiles()
          Load initial JScheme files iff UI.js is not null
protected  AccountingDisplay makeAccountingDisplay(ShadyCommonAPI shady)
          This impl returns null.
protected  ControlsDisplay makeControlsDisplay(ShadyCommonAPI shady)
          Make the controls display.
protected abstract  MultiShadyCommonAPI makeDefaultMultiShady(MultiEnvironment environment)
          Make a default MultiShady 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.
protected  GraphicsDisplay makeGraphicsDisplay(ShadyCommonAPI shady, Environment environment)
          Make the graphics display.
protected  ControlsDisplay makeMultiControlsDisplay(MultiShadyCommonAPI multiShady)
          Make the multi ControlsDisplay.
protected  MultiGraphicsDisplay makeMultiGraphicsDisplay(MultiShadyCommonAPI multiShady, MultiEnvironment environment)
          Make the MultiGraphicsDisplay.
protected  Pathfinder makePathfinder(ShadyCommonAPI shady, Environment environment, GraphicsDisplay graphicsDisplay)
          This impl returns null.
protected  PoseDisplay makePoseDisplay(ShadyCommonAPI shady, GraphicsDisplay graphicsDisplay)
          Make the pose display.
protected  StateDisplay makeStateDisplay(ShadyCommonAPI shady)
          Make the state display.
protected  void setJSGlobals(jscheme.JScheme js)
          Bind global JScheme values.
 void setSelectedIndex(int index)
          Set the index of the current selected MemberShady.
 
Methods inherited from class shady.common.ui.UI
addAnnotation, addAnnotation, addAnnotation, addHotSpot, clearAnnotations, clearHotSpots, flashHotSpots, flashHotSpots, flashHotSpots, flashHotSpots, getAppletInitialForms, getApplicationInitialForms, getBox, getCenterX, getCenterY, getClickPointCartesian, getDefaultBarrelAngle, getDefaultConnectedBarrel, getDefaultGripperState, getDefaultInvertConnectionSense, getDefaultSegment, getDefaultWhere, getGraphicsFPS, getGraphicsHeight, getGraphicsWidth, getJScheme, getPathfinderSearchRadiusCoeff, getStartupMessage, getStartupMessage, getZoom, isFlashOngoing, isGraphicsPaused, isTesserOngoing, loadJSchemeFile, loadJSchemeFileFromResource, mainImpl, makeDefaultEnvironment, 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_MULTI_APPNAME

public static final java.lang.String DEFAULT_MULTI_APPNAME

The default name of the application.

See Also:
Constant Field Values

SHADY_JS_MULTI_API

public static final java.lang.String SHADY_JS_MULTI_API

The name of the scheme bindings for the multi api.

See Also:
Constant Field Values

SHADY_JS_MULTI_EXTRA

public static final java.lang.String SHADY_JS_MULTI_EXTRA

The name of the scheme bindings for the multi extra stuff.

See Also:
Constant Field Values

DEFAULT_MULTI_JS_PROMPT

public static final java.lang.String DEFAULT_MULTI_JS_PROMPT

The default JScheme prompt.

See Also:
Constant Field Values

JS_CHAIN

public static final java.lang.String JS_CHAIN

The name of the chain scheme.

See Also:
Constant Field Values

multiShady

protected MultiShadyCommonAPI multiShady

The MultiShady.


selectedIndex

protected int selectedIndex

Index of the currently selected member (which UI.shady references), or negative if none (shady null).

Constructor Detail

MultiUI

public MultiUI(MultiEnvironment environment,
               MultiShadyCommonAPI multiShady,
               int selectedIndex,
               java.lang.String[] arg)
        throws java.lang.Exception

Create a new MultiUI.

Everything is init from the various make*() methods.

Parameters:
environment - the mechanism's environment, if null then UI.makeDefaultEnvironment()
multiShady - the MultiShady with which to interact, if null then makeDefaultMultiShady(shady.common.multi.MultiEnvironment)
selectedIndex - the index of the initial selected member in multiShady, negative for none
arg - the arguments that were passed to main, null if applet
Throws:
java.lang.Exception

MultiUI

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

Covers MultiUI(MultiEnvironment, MultiShadyCommonAPI, int, String[]), always makeDefaultMultiShady(shady.common.multi.MultiEnvironment) and UI.makeDefaultEnvironment() and select no member.

Throws:
java.lang.Exception

MultiUI

public MultiUI()
        throws java.lang.Exception

Covers MultiUI(String[]), no args.

Throws:
java.lang.Exception
Method Detail

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 returns null, see makeDefaultMultiShady(shady.common.multi.MultiEnvironment).

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

makeDefaultMultiShady

protected abstract MultiShadyCommonAPI makeDefaultMultiShady(MultiEnvironment environment)

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

Parameters:
environment - the MultiEnvironment, null if none
Returns:
a default MultiShady to use if none is specified to the constructor

makeStateDisplay

protected StateDisplay makeStateDisplay(ShadyCommonAPI shady)

Make the state display.

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

Default impl returns a new StateDisplay.

This impl returns null.

Overrides:
makeStateDisplay in class UI
Parameters:
shady - the shady to display
Returns:
the display, null for none

makeGraphicsDisplay

protected GraphicsDisplay makeGraphicsDisplay(ShadyCommonAPI shady,
                                              Environment environment)

Make the graphics display.

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

Default impl returns a new GraphicsDisplay.

This impl returns null, see makeMultiGraphicsDisplay(shady.common.multi.MultiShadyCommonAPI, shady.common.multi.MultiEnvironment).

Overrides:
makeGraphicsDisplay in class UI
Parameters:
shady - the shady to display
environment - the environment if any
Returns:
the display, null for none

makeMultiGraphicsDisplay

protected MultiGraphicsDisplay makeMultiGraphicsDisplay(MultiShadyCommonAPI multiShady,
                                                        MultiEnvironment environment)

Make the MultiGraphicsDisplay.

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

Default impl returns a new MultiGraphicsDisplay.

Parameters:
multiShady - the MultiShady to display
environment - the environment if any
Returns:
the display, null for none

makePoseDisplay

protected PoseDisplay makePoseDisplay(ShadyCommonAPI shady,
                                      GraphicsDisplay graphicsDisplay)

Make the pose display.

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

Default impl returns a new PoseDisplay.

This impl returns null.

Overrides:
makePoseDisplay in class UI
Parameters:
shady - the shady to display
Returns:
the display, null for none

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 returns null, see makeMultiGraphicsDisplay(shady.common.multi.MultiShadyCommonAPI, shady.common.multi.MultiEnvironment).

Overrides:
makeControlsDisplay in class UI
Parameters:
shady - the shady to display
Returns:
the display, null for none

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.

Parameters:
multiShady - the MultiShady to display
Returns:
the display, null for none

makeAccountingDisplay

protected AccountingDisplay makeAccountingDisplay(ShadyCommonAPI shady)

This impl returns null.

Overrides:
makeAccountingDisplay in class UI
Parameters:
shady - the shady to display
Returns:
the display, null for none

makePathfinder

protected Pathfinder makePathfinder(ShadyCommonAPI shady,
                                    Environment environment,
                                    GraphicsDisplay graphicsDisplay)

This impl returns null.

Overrides:
makePathfinder in class UI
Parameters:
shady - the shady
environment - the Environment, null if none
graphicsDisplay - the GraphicsDisplay, null if none
Returns:
the pathfinder, null for none

setSelectedIndex

public void setSelectedIndex(int index)

Set the index of the current selected MemberShady.

Parameters:
index - the zero-based index of the current selected MemberShady, negative or >= nummembers to unset

getSelectedIndex

public int getSelectedIndex()

Get the index of the current selected MemberShady, if any.

Returns:
the zero-based index of the current selected MemberShady, negative if none

setJSGlobals

protected void setJSGlobals(jscheme.JScheme js)

Bind global JScheme values.

Overrides:
setJSGlobals in class UI

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 SHADY_JS_MULTI_API, SHADY_JS_MULTI_EXTRA, and JS_CHAIN.

Overrides:
loadJSchemeFiles in class UI

getJSchemePrompt

public java.lang.String getJSchemePrompt()

Get the JScheme interpreter prompt to use.

Default impl returns UI.DEFAULT_JS_PROMPT.

This impl returns DEFAULT_MULTI_JS_PROMPT.

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

getAppname

protected java.lang.String getAppname()

Get the application name.

Default impl returns UI.DEFAULT_APPNAME.

This impl returns DEFAULT_MULTI_APPNAME.

Overrides:
getAppname in class UI
Returns:
the application name