IcanGui
Class GuiMdbData

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

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

Encapsulate the behavior of the Material DataBank data entry form for a particular material property type.

Since:
1.0;
Version:
1.1.6;
Updated by Louis Handler on Dec 29, 2005, 11:43 EST (1.1.6).
Updated by Louis Handler on Jul 18, 2005, 08:16 EDT (1.1.5).
Updated by Louis Handler on Mar 2, 2005, 10:47 EST (1.1.0).
Updated by Louis Handler on Apr 12, 2004, 10:34 EDT.
Updated by Louis Handler on Apr 12, 2004, 08:34 EDT.
Updated by Louis Handler on Apr 8, 2004, 13:42 EDT.
Updated by Louis Handler on Apr 8, 2004, 13:22 EDT.
Updated by Louis Handler on Oct 21, 2002, 10:32 EDT.
Updated by Louis Handler on Sep 12, 2002, 08:34 EDT.
Updated by Louis Handler on Sep 11, 2002, 15:59 EDT.
Updated by Louis Handler on Jul 27, 2000, 13:51 EDT.
Updated by Louis Handler on Mar 30, 2000, 08:05 EST.
Updated by Louis Handler on Feb 25, 2000, 08:47 EST.
Updated by Louis Handler on Dec 3, 1999, 10:12 EST.
Updated by Louis Handler on Jan 28, 1999, 15:14 EST.
Updated by Louis Handler on Dec 10, 1998, 16:19 EST.
Updated by Louis Handler on Dec 1, 1998, 09:57 EST.
Updated by Louis Handler on Nov 23, 1998, 10:40 EST.
Updated by Louis Handler on Nov 3, 1998, 08:32 EST.
Updated by Louis Handler on Sep 2, 1998, 09:48 EDT.
Updated by Louis Handler on Aug 18, 1998, 07:58 EDT.
Updated by Matthew Der on Jul 20, 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 GuiMdbData.Madapter
          Mouse Adapter Inner Class
 
Field Summary
(package private) static java.lang.String BLANKS
          Blanks to fill in so columns will line up.
private  java.awt.Button[] bMFIM
          Array of Buttons, used to enter corresponding Multi-Factor Interaction Model (MFIM) factors.
private static java.lang.String[] buttonLabels
          Button Labels.
private  java.awt.Button[] buttons
          Action buttons.
private  GuiMdbDataMfim classMFIM
          Instance of class GuiMdbDataMfim, used to obtain MFIM data.
private static java.lang.String commentsLabel
          Header label for Commants.
private  int fiber_or_matrix
          DataBank material type;for example, fiber, matrix, particle, etc.
private  boolean firstRun
          Variable to test for the first time the frame is displayed.
private static java.lang.String[] headerLabels
          Header labels for Material DataBank properties.
private static int iAccept
          Accept Button will verify the data and complete the processing of this Material DataBank data.
private  int ibPut
          Subscript of MFIM Button used.
private static int iCancel
          Cancel Button will ignore any data entered on this form.
private static int iChoose
          Choose Button will display a list of material codes entered.
private static int iClear
          Clear Button will blank all data entered on this form.
private static int iExit
          Exit Button will exit the entire program.
private  int iFocus
          Index of TextField
private static int iHelp
          Help Button will display a set of information describing the function of each button.
private static int iPrint
          Print Button will print the current Material Property DataBank entry.
private static int iSave
          Save Button will verify the data and save this Material DataBank data to a file.
private  java.awt.Label[] lbMpD
          Array of Labels used to display description of input data values.
private  java.awt.Label[] lbMpS
          Array of Labels used to display symbol name for input data values.
private  java.awt.Label[] lbMpU
          Array of Labels used to display units of input data values.
private static java.lang.String materialDescriptionLabel
          Header label for material description.
private  int[] maxCols
          Length of longest item in each column: Description, Symbol, Value, Units, MFIM.
private  MaterialDataBankSet mdb
          Material DataBank data set.
private  java.lang.String[] mUnit
          Array of Strings used to display units of input data values.
private static int NACTIVEFACTORS
          Maximum number of usable MFIM factors allowed to be entered.
