SORTIE Java Interface  1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
sortie.gui.GridSetup Class Reference

Displays grid settings for editing. More...

Inheritance diagram for sortie.gui.GridSetup:

Public Member Functions

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

Protected Member Functions

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

Private Member Functions

void buildGUI (GUIManager oManager)
 Constructs the GUI. More...
 
void writeMap (FileWriter oOut, String[][] p_sVals) throws IOException
 Writes the map file array. More...
 

Private Attributes

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

Detailed Description

Displays grid settings for editing.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Cary 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

◆ GridSetup() [1/2]

sortie.gui.GridSetup.GridSetup ( Frame  jParent,
GUIManager  oManager 
)

Constructor.

Parameters
jParentFrame in which to display this dialog.
oManagerGUIManager object.

◆ GridSetup() [2/2]

sortie.gui.GridSetup.GridSetup ( Dialog  jParent,
GUIManager  oManager 
)

Constructor.

Parameters
jParentFrame in which to display this dialog.
oManagerGUIManager object.

Member Function Documentation

◆ actionPerformed()

void sortie.gui.GridSetup.actionPerformed ( ActionEvent  oEvent)

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

Parameters
oEventEvent which triggered this function.

◆ buildGUI()

void sortie.gui.GridSetup.buildGUI ( GUIManager  oManager)
private

Constructs the GUI.

Parameters
oManagerGUIManager object.

◆ saveGrid()

void sortie.gui.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
oGridGrid for which to write maps.
Exceptions
ModelExceptionif there is a problem writing the file.

◆ writeMap()

void sortie.gui.GridSetup.writeMap ( FileWriter  oOut,
String  p_sVals[][] 
) throws 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
oOutFile to write to
p_sValsValues to write. The first array index is X cell coordinate, the second is Y.
Exceptions
java.io.IOExceptionif there is a problem writing the file

Member Data Documentation

◆ m_jClearMapButton

JButton sortie.gui.GridSetup.m_jClearMapButton = new JButton("Clear grid map")
private

Button for clearing current grid map values.

◆ m_jGridListCombo

SORTIEComboBox<String> sortie.gui.GridSetup.m_jGridListCombo
private

The combo box displaying enabled grids.

◆ m_jXCellLengthEdit

JTextField sortie.gui.GridSetup.m_jXCellLengthEdit = new JTextField()
private

For editing length of X cells.

◆ m_oManager

GUIManager sortie.gui.GridSetup.m_oManager
private

GUIManager object.

◆ m_sHelpID

String sortie.gui.GridSetup.m_sHelpID = "windows.grid_setup_window"
private

Help ID string.

◆ mp_fXLengths

float [] sortie.gui.GridSetup.mp_fXLengths
private

Grid cell X lengths - indexes match mp_oGridList.

◆ mp_oGridList

Grid [] sortie.gui.GridSetup.mp_oGridList
private

List of grids to display.


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