IcanGui
Class GuiIcanDataMaterial

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

public class GuiIcanDataMaterial
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 composite material system data.

Since:
1.0;
Version:
1.1.17;
Updated by Louis Handler on Feb 24, 2011, 14:45 EST (1.1.17).
Updated by Louis Handler on Jul 3, 2006, 13:38 EDT (1.1.8).
Updated by Louis Handler on Sep 30, 2005, 08:44 EDT (1.1.6).
Updated by Louis Handler on Jul 15, 2005, 09:27 EDT (1.1.5).
Updated by Louis Handler on May 6, 2005, 10:00 EDT (1.1.2).
Updated by Louis Handler on Mar 25, 2005, 11:07 EST (1.1.0).
Updated by Louis Handler on Sep 10, 2003, 10:51 EDT.
Updated by Louis Handler on Sep 12, 2002, 12:39 EDT.
Updated by Louis Handler on Sep 12, 2002, 08:30 EDT.
Updated by Louis Handler on Aug 27, 2002, 10:04 EDT.
Updated by Louis Handler on Aug 27, 2002, 09:31 EDT.
Updated by Louis Handler on Aug 26, 2002, 10:51 EDT.
Updated by Louis Handler on Aug 26, 2002, 09:21 EDT.
Updated by Louis Handler on Jun 2, 2000, 11:37 EDT.
Updated by Louis Handler on Mar 28, 2000, 13:48 EST.
Updated by Louis Handler on Feb 25, 2000, 08:20 EST.
Updated by Louis Handler on Nov 24, 1999, 10:33 EST.
Updated by Louis Handler on Mar 23, 1999, 12:45 EST.
Updated by Louis Handler on Dec 14, 1998, 11:10 EST.
Updated by Louis Handler on Nov 23, 1998, 10:35 EST.
Updated by Louis Handler on Nov 6, 1998, 08:28 EST.
Updated by Louis Handler on Aug 26, 1998, 11:38 EDT.
Updated by Louis Handler on Aug 18, 1998, 08:10 EDT.
Updated by Louis Handler on Jul 24, 1998, 15:35 EDT.
Updated by Matthew Der on Jul 14, 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 GuiIcanDataMaterial.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.TextField compColor
          Current TextField highlighted and where the chosen material code from the material DataBank will be displayed.
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[] gwid
          Array of column widths for TextFields in the GridBag Layout showing that TextFields containing material ID's are smaller than TextFields containing numeric values for the volume ratios.
private static boolean[] highlightMcode
          Array of highlightable material code TextFields.
private static int iAcceptM
          Accept Button will verify the data and complete the processing of Material data.
private static int iAddLineM
          "Add a Material" Button will add a line on which to enter more Material data.
private static int iCancel
          Cancel Button will exit this screen discarding any data entered.
private static int iCheckM
          "Check Material Code" Button will display the list of available material codes.
private static int iChooseM
          "Choose Material Code" Button will display a list of material codes entered.
private static int iClear
          Clear Button will clear data entry fields.
private static int iDelLineM
          "Remove the last Material" Button will remove the last line of Material data.
private static int iExitM
          Exit Button will exit the entire program.
private  int iFocusl
          Second Index of TextField with Focus telling which line of data.
private  int iFocusw
          First Index of TextField with Focus telling which type/column of data.
private static int iHelpM
          Help Button will display a set of information.
private static double limitFiberVolumeRatio
          Maximum fiber volume ratio when fiber just touches sides of surrounding box.
private static double limitParticleVolumeRatio
          Maximum particle volume ratio when particle just touches sides of surrounding box.
private  int maxMatl
          Maximum number of composite material system ID's which may be increased as required.
private  java.awt.TextField[][] mData
          Array of all TextFields containing the composite material system data.
private  MaterialDataBankSet mdb
          Material DataBank.
private  java.awt.TextField[] mtlFcodeP
          Primary Fiber or Particle Code: a material code from DataBank.
private  java.awt.TextField[] mtlFcodeS
          Secondary Fiber or Particle Code: a material code from DataBank.
private  java.awt.TextField[] mtlFVRP
          Primary Fiber Volume Ratio: fiber_volume / total_primary_volume.
private  java.awt.TextField[] mtlFVRS
          Secondary Fiber Volume Ratio: fiber_volume / total_secondary_volume.
private  java.awt.TextField[] mtlIcodeP
          Primary Interphase Code: a material code from DataBank.
private  java.awt.TextField[] mtlIcodeS
          Secondary Interphase Code: a material code from DataBank.
private  java.awt.TextField[] mtlID
          This composite material system ID is a code associated with some composite material fabricated from Fibers and Matrix or Particles and Binder under the specified conditions.
