IcanGui
Class GuiIcanDataBooleans

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

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

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

Since:
1.0;
Version:
1.1.17;
Updated by Louis Handler on Feb 4, 2011, 12:21 EST (1.1.17).
Updated by Louis Handler on Jan 4, 2007, 07:43 EST (1.1.14).
Updated by Louis Handler on Dec 28, 2005, 09:18 EST (1.1.6).
Updated by Louis Handler on Jul 19, 2005, 08:13 EDT (1.1.5).
Updated by Louis Handler on Sep 10, 2003, 10:59 EDT.
Updated by Louis Handler on Oct 22, 2002, 08:24 EDT.
Updated by Louis Handler on Aug 27, 2002, 10:37 EDT.
Updated by Louis Handler on Nov 20, 2000, 15:09 EST.
Updated by Louis Handler on May 16, 2000, 08:04 EDT.
Updated by Louis Handler on Mar 30, 2000, 09:18 EST.
Updated by Louis Handler on Feb 22, 2000, 14:57 EST.
Updated by Louis Handler on Nov 19, 1999, 15:37 EST.
Updated by Louis Handler on Mar 19, 1999, 15:03 EST.
Updated by Louis Handler on Dec 1, 1998, 10:11 EST.
Updated by Louis Handler on Nov 23, 1998, 10:33 EST.
Updated by Louis Handler on Nov 20, 1998, 09:04 EST.
Updated by Louis Handler on Nov 2, 1998, 12:57 EST.
Updated by Louis Handler on Oct 20, 1998, 10:25 EDT.
Updated by Louis Handler on Aug 28, 1998, 13:39 EDT.
Updated by Louis Handler on Aug 14, 1998, 15:12 EDT.
Updated by Matthew Der on Jul 10, 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 GuiIcanDataBooleans.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[] cBooleans
          Array of Checkboxes corresponding to each boolean.
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 Boolean 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 will reset current values of Booleans to default values.
private static int iHelp
          Help Button will display a set of information.
private static int iSaveDef
          "Save as Defaults" Button will save current values of Booleans as defaults.
private  java.awt.Label[] lBooleans
          Array of Labels corresponding to each boolean.
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[] pBooleans
          Array of Panels corresponding to each boolean, 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
GuiIcanDataBooleans()
          Constructor creates window to display buttons and checkboxes.
 
Method Summary
private  boolean acceptBooleans()
          Test whether to accept boolean.
 void actionPerformed(java.awt.event.ActionEvent evt)
          Detect an Action Event and Handle it accordingly.
 void changeGuiUnits()
          Change units on GUI for this class.
 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 checkboxes.
 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 Boolean data from ICAN/JAVA data.
private  void resetDefaults()
          Reset current values of Booleans to default values.
private  void saveDefaults()
          Save current values of Booleans 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 Boolean 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

iHelp

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

See Also:
Constant Field Values

iGetDef

private static final int iGetDef
"Reset to Defaults" Button will reset current values of Booleans to default values.

See Also:
Constant Field Values

iSaveDef

private static final int iSaveDef
"Save as Defaults" Button will save current values of Booleans as defaults.

See Also:
Constant Field Values

cBooleans

private java.awt.Checkbox[] cBooleans
Array of Checkboxes corresponding to each boolean.


pBooleans

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


lBooleans

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


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.


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

GuiIcanDataBooleans

public GuiIcanDataBooleans()
Constructor creates window to display buttons and checkboxes.

Method Detail

initMe

protected void initMe()
Create window to display buttons and checkboxes.

Specified by:
initMe in class GuiWindow

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Detect an Action Event and Handle it 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. 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.

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 Boolean data from ICAN/JAVA data.

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.

acceptBooleans

private boolean acceptBooleans()
Test whether to accept boolean.

Returns:
True, if booleans are valid; else, false.

saveDefaults

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


resetDefaults

private void resetDefaults()
Reset current values of Booleans 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.