javawrapper.GridSetup Class Reference

Displays grid settings for editing. More...

Inherits javax::swing::JDialog.

List of all members.

Public Member Functions

 GridSetup (java.awt.Frame jParent, GUIManager oManager)
 Constructor.
 GridSetup (java.awt.Dialog jParent, GUIManager oManager)
 Constructor.
void actionPerformed (java.awt.event.ActionEvent oEvent)
 Called when the combo box is chosen or the buttons are pushed.

Protected Member Functions

void SaveGrid (Grid oGrid) throws ModelException
 Saves the contents of a grid's map values to a tab-delimited text file.

Static Package Attributes

static final long serialVersionUID = 1

Private Member Functions

void BuildGUI (GUIManager oManager)
 Constructs the GUI.
void WriteMap (FileWriter oOut, String[][] p_sVals) throws java.io. IOException
 Writes the map file array.

Private Attributes

SORTIEComboBox m_jGridListCombo
 The combo box displaying enabled grids.
Grid[] mp_oGridList
 List of grids to display.
float[] mp_fXLengths
 Grid cell X lengths - indexes match mp_oGridList.
float[] mp_fYLengths
 Grid cell Y lengths - indexes match mp_oGridList.
JTextField m_jXCellLengthEdit = new JTextField()
 For editing length of X cells.
JTextField m_jYCellLengthEdit = new JTextField()
 For editing length of Y cells.
JButton m_jClearMapButton = new JButton("Clear grid map")
 Button for clearing current grid map values.
GUIManager m_oManager
 GUIManager object.
String m_sHelpID = "windows.grid_setup_window"
 Help ID string.


Detailed Description

Displays grid settings for editing.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
August 8, 2006: Made it so that there would be no duplicate grids (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)

Constructor & Destructor Documentation

javawrapper.GridSetup.GridSetup ( java.awt.Frame  jParent,
GUIManager  oManager 
)

Constructor.

Parameters:
jParent Frame in which to display this dialog.
oManager GUIManager object.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

javawrapper.GridSetup.GridSetup ( java.awt.Dialog  jParent,
GUIManager  oManager 
)

Constructor.

Parameters:
jParent Frame in which to display this dialog.
oManager GUIManager object.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


Member Function Documentation

void javawrapper.GridSetup.BuildGUI ( GUIManager  oManager  )  [private]

Constructs the GUI.

Parameters:
oManager GUIManager object.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper.GridSetup.actionPerformed ( java.awt.event.ActionEvent  oEvent  ) 

Called when the combo box is chosen or the buttons are pushed.

Parameters:
oEvent Event which triggered this function.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper.GridSetup.SaveGrid ( Grid  oGrid  )  throws ModelException [protected]

Saves the contents of a grid's map values to a tab-delimited text file.

The user gets a file chooser, and assuming they enter a filename, the file is saved. All values in the grid are saved; maps for different values are written successively.

Parameters:
oGrid Grid for which to write maps.
Exceptions:
ModelException if there is a problem writing the file.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper.GridSetup.WriteMap ( FileWriter  oOut,
String  p_sVals[][] 
) throws java.io. IOException [private]

Writes the map file array.

When writing a grid as a table of values, X = columns and Y = rows. This means that in the array to write, the first index is columns, the second is rows. We want to write it such that the data will end up written so that the bottom left corner will be cell 0,0, equal to southwest. We have to write our columns (first index) from 0 up, but we have to write our rows backwards (down to 0).

Parameters:
oOut File to write to
p_sVals Values to write. The first array index is X cell coordinate, the second is Y.
Exceptions:
java.io.IOException if there is a problem writing the file

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


Member Data Documentation

final long javawrapper.GridSetup.serialVersionUID = 1 [static, package]

The combo box displaying enabled grids.

List of grids to display.

Grid cell X lengths - indexes match mp_oGridList.

Grid cell Y lengths - indexes match mp_oGridList.

JTextField javawrapper.GridSetup.m_jXCellLengthEdit = new JTextField() [private]

For editing length of X cells.

JTextField javawrapper.GridSetup.m_jYCellLengthEdit = new JTextField() [private]

For editing length of Y cells.

JButton javawrapper.GridSetup.m_jClearMapButton = new JButton("Clear grid map") [private]

Button for clearing current grid map values.

GUIManager object.

String javawrapper.GridSetup.m_sHelpID = "windows.grid_setup_window" [private]

Help ID string.


The documentation for this class was generated from the following file:

Generated on Wed Oct 28 14:01:20 2009 for SORTIE Java Interface by  doxygen 1.5.6