IcanGui
Class GuiMain

java.lang.Object
  extended by IcanGui.GuiHierarchy
      extended by IcanGui.GuiWindow
          extended by IcanGui.GuiMain
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.util.EventListener

public class GuiMain
extends GuiWindow
implements java.awt.event.ActionListener, java.awt.event.KeyListener

Display the steps used and wait for the user to choose the next one. This class will eventually be eliminated and replaced by an automatic procedure that automatically goes to the next step.

Since:
1.0;
Version:
1.1.16;
Updated by Louis Handler on Dec 14, 2007, 08:03 EST (1.1.16).
Updated by Louis Handler on Jul 19, 2006, 10:29 EDT (1.1.9).
Updated by Louis Handler on Dec 28, 2005, 13:50 EST (1.1.6).
Updated by Louis Handler on Jul 8, 2005, 09:39 EDT (1.1.5).
Updated by Louis Handler on Jan 3, 2005, 09:02 EST (1.1.0).
Updated by Louis Handler on Oct 13, 2004, 12:22 EDT (1.0.7).
Updated by Louis Handler on Apr 26, 2004, 15:24 EDT (1.0.6).
Updated by Louis Handler on Apr 9, 2004, 12:27 EDT.
Updated by Louis Handler on Sep 25, 2003, 14:50 EDT.
Updated by Louis Handler on Oct 24, 2002, 08:22 EDT.
Updated by Louis Handler on Nov 20, 2000, 15:18 EST.
Updated by Louis Handler on Jul 27, 2000, 13:47 EDT.
Updated by Louis Handler on Mar 13, 2000, 14:09 EST.
Updated by Louis Handler on Feb 24, 2000, 14:42 EST.
Updated by Louis Handler on Dec 29, 1999, 10:49 EST.
Updated by Louis Handler on Jan 4, 1999, 11:37 EST.
Updated by Louis Handler on Dec 14, 1998, 14:12 EST.
Updated by Louis Handler on Dec 2, 1998, 16:29 EST.
Updated by Louis Handler on Nov 23, 1998, 10:40 EST.
Updated by Louis Handler on Nov 5, 1998, 10:07 EST.
Updated by Louis Handler on Oct 27, 1998, 14:42 EST.
Updated by Matthew Der on Jul 9, 1998.
Updated by Louis Handler on Jul 7, 1998.
Updated by Matthew Der on Jun 23, 1998.
Updated by Steve Gnepp on Jun 18, 1998.
Updated by Steve Gnepp on Feb 23, 1998.
Updated by Louis Handler on Jan 28, 1998.
Updated by Steve Gnepp on Jan 26, 1998.
Author:
Louis Handler
See Also:
GuiWindow

Nested Class Summary
(package private)  class GuiMain.Madapter
          Mouse Adapter Inner Class
 
Field Summary
private  java.lang.String browserPath
          Full path to browser.
private  java.awt.Button[] bSteps
          Array of Buttons used to perform ICAN/JAVA processing.
private  boolean firstRun
          Variable to test for the first time the frame is displayed.
private static int istep1
          Subscript of step 1.
private static int istep2
          Subscript of step 2.
private static int istep3
          Subscript of step 3.
private static int istep4
          Subscript of step 4.
private static int istep5
          Subscript of step 5.
private static int istep6
          Subscript of step 6.
private  int[] levels
          Pointer to current menu in level from which sublevel begins.
private static int maxLevels
          Maximum number of levels in menu structure.
private  int maxMs
          Number of menus containing menu items.
private static int[] mDisable
          Menu item to enable/disable if non-negative.
private  java.awt.MenuItem[] miMenu
          Array of menu items created from the table of menu string items.
private  java.awt.Menu[] mMenu
          Array of menus created from the table of menu string items.
private static int nButtons
          Number of Buttons/Labels.
private  java.lang.String NEW_LINE
          New-line for concatenating so constant doesn't have to be redefined within loop.
private static int nMenuItem
          Number of items in the table of menu string items.
private static int nShortcutKey
          Number of shortcut keys; i.e., the number of alphabetic characters on the standard English keyboard.
private  java.awt.Component saveCompFocus
          Component to set focus to.
private static int[] shortcutKey
          Shortcut keys for corresponding letters (alphabetic characters).
private static java.lang.String[] shortcutKeyAlpha
          Letters (alphabetic characters) in table for shortcut keys.
private static java.lang.String[][] sMenu
          Array of Strings to be used as Labels for Menu.
private static java.lang.String[] sSteps
          Array of Strings to be used as Labels for Buttons.
private static int[] wDisable
          Array contains the step subscript to disable/enable after clicking on a button.
 
Fields inherited from class IcanGui.GuiWindow
frameTitle, whatAmI, windowFrame
 
