|
SORTIE Java Interface
1
|
This is a class for displaying a color legend for non-species-based charts. More...
Public Member Functions | |
| NoSpeciesLegend (DataRequest oRequest, String[] p_sDisplayNames) throws ModelException | |
| Constructor. More... | |
| Color | getColor (int iIndex) throws ModelException |
| Gets the color associated with a particular thing, by index. More... | |
| Color | getColor (String sName) throws ModelException |
| Gets the color associated with a particular thing, by name. More... | |
| String | getDisplayName (int i) throws ModelException |
| Gets the display name for a given index. More... | |
| boolean | getIsSelected (int iIndex) throws ModelException |
| Get whether or not a thing's checkbox indicates that it is selected. More... | |
| int | getNumberOfThings () |
| Gets the total number of things for this legend. More... | |
| void | actionPerformed (ActionEvent e) |
| Triggered when a checkbox is toggled on or off. 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 () |
| This picks a default color for each of our things. More... | |
Protected Attributes | |
| String [] | mp_sDisplayNames |
| The names that will be displayed. More... | |
| Color [] | mp_oColors |
| The color for each thing. More... | |
| JButton [] | mp_jColorDisplays |
| The color display for each thing. More... | |
| JCheckBox [] | mp_jChecks |
| Checkboxes indicating whether or not a thing should be visible. More... | |
| DataRequest | m_oRequest |
| Parent data request. More... | |
Private Member Functions | |
| void | createGUI () |
| Creates the GUI and lays out all the components. More... | |
This is a class for displaying a color legend for non-species-based charts.
They get the same capabilities as species-based, such as user-chosen colors.
This is tied to a specific chart, so instead of a separate frame, this will create a JPanel for display.
Copyright: Copyright (c) Charles D. Canham 2016
Company: Cary Institute of Ecosystem Studies
Edit history:
---------------—
April 28, 2016: Created (LEM)
| sortie.datavisualizer.NoSpeciesLegend.NoSpeciesLegend | ( | DataRequest | oRequest, |
| String [] | p_sDisplayNames | ||
| ) | throws ModelException |
Constructor.
This will create the legend window and assign default colors to all the things.
| oRequest | The parent DataRequest object. |
| p_sDisplayNames | The list of items to display in the legend. |
| ModelException | if the list of species has 0 items, or wrapping another type of exception. |
| void sortie.datavisualizer.NoSpeciesLegend.actionPerformed | ( | ActionEvent | e | ) |
Triggered when a checkbox is toggled on or off.
All open charts are redrawn.
| e | ActionEvent. Ignored. |
| void sortie.datavisualizer.NoSpeciesLegend.chooseColor | ( | ActionEvent | e | ) |
Displays the color chooser when the user clicks the color chooser button, and extracts the chosen color.
| e | ActionEvent |
|
protected |
This picks a default color for each of our things.
|
private |
Creates the GUI and lays out all the components.
| Exception | If anything goes wrong. |
| Color sortie.datavisualizer.NoSpeciesLegend.getColor | ( | int | iIndex | ) | throws ModelException |
Gets the color associated with a particular thing, by index.
| iIndex | Index number. |
| ModelException | if the index is not valid. |
| Color sortie.datavisualizer.NoSpeciesLegend.getColor | ( | String | sName | ) | throws ModelException |
Gets the color associated with a particular thing, by name.
| sName | Thing name. |
| ModelException | ModelException if the species name is not valid. |
| String sortie.datavisualizer.NoSpeciesLegend.getDisplayName | ( | int | i | ) | throws ModelException |
Gets the display name for a given index.
| i | Index number. |
| ModelException | If the index is not valid. |
| boolean sortie.datavisualizer.NoSpeciesLegend.getIsSelected | ( | int | iIndex | ) | throws ModelException |
Get whether or not a thing's checkbox indicates that it is selected.
| iIndex | Index number. |
| ModelException | if the index is not valid. |
| int sortie.datavisualizer.NoSpeciesLegend.getNumberOfThings | ( | ) |
Gets the total number of things for this legend.
|
protected |
Parent data request.
|
protected |
Checkboxes indicating whether or not a thing should be visible.
|
protected |
The color display for each thing.
|
protected |
The color for each thing.
|
protected |
The names that will be displayed.
1.8.13