IcanGui
Class GuiIcanDataPlotPL

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

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

Encapsulate the behavior of GUI for ICAN/JAVA data entry of plot data for ply hygrothermomechanical property/response.

Since:
1.0;
Version:
1.1.14;
Updated by Louis Handler on Feb 12, 2007, 08:08 EST (1.1.14).
Updated by Louis Handler on Jul 18, 2005, 08:07 EDT (1.1.5).
Updated by Louis Handler on Nov 22, 2004, 12:39 EST (1.0.10).
Updated by Louis Handler on Dec 8, 2003, 14:38 EST.
Updated by Louis Handler on Sep 15, 2003, 15:43 EDT.
Updated by Louis Handler on Sep 15, 2003, 11:09 EDT.
Updated by Louis Handler on Aug 27, 2002, 10:07 EDT.
Updated by Louis Handler on Aug 27, 2002, 09:33 EDT.
Updated by Louis Handler on Aug 26, 2002, 11:43 EDT.
Updated by Louis Handler on Dec 20, 2000, 10:35 EST.
Updated by Louis Handler on Nov 21, 2000, 15:51 EST.
Updated by Louis Handler on Sep 27, 2000, 15:24 EDT.
Updated by Louis Handler on Aug 29, 2000, 11:22 EDT.
Updated by Louis Handler on Mar 13, 2000, 10:30 EST.
Updated by Louis Handler on Feb 22, 2000, 15:05 EST.
Updated by Louis Handler on Dec 1, 1999, 16:22 EST.
Updated by Louis Handler on Jan 4, 1999, 08:45 EST.
Updated by Louis Handler on Dec 2, 1998, 16:17 EST.
Updated by Louis Handler on Nov 23, 1998, 10:35 EST.
Author:
Louis Handler
See Also:
GuiWindow

Nested Class Summary
(package private)  class GuiIcanDataPlotPL.Madapter
          Mouse Adapter Inner Class
 
Field Summary
private  int[] boxOrder
          Array of subscripts indicating the order in which they are used across the columns.
private static java.lang.String[] buttonLabels
          Labels to display on action buttons.
private  java.awt.Button[] buttons
          Action buttons.
private  java.awt.Checkbox[] cPlotPLX
          Array of Checkboxes corresponding to each X plot variable.
private  java.awt.Checkbox[] cPlotPLY
          Array of Checkboxes corresponding to each Y plot variable.
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 Layout constraints.
private  java.awt.GridBagLayout gbl
          GridBag Layout manager.
private  PlotPanel gPlotPanel
          Plot Panel used for plotting/printing.
private static int iCancel
          Cancel Button will exit this screen discarding any data entered.
private static int iClear
          Clear Button will clear all checkboxes, discarding any data entered.
private static int iExit
          Exit Button will exit the entire program.
private static int iHelp
          Help Button will display a set of information.
private static int iPlot
          Plot Button will verify the data and complete the processing of plotting the ply hygrothermomechanical property/response data.
private static int iSave
          Save Data Button will prompt for a file name to use to save the selected data in a delimiter separated file to be plotted by an external program.
private static int iSaveAll
          Save Data Button will prompt for a file name to use to save the selected data in a delimiter separated file to be plotted by an external program.
private static int iXdata
          Subscript of first subslice data.
private  java.awt.Label[] lPlotPLn
          Array of Labels corresponding to number of each plot variable.
private  java.awt.Label[] lPlotPLs
          Array of Labels corresponding to symbolic name of each plot variable.
private static int mPlot
          maximum number of variables in plot.
private static int nButtons
          Number of action buttons.
private static int nCol
          Number of columns of properties and corresponding checkboxes on a line.
private  int nLayr
          Number of Plys/Slices/Layers in data table.
private static int nMICROs
          number of microstress properties available to plot.
private static int nPLs
          number of ply properties available to plot.
private  int nPlX
          Number of X variables in plot.
private  int nPlY
          Number of Y variables in plot.
private static int nRowMS
          Number of rows of microstress properties available to plot.
private static int nRowPL
          Number of rows of ply properties available to plot.
private  java.awt.Panel panelFrame
          The Panel that contains the data to be displayed within a scrolling frame.
private  GuiIcanPlotFrame plotWindowFrame
          Plot window.
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  int[] thePlX
          Subscripts of X variables in plot.
private  int[] thePlY
          Subscripts of X variables in plot.
private  java.awt.Label theTitle
          Label containing the description/title of the ICAN/JAVA run.