private  java.awt.TextField[] mtlIVRP
          Primary Interphase Volume Ratio: interphase_volume / total_primary_volume.
private  java.awt.TextField[] mtlIVRS
          Secondary Interphase Volume Ratio: interphase_volume / total_secondary_volume.
private  java.awt.TextField[] mtlMcodeP
          Primary Matrix or Binder Code: a material code from DataBank.
private  java.awt.TextField[] mtlMcodeS
          Secondary Matrix or Binder Code: a material code from DataBank.
private  java.awt.TextField[] mtlSCVR
          Secondary Composite Volume Ratio: secondary_volume / total_volume.
private  java.awt.TextField[] mtlVVRP
          Primary Void Volume Ratio: void_volume / total_primary_volume.
private  java.awt.TextField[] mtlVVRS
          Secondary Void Volume Ratio: void_volume / total_secondary_volume.
private  GuiIcanDataMaterial.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 nMatl
          Number of composite material system data lines = number of composite material system ID's.
private  java.awt.Color oldColorB
          Old background color used to reset highlighted background color.
private  java.awt.Color oldColorF
          Old foreground color used to reset highlighted foreground color.
private static double ONE
          The constant one.
private  java.awt.Panel panelFrame
          The Panel that contains the data to be displayed within a scrolling frame.
private  java.awt.Panel panelMatl
          Panel containing the composite material system data.
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
GuiIcanDataMaterial()
          Constructor creates window to display buttons and text entry fields.
 
Method Summary
private  boolean acceptMaterial()
          Check if composite material system is valid.
 void actionPerformed(java.awt.event.ActionEvent evt)
          Detect action events and process accordingly.
private  void addIcanDataMaterial()
          Add a set of composite material data to the composite material system window.
 void changeGuiUnits()
          Change units on GUI for this class.
private  void delIcanDataMaterial()
          Remove the last set of composite material data from the composite material system window.
private  void enableButtons()
          Enable buttons.
 void focusGained(java.awt.event.FocusEvent evt)
          Find The TextField with Focus if Focus Is Gained
 void focusLost(java.awt.event.FocusEvent evt)
          Does Nothing
private  java.lang.String getMdbFileName()
          Display file dialog and get Material DataBank input data filename.
 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)
          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)
          Makes sure that keys are not processed twice.
 void presetData()
          Set title and other ICAN/JAVA data and enable buttons.
private  void readDataBank()
          Read another DataBank file to obtain materials.
private  void setClearData()
          Clear text data entry fields.
private  void setColor()
          Determine next location to store chosen Material Code and highlight it.
 void setCompFocus()
          Set focus to some component.
 void setCompFocus(java.awt.Component cFocus)
          Set focus in current class/frame.
 void setMaterialID(java.lang.String sMatl)
          Enter a new material ID, referenced in another class, into a blank spot in the GUI, adding a line, if necessary.
private  void wherePutMaterialCode()
          Determine location to store chosen Material Code.
 
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.


panelMatl

private java.awt.Panel panelMatl
Panel containing the composite material system data.


theTitle

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


gbl

private java.awt.GridBagLayout gbl
GridBag Layout manager.


gbc

private java.awt.GridBagConstraints gbc
GridBag constraints.


nMatl

private int nMatl
Number of composite material system data lines = number of composite material system ID's.


maxMatl

private int maxMatl
Maximum number of composite material system ID's which may be increased as required.


mtlID

private java.awt.TextField[] mtlID
This composite material system ID is a code associated with some composite material fabricated from Fibers and Matrix or Particles and Binder under the specified conditions. It is used in one or more plies. This composite material system ID must be different from values in the Material DataBank. The composite material ID must be alphanumeric. It may be an acronym meaningful to the user or it may be strictly numeric. If numeric, it may be the same as a ply number with, of course, different significance.


mtlFcodeP

private java.awt.TextField[] mtlFcodeP
Primary Fiber or Particle Code: a material code from DataBank.


mtlMcodeP

private java.awt.TextField[] mtlMcodeP
Primary Matrix or Binder Code: a material code from DataBank.


mtlIcodeP

private java.awt.TextField[] mtlIcodeP
Primary Interphase Code: a material code from DataBank.


mtlFVRP

private java.awt.TextField[] mtlFVRP
Primary Fiber Volume Ratio: fiber_volume / total_primary_volume.


mtlIVRP

private java.awt.TextField[] mtlIVRP
Primary Interphase Volume Ratio: interphase_volume / total_primary_volume.


mtlVVRP

private java.awt.TextField[] mtlVVRP
Primary Void Volume Ratio: void_volume / total_primary_volume.


mtlFcodeS

private java.awt.TextField[] mtlFcodeS
Secondary Fiber or Particle Code: a material code from DataBank.


mtlMcodeS

