IcanGui
Class GuiIcanRateLoads

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

public class GuiIcanRateLoads
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 Rate load data.

Since:
1.0.1;
Version:
1.1.6;
Updated by Louis Handler on Dec 29, 2005, 11:42 EST (1.1.6).
Updated by Louis Handler on Apr 4, 2005, 09:21 EDT (1.1.0).
Updated by Louis Handler on Jan 30, 2004, 12:13 EST.
Updated by Louis Handler on Jan 30, 2004, 11:19 EST.
Updated by Louis Handler on Jan 30, 2004, 11:11 EST.
Updated by Louis Handler on Sep 16, 2003, 16:00 EDT.
Updated by Louis Handler on Sep 12, 2003, 10:06 EDT.
Updated by Louis Handler on Sep 5, 2002, 12:20 EDT.
Updated by Louis Handler on Sep 5, 2002, 11:52 EDT.
Updated by Louis Handler on Sep 5, 2002, 10:55 EDT.
Updated by Louis Handler on Sep 5, 2002, 10:42 EDT.
Updated by Louis Handler on Sep 4, 2002, 08:03 EDT.
Updated by Louis Handler on Aug 30, 2002, 16:01 EDT.
Updated by Louis Handler on Jul 1, 2002, 15:44 EDT.
Updated by Louis Handler on Jun 28, 2002, 15:51 EDT.
Updated by Louis Handler on Jun 28, 2002, 15:17 EDT.
Updated by Louis Handler on Jun 28, 2002, 14:06 EDT.
Author:
Louis Handler
See Also:
GuiWindow

Nested Class Summary
(package private)  class GuiIcanRateLoads.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  double cumThickness
          Total thickness of all Plys in the laminate structure.
private  IcanDataSet data
          ICAN/JAVA data set.
private  double dblPos
          Value of position near center of laminate used for interpolation.
private  double[] dblRate
          Value of rate in appropriate units.
private  boolean firstRun
          Variable to test for the first time the frame is displayed.
private  int formType
          Type of loading: constant, linear, parabolic, hyperbolic, or user-defined.
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.
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 iCompute
          Compute Button will compute Rate values per ply as specified.
private static int iExit
          Exit Button will exit the entire program.
private static int iHelp
          Help Button will display a set of information.
private  int iLbl
          Counter/subscript for adding individual Labels into lblData[iLbl] array.
private static int iPlot
          Plot Button will plot Rate values per ply as specified.
private  java.lang.String isRate
          String containing " Rate" if this is a rate type.
private  java.awt.Label[] lblLoad
          Array of Labels, saved for removal later.
private  java.awt.TextField loadPos
          TextField containing position near center of laminate used for interpolation.
private  java.awt.TextField[] loadRate
          TextFields containing rate in appropriate units.
private  java.awt.Label[] loadTableCum
          Label containing Ply center positions for each Ply.
private  java.awt.Label[] loadTablePly
          Label containing Ply number for each Ply.
private  java.awt.Label[] loadTableRate
          Label containing rate in appropriate units.
private  java.awt.Label[] loadTableThick
          Label containing Ply thickness for each Ply.
private  int maxLbl
          Size to initialize lblData[maxLbl] to.
private  GuiIcanRateLoads.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  int nPlys
          Number of Plys in Rate Load table.
private  int nValues
          Number of values to enter.
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 Rate input loads.
private  java.awt.Panel panelLoad2
          Panel containing a set of Rate computed loads.
private  java.awt.Panel panelLoadUser
          Panel containing a set of Rate input loads per ply.
private  GuiIcanPlotFrame plotWindowFrame
          Window Frame used for plotting.
private  double[] plyRate
          Value of rate in appropriate units.
private  double[] plyThickness
          Values of Ply thickness for each Ply.
private  double[] plyThicknessCum
          Values of Ply center positions for each Ply.
private  int rateType
          Rate load item type: Thermal, Hygral, Electrical, Decay (Corrosion Deterioration), Stress.
private  java.lang.String rateTypeLabel
          Rate load item type description.
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
GuiIcanRateLoads(int rateType, int type)
          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 Rate input loads for curve fit and interpolation.
private  void addIcanDataLoad2()
          Add a set of Rate computed loads.
private  void addIcanDataLoadC()
          Add a set of Rate input loads for constant data.
private  void addIcanDataLoadUser()
          Add a set of Rate input loads per ply.
 void changeGuiUnits()
          Change units on GUI for this class.
private  boolean computeLoads()
          Compute Rate loads and fill in computed data table.
 void focusGained(java.awt.event.FocusEvent evt)
          Listens for Events when a component gains focus.
 void focusLost(java.awt.event.FocusEvent evt)
          Does Nothing.
private  LoadItem getLoadData()
          Get Rate Load data.
 java.lang.String getName()
          Get class name.
private  boolean getPlyThickness()
          Fill in table of Ply thicknesses and Ply center locations and total the Ply thicknesses.
 int getRateType()
          Get Rate Load type: Thermal, Hygral, Electrical, Decay (Corrosion Deterioration), Stress, etc.
 int getType()
          Get Rate Load type: Linear, Parabolic, Hyperbolic, etc.
 void helpMe()
          Display help message.
 void helpMe(java.awt.Component target)
          Display help message for a specified component.
private  void hideLastPlot()
          Destroy plot if it is shown.
private  void initConstant()
          Create window to display buttons and text entry fields for constant data.
protected  void initMe()
          Create window to display buttons and text entry fields.
private  void initUser()
          Create window to display buttons and text entry fields.
 void keyPressed(java.awt.event.KeyEvent evt)
          Makes sure that keys are not processed 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
