datavisualizer::Legend Class Reference

This is an internal frame which displays a color legend for species-based charts. More...

Inheritance diagram for datavisualizer::Legend:

datavisualizer::DetailedOutputLegend List of all members.

Public Member Functions

 Legend (DataFileManager oManager, String sTitle, String[] p_sSpeciesNames) throws ModelException
 Constructor.
Color GetSpeciesColor (int iIndex) throws ModelException
 Gets the color associated with a particular species.
Color GetSpeciesColor (String sName) throws ModelException
 Gets the color associated with a particular species.
boolean GetIsSpeciesSelected (int iIndex) throws ModelException
 Get whether or not a species' checkbox indicates that it is selected.
int GetNumberOfSpecies ()
 Gets the total number of species for this legend.
void CheckBox_actionPerformed (ActionEvent e)
 Triggered when a checkbox is toggled on or off.
String GetSpeciesCodeName (int i) throws ModelException
 Gets the internal code species name for a given species index.
String GetSpeciesDisplayName (int i) throws ModelException
 Gets the species display name for a given species index.
void ChooseColor (ActionEvent e)
 Displays the color chooser when the user clicks the color chooser button, and extracts the chosen color.

Protected Member Functions

void CreateColorList ()
 This picks a default color for each of our species.

Protected Attributes

String[] mp_sSpeciesNames
 The names of each of the species.
String[] mp_sDisplayNames
 The names that will be displayed.
Color[] mp_oSpeciesColors
 The color for each species.
JPanel[] mp_jSpeciesPanels
 The panel grouping each species label with its color.
JLabel[] mp_jSpeciesLabels
 The text label for each species.
JButton[] mp_jSpeciesColorDisplays
 The color display for each species.
JCheckBox[] mp_jSpeciesChecks
 Checkboxes indicating whether or not a species should be visible.
FlowLayout[] mp_oLayouts
 To lay out everything correctly in each species panel.
GridLayout gridLayout1 = new GridLayout()
 Layout manager for this window.
DataFileManager m_oManager
 Parent data file manager.

Private Member Functions

void CreateGUI () throws Exception
 Creates the GUI and lays out all the components.

Detailed Description

This is an internal frame which displays a color legend for species-based charts.

When the user clicks on a color, they get a color chooser that lets them change a species's color.

When species names come in, they may have underscores substituted for spaces. Thus, a separate set of display names is used that will have the underscores removed. The species names with underscores is what all other objects will expect when they ask the legend for help parsing a detailed output file.

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)


Constructor & Destructor Documentation

datavisualizer::Legend::Legend ( DataFileManager  oManager,
String  sTitle,
String[]  p_sSpeciesNames 
) throws ModelException [inline]

Constructor.

This will create the legend window and assign default colors to all the species.

Parameters:
oManager The parent DataFileManager object.
sTitle Window title
p_sSpeciesNames The list of species to display in the legend.
Exceptions:
ModelException if the list of species has 0 items, or wrapping another type of exception.

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


Member Function Documentation

void datavisualizer::Legend::CheckBox_actionPerformed ( ActionEvent  e  )  [inline]

Triggered when a checkbox is toggled on or off.

All open charts are redrawn.

Parameters:
e ActionEvent. Ignored.

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

void datavisualizer::Legend::ChooseColor ( ActionEvent  e  )  [inline]

Displays the color chooser when the user clicks the color chooser button, and extracts the chosen color.

Parameters:
e ActionEvent

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

void datavisualizer::Legend::CreateColorList (  )  [inline, protected]

This picks a default color for each of our species.


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

void datavisualizer::Legend::CreateGUI (  )  throws Exception [inline, private]

Creates the GUI and lays out all the components.

Exceptions:
java.lang.Exception If anything goes wrong.

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

boolean datavisualizer::Legend::GetIsSpeciesSelected ( int  iIndex  )  throws ModelException [inline]

Get whether or not a species' checkbox indicates that it is selected.

Parameters:
iIndex Species index number.
Returns:
Whether or not the species is selected and should be shown in graphs.
Exceptions:
ModelException if the species index is not valid.

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

int datavisualizer::Legend::GetNumberOfSpecies (  )  [inline]

Gets the total number of species for this legend.

Returns:
Number of species.

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

String datavisualizer::Legend::GetSpeciesCodeName ( int  i  )  throws ModelException [inline]

Gets the internal code species name for a given species index.

Parameters:
i Species index number.
Returns:
Species name.
Exceptions:
ModelException If the species index is not valid.

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

Color datavisualizer::Legend::GetSpeciesColor ( String  sName  )  throws ModelException [inline]

Gets the color associated with a particular species.

Parameters:
sName Species' name.
Returns:
This species' color.
Exceptions:
ModelException ModelException if the species name is not valid.

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

Color datavisualizer::Legend::GetSpeciesColor ( int  iIndex  )  throws ModelException [inline]

Gets the color associated with a particular species.

Parameters:
iIndex Species index number.
Returns:
This species' color.
Exceptions:
ModelException if the species index is not valid.

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

String datavisualizer::Legend::GetSpeciesDisplayName ( int  i  )  throws ModelException [inline]

Gets the species display name for a given species index.

Parameters:
i Species index number.
Returns:
Species name.
Exceptions:
ModelException If the species index is not valid.

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


The documentation for this class was generated from the following file:
Generated on Wed Nov 29 08:45:01 2006 for SORTIE Java Interface by  doxygen 1.4.7