SORTIE Java Interface
1
|
This is an internal frame which displays a color legend for species-based charts. More...
Public Member Functions | |
Legend (DataFileManager oManager, String sTitle, String[] p_sSpeciesNames) throws ModelException | |
Constructor. More... | |
Color | getSpeciesColor (int iIndex) throws ModelException |
Gets the color associated with a particular species. More... | |
Color | getSpeciesColor (String sName) throws ModelException |
Gets the color associated with a particular species. More... | |
boolean | getIsSpeciesSelected (int iIndex) throws ModelException |
Get whether or not a species' checkbox indicates that it is selected. More... | |
int | getNumberOfSpecies () |
Gets the total number of species for this legend. More... | |
void | actionPerformed (ActionEvent e) |
Triggered when a checkbox is toggled on or off. More... | |
String | getSpeciesCodeName (int i) throws ModelException |
Gets the internal code species name for a given species index. More... | |
String | getSpeciesDisplayName (int i) throws ModelException |
Gets the species display name for a given species index. More... | |
void | chooseColor (ActionEvent e) |
Displays the color chooser when the user clicks the color chooser button, and extracts the chosen color. More... | |
Protected Member Functions | |
void | createColorList () |
Creates the GUI and lays out all the components. More... | |
Protected Attributes | |
String [] | mp_sSpeciesNames |
The names of each of the species. More... | |
String [] | mp_sDisplayNames |
The names that will be displayed. More... | |
Color [] | mp_oSpeciesColors |
The color for each species. More... | |
JButton [] | mp_jSpeciesColorDisplays |
The color display for each species. More... | |
JCheckBox [] | mp_jSpeciesChecks |
Checkboxes indicating whether or not a species should be visible. More... | |
DataFileManager | m_oManager |
Parent data file manager. More... | |
Private Member Functions | |
void | createGUI () throws Exception |
Creates the GUI and lays out all the components. More... | |
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: Cary Institute of Ecosystem Studies
Edit history:
---------------—
April 28, 2004: Submitted in beta version (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)
December 20, 2010: Added scroll bar to species list and cleaned up code a bit (LEM)
sortie.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 sortie.datavisualizer.Legend.actionPerformed | ( | ActionEvent | e | ) |
Triggered when a checkbox is toggled on or off.
All open charts are redrawn.
e | ActionEvent. Ignored. |
void sortie.datavisualizer.Legend.chooseColor | ( | ActionEvent | e | ) |
Displays the color chooser when the user clicks the color chooser button, and extracts the chosen color.
e | ActionEvent |
|
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. |
|
private |
Creates the GUI and lays out all the components.
Exception | If anything goes wrong. |
boolean sortie.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 sortie.datavisualizer.Legend.getNumberOfSpecies | ( | ) |
Gets the total number of species for this legend.
String sortie.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. |
Color sortie.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 sortie.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. |
String sortie.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. |
|
protected |
Parent data file manager.
|
protected |
Checkboxes indicating whether or not a species should be visible.
|
protected |
The color display for each species.
|
protected |
The color for each species.
|
protected |
The names that will be displayed.
|
protected |
The names of each of the species.