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 () |
Creates the GUI and lays out all the components. | |
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. | |
JButton[] | mp_jSpeciesColorDisplays |
The color display for each species. | |
JCheckBox[] | mp_jSpeciesChecks |
Checkboxes indicating whether or not a species should be visible. | |
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 |
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.CreateGUI | ( | ) | throws Exception [private] |
Creates the GUI and lays out all the components.
java.lang.Exception | If anything goes wrong. |
void datavisualizer.Legend.CreateColorList | ( | ) | [protected] |
Creates the GUI and lays out all the components.
java.lang.Exception | If anything goes wrong. This picks a default color for each of our species. |
Color datavisualizer.Legend.GetSpeciesColor | ( | int | iIndex | ) | throws ModelException |
Gets the color associated with a particular species.
iIndex | Species index number. |
ModelException | if the species index is not valid. |
Color datavisualizer.Legend.GetSpeciesColor | ( | String | sName | ) | throws ModelException |
Gets the color associated with a particular species.
sName | Species' name. |
ModelException | ModelException if the species name is not valid. |
boolean datavisualizer.Legend.GetIsSpeciesSelected | ( | int | iIndex | ) | throws ModelException |
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 | ( | ) |
Gets the total number of species for this legend.
void datavisualizer.Legend.CheckBox_actionPerformed | ( | ActionEvent | e | ) |
Triggered when a checkbox is toggled on or off.
All open charts are redrawn.
e | ActionEvent. Ignored. |
String datavisualizer.Legend.GetSpeciesCodeName | ( | int | i | ) | throws ModelException |
Gets the internal code species name for a given species index.
i | Species index number. |
ModelException | If the species index is not valid. |
String datavisualizer.Legend.GetSpeciesDisplayName | ( | int | i | ) | throws ModelException |
Gets the species display name for a given species index.
i | Species index number. |
ModelException | If the species index is not valid. |
void datavisualizer.Legend.ChooseColor | ( | ActionEvent | e | ) |
Displays the color chooser when the user clicks the color chooser button, and extracts the chosen color.
e | ActionEvent |
String [] datavisualizer.Legend.mp_sSpeciesNames [protected] |
The names of each of the species.
String [] datavisualizer.Legend.mp_sDisplayNames [protected] |
The names that will be displayed.
Color [] datavisualizer.Legend.mp_oSpeciesColors [protected] |
The color for each species.
JButton [] datavisualizer.Legend.mp_jSpeciesColorDisplays [protected] |
The color display for each species.
JCheckBox [] datavisualizer.Legend.mp_jSpeciesChecks [protected] |
Checkboxes indicating whether or not a species should be visible.
DataFileManager datavisualizer.Legend.m_oManager [protected] |
Parent data file manager.