IcanGui
Class GuiIcanMechStaticLoads

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

public class GuiIcanMechStaticLoads
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 mechanical static load data.

Since:
1.0;
Version:
1.1.6;
Updated by Louis Handler on Oct 7, 2005, 08:35 EDT (1.1.6).
Updated by Louis Handler on Jun 8, 2005, 10:27 EDT (1.1.5).
Updated by Louis Handler on Aug 27, 2002, 10:24 EDT.
Updated by Louis Handler on Aug 27, 2002, 09:38 EDT.
Updated by Louis Handler on Aug 26, 2002, 09:50 EDT.
Updated by Louis Handler on Jun 2, 2000, 10:18 EDT.
Updated by Louis Handler on Mar 28, 2000, 12:59 EST.
Updated by Louis Handler on Feb 24, 2000, 15:04 EST.
Updated by Louis Handler on Feb 22, 2000, 15:12 EST.
Updated by Louis Handler on Nov 16, 1999, 15:50 EST.
Updated by Louis Handler on Mar 22, 1999, 14:17 EST.
Updated by Louis Handler on Dec 1, 1998, 14:28 EST.
Updated by Louis Handler on Nov 23, 1998, 10:39 EST.
Updated by Louis Handler on Nov 6, 1998, 08:53 EST.
Updated by Louis Handler on Oct 20, 1998, 12:27 EDT.
Updated by Louis Handler on Aug 18, 1998, 07:48 EDT.
Updated by Louis Handler on Aug 12, 1998, 13:14 EDT.
Updated by Matthew Der on Jul 24, 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 GuiIcanMechStaticLoads.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 static java.lang.String[] categories
          Categories/lines of mechanical static loads.
private  IcanDataSet data
          ICAN/JAVA data set.
private  boolean firstRun
          Variable to test for the first time the frame is displayed.
private  java.awt.GridBagConstraints gbc
          GridBag constraints.
private  java.awt.GridBagLayout gbl
          GridBag Layout manager.
private static int iAccept
          Accept Button will verify the data and complete the processing of Load data input.
private static int iAddLine
          This Button will add a set of Loads.
private static int iCancel
          Cancel Button will exit this screen discarding any data entered.
private static int iClear
          Clear Button will clear data entry fields.
private static int iDelLine
          This Button will remove the last set of Loads entered.
private static int iExit
          Exit Button will exit the entire program.
private  int iFocusl
          Index of last TextField with focus
private  int iFocusw
          Index of last TextField with focus
private static int iHelp
          Help Button will display this set of information.
private static java.lang.String lbInchPerInch
          String containing the equivalent of "lb-in/in" in the current system of units.
private  java.awt.Label[][] lblLoad
          Array of Labels, saved for removal later.
private static java.lang.String lbPerInch
          String containing the equivalent of "lb/in" in the current system of units.
private static int LINES_PER_SET
          Lines allotted for each set of Mechanical Static Loads.
private  java.awt.TextField[] loadMcxx
          TextField containing Mcxx.
private  java.awt.TextField[] loadMcxy
          TextField containing Mcxy.
private  java.awt.TextField[] loadMcyy
          TextField containing Mcyy.
private  java.awt.TextField[] loadNcxx
          TextField containing Ncxx.
private  java.awt.TextField[] loadNcxy
          TextField containing Ncxy.
private  java.awt.TextField[] loadNcxz
          TextField containing Ncxz.
private  java.awt.TextField[] loadNcyy
          TextField containing Ncyy.
private  java.awt.TextField[] loadNcyz
          TextField containing Ncyz.
private  java.awt.TextField[] loadNczzLower
          TextField containing NczzLower.
private  java.awt.TextField[] loadNczzUpper
          TextField containing NczzUpper.
private  java.awt.TextField[] loadRadius
          TextField containing Radius.
private  java.awt.TextField[] loadRpm
          TextField containing Rpm.
private  java.awt.TextField[] loadTheta
          TextField containing Theta.
private  int maxLoad
          Maximum number of mechanical static load sets.
private  GuiIcanMechStaticLoads.Madapter myMadapter
          Mouse Adapter to handle mouse entering the window for the first time and right clicks.
private static int nButtons
          Number of action buttons.
private static int NLBL
          Number of labels per set of loading conditions.
private static int nLines
          Number of categories/lines of mechanical static loads.
private  int nLoad
          Number of mechanical static load sets.
private  java.awt.Panel panelFrame
          The Panel that contains the data to be displayed within a scrolling frame.
private  java.awt.Panel panelLoad1
          Panel containing a set of static input loads.
private static int[][] position
          Position of each mechanical static load: row, column.
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.TextField[][] tArray
          Array of TextFields containing all mechanical static loads.
private  java.awt.Label theTitle
          Label containing the description/title of the ICAN/JAVA run.