private  boolean plotLoads()
          Plot Rate loads.
 void presetData()
          Set title and other ICAN/JAVA data.
 void remove()
          Dispose of any components required before disposing of parent.
private  void saveLoadData()
          Save Rate Load data.
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 Rate input loads. The Panel may be used either for curve fit and interpolation data or for constant data.


panelLoad2

private java.awt.Panel panelLoad2
Panel containing a set of Rate computed loads.


panelLoadUser

private java.awt.Panel panelLoadUser
Panel containing a set of Rate input loads per ply. The Panel may be used for user-specified data.


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.


rateType

private int rateType
Rate load item type: Thermal, Hygral, Electrical, Decay (Corrosion Deterioration), Stress.


isRate

private java.lang.String isRate
String containing " Rate" if this is a rate type. This string contains nothing if it is not a rate type. This is added to messages and labels.


rateTypeLabel

private java.lang.String rateTypeLabel
Rate load item type description.


formType

private int formType
Type of loading: constant, linear, parabolic, hyperbolic, or user-defined.


nValues

private int nValues
Number of values to enter.


loadRate

private java.awt.TextField[] loadRate
TextFields containing rate in appropriate units.


loadPos

private java.awt.TextField loadPos
TextField containing position near center of laminate used for interpolation.


dblRate

private double[] dblRate
Value of rate in appropriate units.


dblPos

private double dblPos
Value of position near center of laminate used for interpolation.


nPlys

private int nPlys
Number of Plys in Rate Load table.


plyThickness

private double[] plyThickness
Values of Ply thickness for each Ply.


plyThicknessCum

private double[] plyThicknessCum
Values of Ply center positions for each Ply.


plyRate

private double[] plyRate
Value of rate in appropriate units.


cumThickness

private double cumThickness
Total thickness of all Plys in the laminate structure.


loadTablePly

private java.awt.Label[] loadTablePly
Label containing Ply number for each Ply.


loadTableThick

private java.awt.Label[] loadTableThick
Label containing Ply thickness for each Ply.


loadTableCum

private java.awt.Label[] loadTableCum
Label containing Ply center positions for each Ply.


loadTableRate

private java.awt.Label[] loadTableRate
Label containing rate in appropriate units.


lblLoad

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


maxLbl

private int maxLbl
Size to initialize lblData[maxLbl] to.


iLbl

private int iLbl
Counter/subscript for adding individual Labels into lblData[iLbl] array.


iAccept

private static final int iAccept
Accept Button will verify the data and complete the processing of Load 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

iClear

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

See Also:
Constant Field Values

iCompute

private static final int iCompute
Compute Button will compute Rate values per ply as specified.

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

iPlot

private static final int iPlot
Plot Button will plot Rate values per ply as specified.

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 GuiIcanRateLoads.Madapter myMadapter
Mouse Adapter to handle mouse entering the window for the first time and right clicks.


plotWindowFrame

private GuiIcanPlotFrame plotWindowFrame
Window Frame used for plotting. Also used to ensure that only one plot is created and no previous plots are left.


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.

Constructor Detail

GuiIcanRateLoads

public GuiIcanRateLoads(int rateType,
                        int type)
Constructor creates window to display buttons and text entry fields.

Parameters:
rateType - Rate load item type: Thermal, Hygral, Electrical, Decay (Corrosion Deterioration), Stress.
type - Type of loading: constant, linear, parabolic, hyperbolic, or user-defined.
Method Detail

initMe

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

Specified by:
initMe in class GuiWindow

initConstant

private void initConstant()
Create window to display buttons and text entry fields for constant data.


initUser

private void initUser()
Create window to display buttons and text entry fields.


getPlyThickness

private boolean getPlyThickness()
Fill in table of Ply thicknesses and Ply center locations and total the Ply thicknesses.

Returns:
True, if Ply thicknesses are available for computation; else, false.

addIcanDataLoad1

private void addIcanDataLoad1()
Add a set of Rate input loads for curve fit and interpolation.


addIcanDataLoadC

private void addIcanDataLoadC()
Add a set of Rate input loads for constant data.


addIcanDataLoad2

private void addIcanDataLoad2()
Add a set of Rate computed loads.


addIcanDataLoadUser

private void addIcanDataLoadUser()
Add a set of Rate input loads per ply.


remove

public void remove()
Dispose of any components required before disposing of parent.


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.

focusGained

public void focusGained(java.awt.event.FocusEvent evt)
Listens for Events when a component gains focus.

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

focusLost

public void focusLost(java.awt.event.FocusEvent evt)
Does Nothing. Listens for Events when a component loses focus.

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

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
Makes sure that keys are not processed twice.

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

getRateType

public int getRateType()
Get Rate Load type: Thermal, Hygral, Electrical, Decay (Corrosion Deterioration), Stress, etc.

Returns:
Rate Load type.

getType

public int getType()
Get Rate Load type: Linear, Parabolic, Hyperbolic, etc.

Returns:
Rate Load type.

getLoadData

private LoadItem getLoadData()
Get Rate Load data.

Returns:
Rate Load data.

saveLoadData

private void saveLoadData()
Save Rate Load data.


acceptLoads

private boolean acceptLoads()
Check whether loads are valid.

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

computeLoads

private boolean computeLoads()
Compute Rate loads and fill in computed data table.

Returns:
True, if curve fit and computation of loads was successful; else, false.

hideLastPlot

private void hideLastPlot()
Destroy plot if it is shown.


plotLoads

private boolean plotLoads()
Plot Rate loads.

Returns:
True, if curve fit and computation of loads was successful; 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.