Fields inherited from class IcanGui.GuiHierarchy
IDO_ICAN_DATA, IDO_ICAN_DATA_BOOLEANS, IDO_ICAN_DATA_DAMPING, IDO_ICAN_DATA_IMPACT, IDO_ICAN_DATA_LOADS, IDO_ICAN_DATA_MATERIAL, IDO_ICAN_DATA_OUTPUTS, IDO_ICAN_DATA_PLOT_IMPACT, IDO_ICAN_DATA_PLOTPL, IDO_ICAN_DATA_PLY, IDO_ICAN_DATA_PROCESS, IDO_ICAN_DATA_REACTION, IDO_ICAN_DATA_SLICE, IDO_ICAN_DATA_SLICE_TABLE, IDO_ICAN_DATA_VVI, IDO_ICAN_DATA_VVR, IDO_ICAN_ELECTRICAL_CYCLIC_LOADS, IDO_ICAN_ELECTRICAL_STATIC_LOADS, IDO_ICAN_EXPERT, IDO_ICAN_HYGRAL_CYCLIC_LOADS, IDO_ICAN_HYGRAL_STATIC_LOADS, IDO_ICAN_MECH_CYCLIC_LOADS, IDO_ICAN_MECH_STATIC_DISPLACEMENTS, IDO_ICAN_MECH_STATIC_LOADS, IDO_ICAN_MORE_LOADS, IDO_ICAN_PROMPT, IDO_ICAN_RATE_LOADS, IDO_ICAN_THERMAL_CYCLIC_LOADS, IDO_ICAN_THERMAL_STATIC_LOADS, IDO_MAIN, IDO_MDB_DATA_MFIM, IDO_MDB_DATA_START, IDO_MDB_PROMPT, IDO_MSG_DATA, NDO
 
Constructor Summary
GuiMain()
          Constructor creates window to display buttons.
 
Method Summary
static void aboutMe()
           
 void actionPerformed(java.awt.event.ActionEvent evt)
          Detect Action Events and process accordingly.
private  void adjustFontSize()
          Adjust Font size.
private  void changeBrowser()
           
 void changeGuiUnits()
          Change units on GUI for this class.
private  void changeSave()
          Change save option that controls whether to try saving or printing.
private  void changeUnits()
          Change units to use either English units or SI units.
 void disableAllSteps()
          Disable all buttons for which it is possible.
 void disableStep(int iStep)
          Disable the button corresponding to the specified step number.
 void enableStep(int iStep)
          Enable the button corresponding to the specified step number.
 java.lang.String getName()
          Get class name.
 void helpMe()
          Display help message.
 void helpMe(java.awt.Component target)
          Display context-sensitive help.
protected  void initMe()
          Create window to display buttons.
 void keyPressed(java.awt.event.KeyEvent evt)
          Does Nothing
 void keyReleased(java.awt.event.KeyEvent evt)
          Detects when the following keys are released Tab, up arrow, down arrow, enter, shift+tab, alt+right, alt+left, F1
 void keyTyped(java.awt.event.KeyEvent evt)
          Does Nothing
 void presetData()
          Set title and other ICAN/JAVA data.
 java.lang.String readDataFile(java.lang.String fileName)
          Read a specified file into a single String to display.
 void saveIcanInputs()
          Save ICAN/JAVA input data.
private  void saveJournal()
          Save journal up to this point.
 void setCompFocus()
          Set focus to some component.
 void setCompFocus(java.awt.Component cFocus)
          Set focus in current class/frame.
private  void showJournal()
          Show journal up to this point.
private  void showWebDocumentation()
          Show web documentation using Netscape.
 
Methods inherited from class IcanGui.GuiWindow
addGB, askExit, askQuestion, showMessageInfo
 
Methods inherited from class IcanGui.GuiHierarchy
changeAllGuiUnits, exitGui, getCurrent, getFrame, getFrame, getGuiWindowClass, getGuiWindowClass, hideMe, initHierarchy, setCurrent, setNextUp, showMe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sMenu

private static final java.lang.String[][] sMenu
Array of Strings to be used as Labels for Menu.
1. Text of menu or menu item.
2. Type of menu in menubar.
3. "M" for menu, "H" for help menu (must be at top level), "I" for menu item, "-" for separator, "." for end of menu items in this menu.
4. Shortcut key, if used; else, "-".


nMenuItem

private static final int nMenuItem
Number of items in the table of menu string items.


miMenu

private java.awt.MenuItem[] miMenu
Array of menu items created from the table of menu string items.

See Also:
sMenu

shortcutKeyAlpha

private static final java.lang.String[] shortcutKeyAlpha
Letters (alphabetic characters) in table for shortcut keys. Key used is combination of control (Ctrl) key and the letter indicated.

See Also:
shortcutKey

shortcutKey

private static final int[] shortcutKey
Shortcut keys for corresponding letters (alphabetic characters). Key used is combination of control (Ctrl) key and the letter indicated.

See Also:
shortcutKeyAlpha

nShortcutKey

private static final int nShortcutKey
Number of shortcut keys; i.e., the number of alphabetic characters on the standard English keyboard.


maxLevels

private static final int maxLevels
Maximum number of levels in menu structure.

See Also:
Constant Field Values

levels

private int[] levels
Pointer to current menu in level from which sublevel begins. Menu items are associated with this menu. This is used only within initMe() and could be moved down into initMe().


maxMs

private int maxMs
Number of menus containing menu items. After initialization, maxMs is the same as mMenu.length.


mMenu

private java.awt.Menu[] mMenu
Array of menus created from the table of menu string items.

See Also:
sMenu

sSteps

private static final java.lang.String[] sSteps
Array of Strings to be used as Labels for Buttons.


istep1

private static final int istep1
Subscript of step 1.

See Also:
Constant Field Values

istep2

private static final int istep2
Subscript of step 2.

See Also:
Constant Field Values

istep3

private static final int istep3
Subscript of step 3.

See Also:
Constant Field Values

istep4

private static final int istep4
Subscript of step 4.

See Also:
Constant Field Values

istep5

private static final int istep5
Subscript of step 5.

See Also:
Constant Field Values

istep6

private static final int istep6
Subscript of step 6.

See Also:
Constant Field Values

nButtons

private static final int nButtons
Number of Buttons/Labels.


wDisable

private static final int[] wDisable
Array contains the step subscript to disable/enable after clicking on a button. For example, you can't run ICAN/JAVA or save the ICAN/JAVA input data until after getting the ICAN/JAVA input data.


mDisable

private static final int[] mDisable
Menu item to enable/disable if non-negative. This may correspond to a button.

See Also:
wDisable

bSteps

private java.awt.Button[] bSteps
Array of Buttons used to perform ICAN/JAVA processing.


firstRun

private boolean firstRun
Variable to test for the first time the frame is displayed. Used to set focus on entry.


saveCompFocus

private java.awt.Component saveCompFocus
Component to set focus to.


browserPath

private java.lang.String browserPath
Full path to browser. Input by user to override defaults.


NEW_LINE

private java.lang.String NEW_LINE
New-line for concatenating so constant doesn't have to be redefined within loop.

Constructor Detail

GuiMain

public GuiMain()
Constructor creates window to display buttons.

Method Detail

initMe

protected void initMe()
Create window to display buttons. The buttons encapsulate the steps required to run all parts of the application/applet.

Specified by:
initMe in class GuiWindow

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Detect Action Events and process accordingly.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
evt - Action event.

aboutMe

public static void aboutMe()

disableAllSteps

public void disableAllSteps()
Disable all buttons for which it is possible.


disableStep

public void disableStep(int iStep)
Disable the button corresponding to the specified step number.

Parameters:
iStep - Step subscript to enable.

enableStep

public void enableStep(int iStep)
Enable the button corresponding to the specified step number.

Parameters:
iStep - Step subscript to enable.

adjustFontSize

private void adjustFontSize()
Adjust Font size.


changeUnits

private void changeUnits()
Change units to use either English units or SI units.


showJournal

private void showJournal()
Show journal up to this point.


saveJournal

private void saveJournal()
Save journal up to this point.


changeSave

private void changeSave()
Change save option that controls whether to try saving or printing.


changeBrowser

private void changeBrowser()

saveIcanInputs

public void saveIcanInputs()
Save ICAN/JAVA input data.


readDataFile

public java.lang.String readDataFile(java.lang.String fileName)
Read a specified file into a single String to display.

Parameters:
fileName - Name of file or URL from which data is obtained.
Returns:
Data from specified file or URL, combined into a single string. Lines are separated by "\n".

showWebDocumentation

private void showWebDocumentation()
Show web documentation using Netscape.


keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
Does Nothing

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
evt - Key event.

keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
Does Nothing

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
evt - Key event.

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
Detects when the following keys are released Tab, up arrow, down arrow, enter, shift+tab, alt+right, alt+left, F1

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
evt - Key event.

helpMe

public void helpMe()
Display help message.


helpMe

public void helpMe(java.awt.Component target)
Display context-sensitive help. Display help message for a specified component.

Specified by:
helpMe in class GuiWindow
Parameters:
target - Component for which help is desired.

setCompFocus

public void setCompFocus()
Set focus to some component. Normally used when entering this screen after show().

Specified by:
setCompFocus in class GuiHierarchy

setCompFocus

public void setCompFocus(java.awt.Component cFocus)
Set focus in current class/frame.

Specified by:
setCompFocus in class GuiHierarchy
Parameters:
cFocus - Component to save to reset later.

presetData

public void presetData()
Set title and other ICAN/JAVA data.

Specified by:
presetData in class GuiWindow

changeGuiUnits

public void changeGuiUnits()
Change units on GUI for this class. Invoked when user changes units.

Specified by:
changeGuiUnits in class GuiWindow

getName

public java.lang.String getName()
Get class name.

Specified by:
getName in class GuiWindow
Returns:
Class name.