private static int nButtons
          Number of action buttons.
private static int NFACTORS
          Maximum number of MFIM factors allowed to be entered.
private  int nPropSize
          Number of properties of the given DataBank material type.
private  java.awt.Panel panelFrame
          The Panel that contains the data to be displayed within a scrolling frame.
private  java.awt.Panel panelMdb
          Panel containing the Material DataBank description, symbol name, values, units, and MFIM buttons.
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.TextArea taComment
          TextArea used to input multi-line Material description.
private  java.awt.TextField tfDescr
          TextField used to input short Material description.
private  java.awt.TextField[] tfInp
          Array of TextFields used to input data values.
private  java.awt.TextField tfMatl
          TextField used to input Material code.
private  MultiFactorInteractionModel[][] theMfim
          Array of Multi-Factor Interaction Model factors used to save the MFIM values.
private  MaterialProperty[] theProp
          Array of Material Property items, containing the MFIM factors, to be added to the Material DataBank when accepted.
private  MaterialDataBankItem thisMdbi
          Material DataBank Item to be added to the Material DataBank when accepted.
private static java.awt.Toolkit tkit
          Use the default Toolkit to access Font metrics.
private  int unitSystem
          System of units; English or SI.
 
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
GuiMdbData(int fiber_or_matrix)
          Constructor creates window to display buttons and text entry fields.
 
Method Summary
private  boolean acceptMdb()
          Check whether Material DataBank data is valid.
 void actionPerformed(java.awt.event.ActionEvent evt)
          Detects an Action Event and processes it accordingly.
 void changeGuiUnits()
          Change units on GUI for this class.
private  void clearMe()
          Clear all text fields.
 void fillInFields(MaterialDataBankItem mdbit)
          Fill in fields from Material DataBank item chosen.
 void fixAllMfimLabels()
          Set Label on MFIM buttons.
 void fixMfimLabel(int ib)
          Set Label on MFIM button.
 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)
          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 paintMe(java.awt.PrintJob job)
          Paint text to Graphics area for printing.
 void presetData()
          Set title and other ICAN/JAVA data.
 void presetUnits()
          Set input units.
private  void printAll()
          Print contents of Material DataBank item.
private  boolean saveMdb()
          Save Material DataBank data, if valid.
 void setComment(java.lang.String comment)
          Set Comment.
 void setCompFocus()
          Set focus to some component.
 void setCompFocus(java.awt.Component cFocus)
          Set focus in current class/frame.
 void setMatl(java.lang.String matl, java.lang.String descr)
          Set Material Code and description.
 
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

mdb

private MaterialDataBankSet mdb
Material DataBank data set.


thisMdbi

private MaterialDataBankItem thisMdbi
Material DataBank Item to be added to the Material DataBank when accepted.


theProp

private MaterialProperty[] theProp
Array of Material Property items, containing the MFIM factors, to be added to the Material DataBank when accepted.


theMfim

private MultiFactorInteractionModel[][] theMfim
Array of Multi-Factor Interaction Model factors used to save the MFIM values. Subscripts are the index of the material property in the DataBank and the index of the MFIM factor.


unitSystem

private int unitSystem
System of units; English or SI.


fiber_or_matrix

private int fiber_or_matrix
DataBank material type;for example, fiber, matrix, particle, etc.


nPropSize

private int nPropSize
Number of properties of the given DataBank material type.


NFACTORS

private static final int NFACTORS
Maximum number of MFIM factors allowed to be entered.


NACTIVEFACTORS

private static final int NACTIVEFACTORS
Maximum number of usable MFIM factors allowed to be entered.


ibPut

private int ibPut
Subscript of MFIM Button used. Used to reset Button Label to display number of MFIM factors entered.


classMFIM

private GuiMdbDataMfim classMFIM
Instance of class GuiMdbDataMfim, used to obtain MFIM data.


panelMdb

private java.awt.Panel panelMdb
Panel containing the Material DataBank description, symbol name, values, units, and MFIM buttons.


iAccept

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

See Also:
Constant Field Values

iCancel