private  java.awt.Color unusedColor
          The color for text when associated checkboxes are not used.
 
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
GuiIcanDataPlotPL()
          Constructor creates window to display buttons and checkboxes.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Detect an Action Event and Handle it accordingly.
 void changeGuiUnits()
          Change units on GUI for this class.
private  boolean checkPlotPL()
          Test whether to create plot.
private  boolean checkSavePL()
          Test whether to save data for plotting.
private  void doPlotPL()
          Create plot.
private  void doSaveAllPL()
          Obtain list of all available values for plotting.
private  void doSavePL()
          Obtain list of data to plot: all x values selected before all y values selected.
 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 from ICAN/JAVA data.
private  void savePL(int[] listicb, int nList)
          Prompt for a file name and save the data for plotting.
 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.


nLayr

private int nLayr
Number of Plys/Slices/Layers in data table.


gbl

private java.awt.GridBagLayout gbl
GridBag Layout manager.


gbc

private java.awt.GridBagConstraints gbc
GridBag Layout constraints.


theTitle

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


buttonLabels

private static final java.lang.String[] buttonLabels
Labels to display on action buttons.


iPlot

private static final int iPlot
Plot Button will verify the data and complete the processing of plotting the ply hygrothermomechanical property/response 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 all checkboxes, 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 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

iSave

private static final int iSave
Save Data Button will prompt for a file name to use to save the selected data in a delimiter separated file to be plotted by an external program. The first record will contain the header information.

See Also:
Constant Field Values

iSaveAll

private static final int iSaveAll
Save Data Button will prompt for a file name to use to save the selected data in a delimiter separated file to be plotted by an external program. The first record will contain the header information.

See Also:
Constant Field Values

iXdata

private static final int iXdata
Subscript of first subslice data. Used to determine whether to add and where to add subslice X,Y, etc.

See Also:
Constant Field Values

nButtons

private static final int nButtons
Number of action buttons.


buttons

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


nPLs

private static final int nPLs
number of ply properties available to plot.


nMICROs

private static final int nMICROs
number of microstress properties available to plot.


cPlotPLX

private java.awt.Checkbox[] cPlotPLX
Array of Checkboxes corresponding to each X plot variable.


cPlotPLY

private java.awt.Checkbox[] cPlotPLY
Array of Checkboxes corresponding to each Y plot variable.


boxOrder

private int[] boxOrder
Array of subscripts indicating the order in which they are used across the columns. The first value is the subscript zero. The second value is higher by the number of items in a column for that section. The third value is higher by the number of items in a column for that section. The fourth value is one higher than the first value. And so on.


nCol

private static final int nCol
Number of columns of properties and corresponding checkboxes on a line.

See Also:
Constant Field Values

nRowPL

private static final int nRowPL
Number of rows of ply properties available to plot.


nRowMS

private static final int nRowMS
Number of rows of microstress properties available to plot.


lPlotPLn

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


lPlotPLs

private java.awt.Label[] lPlotPLs
Array of Labels corresponding to symbolic name of each plot variable. Label is separated from the corresponding checkbox so that the Label can be left justified.


mPlot

private static final int mPlot
maximum number of variables in plot.

See Also:
Constant Field Values

thePlX

private int[] thePlX
Subscripts of X variables in plot.


thePlY

private int[] thePlY
Subscripts of X variables in plot.


nPlX

private int nPlX
Number of X variables in plot.


nPlY

private int nPlY
Number of Y variables in plot.


plotWindowFrame

private GuiIcanPlotFrame plotWindowFrame
Plot window.


gPlotPanel

private PlotPanel gPlotPanel
Plot Panel used for plotting/printing.


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.


unusedColor

private java.awt.Color unusedColor
The color for text when associated checkboxes are not used. The normal color for text when associated checkboxes are used is black. Therefore, this color may not be black. This color may also not be the same as the background color or the text would become completely invisible.


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

GuiIcanDataPlotPL

public GuiIcanDataPlotPL()
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.

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 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()/setVisible(true).

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.

doSavePL

private void doSavePL()
Obtain list of data to plot: all x values selected before all y values selected. Then prompt for a file name and save the data for plotting.


doSaveAllPL

private void doSaveAllPL()
Obtain list of all available values for plotting. Then prompt for a file name and save the data for plotting.


savePL

private void savePL(int[] listicb,
                    int nList)
Prompt for a file name and save the data for plotting.

Parameters:
listicb - List of subscripts of data to save for editing or plotting.
nList - Number of subscripts in list.

checkSavePL

private boolean checkSavePL()
Test whether to save data for plotting.

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

checkPlotPL

private boolean checkPlotPL()
Test whether to create plot.

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

doPlotPL

private void doPlotPL()
Create plot.


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.