SORTIE Java Interface  1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
sortie.datavisualizer.NoSpeciesLegend Class Reference

This is a class for displaying a color legend for non-species-based charts. More...

Inheritance diagram for sortie.datavisualizer.NoSpeciesLegend:

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...
 

Detailed Description

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

Author
Lora E. Murphy
Version
1.0


Edit history:
---------------—
April 28, 2016: Created (LEM)

Constructor & Destructor Documentation

◆ NoSpeciesLegend()

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.

Parameters
oRequestThe parent DataRequest object.
p_sDisplayNamesThe list of items to display in the legend.
Exceptions
ModelExceptionif the list of species has 0 items, or wrapping another type of exception.

Member Function Documentation

◆ actionPerformed()

void sortie.datavisualizer.NoSpeciesLegend.actionPerformed ( ActionEvent  e)

Triggered when a checkbox is toggled on or off.

All open charts are redrawn.

Parameters
eActionEvent. Ignored.

◆ chooseColor()

void sortie.datavisualizer.NoSpeciesLegend.chooseColor ( ActionEvent  e)

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

Parameters
eActionEvent

◆ createColorList()

void sortie.datavisualizer.NoSpeciesLegend.createColorList ( )
protected

This picks a default color for each of our things.

◆ createGUI()

void sortie.datavisualizer.NoSpeciesLegend.createGUI ( )
private

Creates the GUI and lays out all the components.

Exceptions
ExceptionIf anything goes wrong.

◆ getColor() [1/2]

Color sortie.datavisualizer.NoSpeciesLegend.getColor ( int  iIndex) throws ModelException

Gets the color associated with a particular thing, by index.

Parameters
iIndexIndex number.
Returns
This thing's color.
Exceptions
ModelExceptionif the index is not valid.

◆ getColor() [2/2]

Color sortie.datavisualizer.NoSpeciesLegend.getColor ( String  sName) throws ModelException

Gets the color associated with a particular thing, by name.

Parameters
sNameThing name.
Returns
This species' color.
Exceptions
ModelExceptionModelException if the species name is not valid.

◆ getDisplayName()

String sortie.datavisualizer.NoSpeciesLegend.getDisplayName ( int  i) throws ModelException

Gets the display name for a given index.

Parameters
iIndex number.
Returns
Thing name.
Exceptions
ModelExceptionIf the index is not valid.

◆ getIsSelected()

boolean sortie.datavisualizer.NoSpeciesLegend.getIsSelected ( int  iIndex) throws ModelException

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

Parameters
iIndexIndex number.
Returns
Whether or not the thing is selected and should be shown in graphs.
Exceptions
ModelExceptionif the index is not valid.

◆ getNumberOfThings()

int sortie.datavisualizer.NoSpeciesLegend.getNumberOfThings ( )

Gets the total number of things for this legend.

Returns
Number of things.

Member Data Documentation

◆ m_oRequest

DataRequest sortie.datavisualizer.NoSpeciesLegend.m_oRequest
protected

Parent data request.

◆ mp_jChecks

JCheckBox [] sortie.datavisualizer.NoSpeciesLegend.mp_jChecks
protected

Checkboxes indicating whether or not a thing should be visible.

◆ mp_jColorDisplays

JButton [] sortie.datavisualizer.NoSpeciesLegend.mp_jColorDisplays
protected

The color display for each thing.

◆ mp_oColors

Color [] sortie.datavisualizer.NoSpeciesLegend.mp_oColors
protected

The color for each thing.

◆ mp_sDisplayNames

String [] sortie.datavisualizer.NoSpeciesLegend.mp_sDisplayNames
protected

The names that will be displayed.


The documentation for this class was generated from the following file: