IcanGui
Class GuiIcanDataOutputs

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

public class GuiIcanDataOutputs
extends GuiWindow
implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.FocusListener

Encapsulate the behavior of GUI for ICAN/JAVA data entry of output data.

Since:
1.0;
Version:
1.1.15;
Updated by Louis Handler on Dec 12, 2007, 13:14 EST (1.1.15).
Updated by Louis Handler on Jan 4, 2007, 07:44 EST (1.1.14).
Updated by Louis Handler on Jul 27, 2005, 09:42 EDT (1.1.6).
Updated by Louis Handler on Jul 19, 2005, 08:14 EDT (1.1.5).
Updated by Louis Handler on Oct 22, 2002, 08:31 EDT.
Updated by Louis Handler on Aug 27, 2002, 10:40 EDT.
Updated by Louis Handler on Nov 20, 2000, 15:10 EST.
Updated by Louis Handler on Sep 11, 2000, 15:46 EDT.
Updated by Louis Handler on Mar 30, 2000, 09:23 EST.
Updated by Louis Handler on Feb 22, 2000, 15:02 EST.
Updated by Louis Handler on Nov 16, 1999, 15:29 EST.
Updated by Louis Handler on Dec 1, 1998, 10:15 EST.
Updated by Louis Handler on Nov 23, 1998, 10:35 EST.
Updated by Louis Handler on Nov 6, 1998, 08:30 EST.
Updated by Louis Handler on Nov 3, 1998, 13:20 EST.
Updated by Louis Handler on Sep 2, 1998, 16:19 EDT.
Updated by Louis Handler on Aug 28, 1998, 13:40 EDT.
Updated by Louis Handler on Aug 14, 1998, 15:28 EDT.
Updated by Matthew Der on Jul 15, 1998.
Updated by Matthew Der on Jun 24, 1998.
Updated by Louis Handler on Jun 18, 1998.
Author:
Louis Handler
See Also:
GuiWindow

Nested Class Summary
(package private)  class GuiIcanDataOutputs.Madapter
          Mouse Adapter Inner Class
 
Field Summary
private static java.lang.String[] buttonLabels
          Labels to display on action buttons.
private  java.awt.Button[] buttons
          Action buttons.
private  java.awt.Checkbox[] cPRINTs
          Array of Checkboxes for Output options.
private  IcanDataSet data
          ICAN/JAVA data set.
private  boolean firstRun
          Variable to test for the first time the frame is displayed.
private static int iAccept
          Accept Button will verify the data and complete the processing of Output data.
private static int iCancel
          Cancel Button will exit this screen discarding any data entered.
private static int iExit
          Exit Button will exit the entire program.
private static int iGetDef
          "Reset to Defaults" Button Reset current values of Outputs to default values.
private static int iHelp
          Help Button will display a set of information.
private static int iSaveDef
          "Save as Defaults" Button Save current values of Outputs as defaults.
private  java.awt.Label[] lPRINTc
          Array of Labels for Output option placeholders.
private  java.awt.Label[] lPRINTs
          Array of Labels corresponding to each Output option Label is separated from the corresponding checkbox so that the Label can be left justified.
private static int nButtons
          Number of action buttons.
private  java.awt.Panel panelFrame
          The Panel that contains the data to be displayed within a scrolling frame.
private  java.awt.Panel[] pPRINTc
          Array of Panels corresponding to each Output option, each of which contains one checkbox, right or left justified.
private  java.awt.Panel[] pPRINTs
          Array of Panels corresponding to each Output option, each of which contains one checkbox and one label.
private  java.awt.Component saveCompFocus
          Component to set focus to.
private  java.awt.ScrollPane scrollFrame
          The scrolling frame in which the data is displayed.
private  java.awt.Label theTitle
          Label containing the description/title of the ICAN/JAVA run.
 
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
GuiIcanDataOutputs()
          Constructor creates window to display buttons and checkbox entry fields.
 
Method Summary
private  boolean acceptOutputs()
          Check whether output options are valid.
 void actionPerformed(java.awt.event.ActionEvent evt)
          Detect Action Events and process accordingly.
 void changeGuiUnits()
          Change units on GUI for this class.
 void fixCheckboxes(java.awt.Checkbox checkBox)
          Determine which Checkbox was chosen, whether it was set on or off, and process accordingly.
 void focusGained(java.awt.event.FocusEvent evt)
          Detects When the Focus is Gained in a TextField
 void focusLost(java.awt.event.FocusEvent evt)
          Does Nothing
 java.lang.String getName()
          Get class name.
 void helpMe()
          Display help message.
 void helpMe(java.awt.Component target)
          Display help message for a specified component.