private java.awt.TextField[] mtlMcodeS
Secondary Matrix or Binder Code: a material code from DataBank.


mtlIcodeS

private java.awt.TextField[] mtlIcodeS
Secondary Interphase Code: a material code from DataBank.


mtlFVRS

private java.awt.TextField[] mtlFVRS
Secondary Fiber Volume Ratio: fiber_volume / total_secondary_volume.


mtlIVRS

private java.awt.TextField[] mtlIVRS
Secondary Interphase Volume Ratio: interphase_volume / total_secondary_volume.


mtlVVRS

private java.awt.TextField[] mtlVVRS
Secondary Void Volume Ratio: void_volume / total_secondary_volume.


mtlSCVR

private java.awt.TextField[] mtlSCVR
Secondary Composite Volume Ratio: secondary_volume / total_volume.


mData

private java.awt.TextField[][] mData
Array of all TextFields containing the composite material system data.


compColor

private java.awt.TextField compColor
Current TextField highlighted and where the chosen material code from the material DataBank will be displayed.


oldColorB

private java.awt.Color oldColorB
Old background color used to reset highlighted background color.


oldColorF

private java.awt.Color oldColorF
Old foreground color used to reset highlighted foreground color.


gwid

private static final int[] gwid
Array of column widths for TextFields in the GridBag Layout showing that TextFields containing material ID's are smaller than TextFields containing numeric values for the volume ratios.


highlightMcode

private static final boolean[] highlightMcode
Array of highlightable material code TextFields.


iAcceptM

private static final int iAcceptM
Accept Button will verify the data and complete the processing of Material data.

See Also:
Constant Field Values

iAddLineM

private static final int iAddLineM
"Add a Material" Button will add a line on which to enter more Material 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

iCheckM

private static final int iCheckM
"Check Material Code" Button will display the list of available material codes. The user may choose one to check.

See Also:
Constant Field Values

iChooseM

private static final int iChooseM
"Choose Material Code" Button will display a list of material codes entered. The user may choose one to use. The new material code will be put into the text field highlighted in yellow (or the closest available color).

See Also:
Constant Field Values

iClear

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

See Also:
Constant Field Values

iDelLineM

private static final int iDelLineM
"Remove the last Material" Button will remove the last line of Material data.

See Also:
Constant Field Values

iExitM

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

See Also:
Constant Field Values

iHelpM

private static final int iHelpM
Help Button will display a 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 GuiIcanDataMaterial.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.


iFocusl

private int iFocusl
Second Index of TextField with Focus telling which line of data.


iFocusw

private int iFocusw
First Index of TextField with Focus telling which type/column of data.


firstRun

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


limitFiberVolumeRatio

private static final double limitFiberVolumeRatio
Maximum fiber volume ratio when fiber just touches sides of surrounding box. Ratio of the area of a circle to the area of a circumscribed square. Fibers are arranged in an equally-spaced square array.

See Also:
Constant Field Values

limitParticleVolumeRatio

private static final double limitParticleVolumeRatio
Maximum particle volume ratio when particle just touches sides of surrounding box. Ratio of the area of a sphere to the area of a circumscribed cube. Particles are arranged in an equally-spaced cubic array.

See Also:
Constant Field Values

ONE

private static final double ONE
The constant one.

See Also:
Constant Field Values

mdb

private MaterialDataBankSet mdb
Material DataBank.

Constructor Detail

GuiIcanDataMaterial

public GuiIcanDataMaterial()
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

addIcanDataMaterial

private void addIcanDataMaterial()
Add a set of composite material data to the composite material system window.


enableButtons

private void enableButtons()
Enable buttons.


delIcanDataMaterial

private void delIcanDataMaterial()
Remove the last set of composite material data from the composite material system window.


setMaterialID

public void setMaterialID(java.lang.String sMatl)
Enter a new material ID, referenced in another class, into a blank spot in the GUI, adding a line, if necessary.

Parameters:
sMatl - Composite material to be defined.

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)
Find The TextField with Focus if Focus Is Gained

Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
evt - Focus 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.

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)
Makes sure that keys are not processed twice.

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 composite material system 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.

setColor

private void setColor()
Determine next location to store chosen Material Code and highlight it.


wherePutMaterialCode

private void wherePutMaterialCode()
Determine location to store chosen Material Code.


acceptMaterial

private boolean acceptMaterial()
Check if composite material system is valid.

Returns:
True, if composite material system is valid; else, false.

readDataBank

private void readDataBank()
Read another DataBank file to obtain materials.


getMdbFileName

private java.lang.String getMdbFileName()
Display file dialog and get Material DataBank input data filename. This is a duplicate of the same routine in GuiMdbPrompt.

Returns:
Material DataBank input data filename.
See Also:
FileDialog

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.