Inheritance diagram for datavisualizer::Legend:
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. |
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
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.
oManager | The parent DataFileManager object. | |
sTitle | Window title | |
p_sSpeciesNames | The list of species to display in the legend. |
ModelException | if the list of species has 0 items, or wrapping another type of exception. |
void datavisualizer::Legend::CheckBox_actionPerformed | ( | ActionEvent | e | ) | [inline] |
Triggered when a checkbox is toggled on or off.
All open charts are redrawn.
e | ActionEvent. Ignored. |
void datavisualizer::Legend::ChooseColor | ( | ActionEvent | e | ) | [inline] |
Displays the color chooser when the user clicks the color chooser button, and extracts the chosen color.
e | ActionEvent |
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.
java.lang.Exception | If anything goes wrong. |
boolean datavisualizer::Legend::GetIsSpeciesSelected | ( | int | iIndex | ) | throws ModelException [inline] |
Get whether or not a species' checkbox indicates that it is selected.
iIndex | Species index number. |
ModelException | if the species index is not valid. |
int datavisualizer::Legend::GetNumberOfSpecies | ( | ) | [inline] |
Gets the total number of species for this legend.
String datavisualizer::Legend::GetSpeciesCodeName | ( | int | i | ) | throws ModelException [inline] |
Gets the internal code species name for a given species index.
i | Species index number. |
ModelException | If the species index is not valid. |
Color datavisualizer::Legend::GetSpeciesColor | ( | String | sName | ) | throws ModelException [inline] |
Gets the color associated with a particular species.
sName | Species' name. |
ModelException | ModelException if the species name is not valid. |
Color datavisualizer::Legend::GetSpeciesColor | ( | int | iIndex | ) | throws ModelException [inline] |
Gets the color associated with a particular species.
iIndex | Species index number. |
ModelException | if the species index is not valid. |
String datavisualizer::Legend::GetSpeciesDisplayName | ( | int | i | ) | throws ModelException [inline] |
Gets the species display name for a given species index.
i | Species index number. |
ModelException | If the species index is not valid. |