protected  void initMe()
          Create window to display buttons and checkbox entry fields.
 void itemStateChanged(java.awt.event.ItemEvent evt)
          Determine which Checkbox was chosen and process accordingly.
 void keyPressed(java.awt.event.KeyEvent evt)
          Process up/down arrow keys so that they do not work twice.
 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 and enable buttons.
private  void resetDefaults()
          Reset current values of Outputs to default values.
private  void saveDefaults()
          Save current values of Outputs as defaults.
 void setCompFocus()
          Set focus to some component.
 void setCompFocus(java.awt.Component cFocus)
          Set focus in current class/frame.
 
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

data

private IcanDataSet data
ICAN/JAVA data set.


theTitle

private java.awt.Label theTitle
Label containing the description/title of the ICAN/JAVA run.


iAccept

private static final int iAccept
Accept Button will verify the data and complete the processing of Output data.

See Also:
Constant Field Values

iCancel

private static final int iCancel
Cancel Button will exit this screen discarding any data entered.

See Also:
Constant Field Values

iExit

private static final int iExit
Exit Button will exit the entire program. To exit just this screen, see Accept or Cancel.

See Also:
Constant Field Values

iGetDef

private static final int iGetDef
"Reset to Defaults" Button Reset current values of Outputs to default values.

See Also:
Constant Field Values

iHelp

private static final int iHelp
Help Button will display a set of information.

See Also:
Constant Field Values

iSaveDef

private static final int iSaveDef
"Save as Defaults" Button Save current values of Outputs as defaults.

See Also:
Constant Field Values

buttonLabels

private static final java.lang.String[] buttonLabels
Labels to display on action buttons.


nButtons

private static final int nButtons
Number of action buttons.


buttons

private java.awt.Button[] buttons
Action buttons.


scrollFrame

private java.awt.ScrollPane scrollFrame
The scrolling frame in which the data is displayed.


panelFrame

private java.awt.Panel panelFrame
The Panel that contains the data to be displayed within a scrolling frame.


lPRINTc

private java.awt.Label[] lPRINTc
Array of Labels for Output option placeholders.


cPRINTs

private java.awt.Checkbox[] cPRINTs
Array of Checkboxes for Output options.


pPRINTc

private java.awt.Panel[] pPRINTc
Array of Panels corresponding to each Output option, each of which contains one checkbox, right or left justified.


pPRINTs

private java.awt.Panel[] pPRINTs
Array of Panels corresponding to each Output option, each of which contains one checkbox and one label.


lPRINTs

private java.awt.Label[] lPRINTs
Array of Labels corresponding to each Output option Label is separated from the corresponding checkbox so that the Label can be left justified.


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.

Constructor Detail

GuiIcanDataOutputs

public GuiIcanDataOutputs()
Constructor creates window to display buttons and checkbox entry fields.

Method Detail

initMe

protected void initMe()
Create window to display buttons and checkbox entry fields.

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.

focusLost

public void focusLost(java.awt.event.FocusEvent evt)
Does Nothing

Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
evt - Focus event.

focusGained

public void focusGained(java.awt.event.FocusEvent evt)
Detects When the Focus is Gained in a TextField

Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
evt - Focus event.

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
Process up/down arrow keys so that they do not work twice. I determined that it often alternates between keyPressed and keyReleased each time the up/down arrow key is pressed. Furthermore, it will begin repeating this alternating pattern if the key is held down.

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.

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent evt)
Determine which Checkbox was chosen and process accordingly.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
evt - Item event.

fixCheckboxes

public void fixCheckboxes(java.awt.Checkbox checkBox)
Determine which Checkbox was chosen, whether it was set on or off, and process accordingly.

Parameters:
checkBox - selected Checkbox to be processed.

helpMe

public void helpMe()
Display help message.


helpMe

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

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

presetData

public void presetData()
Set title and other ICAN/JAVA data and enable buttons. If ICAN/JAVA data initialized, use it to initialize the output switches inputs.

Specified by:
presetData in class GuiWindow

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.

acceptOutputs

private boolean acceptOutputs()
Check whether output options are valid.

Returns:
True, if output options are valid; else, false.

saveDefaults

private void saveDefaults()
Save current values of Outputs as defaults.


resetDefaults

private void resetDefaults()
Reset current values of Outputs to default values.


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.