private static final int iCancel
Cancel Button will ignore any data entered on this form.

See Also:
Constant Field Values

iChoose

private static final int iChoose
Choose Button will display a list of material codes entered. The user may choose one to modify temporarily and use.

See Also:
Constant Field Values

iClear

private static final int iClear
Clear Button will blank all data entered on this form.

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 describing the function of each button.

See Also:
Constant Field Values

iPrint

private static final int iPrint
Print Button will print the current Material Property DataBank entry.

See Also:
Constant Field Values

iSave

private static final int iSave
Save Button will verify the data and save this Material DataBank data to a file.

See Also:
Constant Field Values

buttonLabels

private static final java.lang.String[] buttonLabels
Button Labels.


nButtons

private static final int nButtons
Number of action buttons.


buttons

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


materialDescriptionLabel

private static final java.lang.String materialDescriptionLabel
Header label for material description.

See Also:
Constant Field Values

commentsLabel

private static final java.lang.String commentsLabel
Header label for Commants.

See Also:
Constant Field Values

headerLabels

private static final java.lang.String[] headerLabels
Header labels for Material DataBank properties.


bMFIM

private java.awt.Button[] bMFIM
Array of Buttons, used to enter corresponding Multi-Factor Interaction Model (MFIM) factors.


tfInp

private java.awt.TextField[] tfInp
Array of TextFields used to input data values.


lbMpD

private java.awt.Label[] lbMpD
Array of Labels used to display description of input data values.


lbMpS

private java.awt.Label[] lbMpS
Array of Labels used to display symbol name for input data values.


lbMpU

private java.awt.Label[] lbMpU
Array of Labels used to display units of input data values.


mUnit

private java.lang.String[] mUnit
Array of Strings used to display units of input data values.


tfMatl

private java.awt.TextField tfMatl
TextField used to input Material code.


tfDescr

private java.awt.TextField tfDescr
TextField used to input short Material description.


taComment

private java.awt.TextArea taComment
TextArea used to input multi-line Material description.


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.


saveCompFocus

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


iFocus

private int iFocus
Index of TextField


firstRun

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


tkit

private static java.awt.Toolkit tkit
Use the default Toolkit to access Font metrics.


maxCols

private int[] maxCols
Length of longest item in each column: Description, Symbol, Value, Units, MFIM.


BLANKS

static final java.lang.String BLANKS
Blanks to fill in so columns will line up.

See Also:
Constant Field Values
Constructor Detail

GuiMdbData

public GuiMdbData(int fiber_or_matrix)
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

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Detects an Action Event and processes it accordingly.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
evt - Action event.

fillInFields

public void fillInFields(MaterialDataBankItem mdbit)
Fill in fields from Material DataBank item chosen.

Parameters:
mdbit - Material DataBank item chosen.

printAll

private void printAll()
Print contents of Material DataBank item.


paintMe

public void paintMe(java.awt.PrintJob job)
Paint text to Graphics area for printing.

Parameters:
job - Printer context.

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

presetUnits

public void presetUnits()
Set input units.


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.

clearMe

private void clearMe()
Clear all text fields.


setMatl

public void setMatl(java.lang.String matl,
                    java.lang.String descr)
Set Material Code and description.

Parameters:
matl - Material Code.
descr - Material description.

setComment

public void setComment(java.lang.String comment)
Set Comment.

Parameters:
comment - String containing comment displayed in text area.

fixMfimLabel

public void fixMfimLabel(int ib)
Set Label on MFIM button.

Parameters:
ib - Number (subscript) of MFIM button for which to fix Label.

fixAllMfimLabels

public void fixAllMfimLabels()
Set Label on MFIM buttons.


acceptMdb

private boolean acceptMdb()
Check whether Material DataBank data is valid.

Returns:
True, if Material DataBank data is valid; else, false.

saveMdb

private boolean saveMdb()
Save Material DataBank data, if valid.

Returns:
True, if Material DataBank data is valid and saved; else, false.

presetData

public void presetData()
Set title and other ICAN/JAVA data.

Specified by:
presetData in class GuiWindow

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.