private static java.lang.String[] titles
          Title of each mechanical static load.
 
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
GuiIcanMechStaticLoads()
          Constructor creates window to display buttons and text entry fields.
 
Method Summary
private  boolean acceptLoads()
          Check whether loads are valid.
 void actionPerformed(java.awt.event.ActionEvent evt)
          Detect Action Events and process accordingly
private  void addIcanDataLoad1()
          Add a set of loads.
 void changeGuiUnits()
          Change units on GUI for this class.
private  void delIcanDataLoad1()
          Delete the last set of loads.
private  void enableButtons()
          Enable buttons.
 void focusGained(java.awt.event.FocusEvent evt)
          Does Nothing
 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 text entry fields.
 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 and enable buttons.
private  void setClearData()
          Clear text data entry fields.
 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.


panelLoad1

private java.awt.Panel panelLoad1
Panel containing a set of static input loads.


gbl

private java.awt.GridBagLayout gbl
GridBag Layout manager.


gbc

private java.awt.GridBagConstraints gbc
GridBag constraints.


theTitle

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


nLoad

private int nLoad
Number of mechanical static load sets.


maxLoad

private int maxLoad
Maximum number of mechanical static load sets.


loadNcxx

private java.awt.TextField[] loadNcxx
TextField containing Ncxx.


loadNcyy

private java.awt.TextField[] loadNcyy
TextField containing Ncyy.


loadNcxy

private java.awt.TextField[] loadNcxy
TextField containing Ncxy.


loadTheta

private java.awt.TextField[] loadTheta
TextField containing Theta.


loadMcxx

private java.awt.TextField[] loadMcxx
TextField containing Mcxx.


loadMcyy

private java.awt.TextField[] loadMcyy
TextField containing Mcyy.


loadMcxy

private java.awt.TextField[] loadMcxy
TextField containing Mcxy.


loadNczzUpper

private java.awt.TextField[] loadNczzUpper
TextField containing NczzUpper.


loadNczzLower

private java.awt.TextField[] loadNczzLower
TextField containing NczzLower.


loadNcxz

private java.awt.TextField[] loadNcxz
TextField containing Ncxz.


loadNcyz

private java.awt.TextField[] loadNcyz
TextField containing Ncyz.


loadRpm

private java.awt.TextField[] loadRpm
TextField containing Rpm.


loadRadius

private java.awt.TextField[] loadRadius
TextField containing Radius.


tArray

private java.awt.TextField[][] tArray
Array of TextFields containing all mechanical static loads.


categories

private static final java.lang.String[] categories
Categories/lines of mechanical static loads.


nLines

private static final int nLines
Number of categories/lines of mechanical static loads.


lbPerInch

private static java.lang.String lbPerInch
String containing the equivalent of "lb/in" in the current system of units.


lbInchPerInch

private static java.lang.String lbInchPerInch
String containing the equivalent of "lb-in/in" in the current system of units.


titles

private static java.lang.String[] titles
Title of each mechanical static load.


position

private static final int[][] position
Position of each mechanical static load: row, column.


NLBL

private static final int NLBL
Number of labels per set of loading conditions.


LINES_PER_SET

private static final int LINES_PER_SET
Lines allotted for each set of Mechanical Static Loads.


lblLoad

private java.awt.Label[][] lblLoad
Array of Labels, saved for removal later.


iAccept

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

See Also:
Constant Field Values

iAddLine

private static final int iAddLine
This Button will add a set of Loads.

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

iClear

private static final int iClear
Clear Button will clear data entry fields.

See Also:
Constant Field Values

iDelLine

private static final int iDelLine
This Button will remove the last set of Loads 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 this set of information.

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.


myMadapter

private GuiIcanMechStaticLoads.Madapter myMadapter
Mouse Adapter to handle mouse entering the window for the first time and right clicks.


saveCompFocus

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


firstRun

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


iFocusw

private int iFocusw
Index of last TextField with focus


iFocusl

private int iFocusl
Index of last TextField with focus

Constructor Detail

GuiIcanMechStaticLoads

public GuiIcanMechStaticLoads()
Constructor creates window to display buttons and text entry fields.

Method Detail

initMe

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

Specified by:
initMe in class GuiWindow

addIcanDataLoad1

private void addIcanDataLoad1()
Add a set of loads.


enableButtons

private void enableButtons()
Enable buttons.


delIcanDataLoad1

private void delIcanDataLoad1()
Delete the last set of loads.


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)
Does Nothing

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

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 help message for a specified component.

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

setClearData

private void setClearData()
Clear text data entry fields.


presetData

public void presetData()
Set title and other ICAN/JAVA data and enable buttons. If ICAN/JAVA data initialized, use it to initialize the loads 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.

acceptLoads

private boolean acceptLoads()
Check whether loads are valid.

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

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.