ucar.unidata.idv.control.chart
Class DataChoiceWrapper

java.lang.Object
  extended by ucar.unidata.idv.control.chart.DataChoiceWrapper

public class DataChoiceWrapper
extends Object

Wraps a data choice. Holds extra chart state.

Version:
$Revision: 1.10 $
Author:
IDV Development Team

Field Summary
static int SIDE_LEFT
          which side in legend
static int SIDE_RIGHT
          which side in legend
static int SIDE_UNDEFINED
          which side in legend
static String[] SIDELABELS
          which side in legend
static int[] SIDES
          which side in legend
 
Constructor Summary
DataChoiceWrapper()
          ctor
DataChoiceWrapper(DataChoice dataChoice)
          ctor
 
Method Summary
 Color getColor()
          Get the color from the line state
 Color getColor(int index)
          Either get the color defined for this wrapper or, if null, return the index'ed color
 DataChoice getDataChoice()
          Get the DataChoice property.
 String getDescription()
          Get the description either from me or from the data choice
 String getLabel(Unit unit)
          A utility to format the description with the given unit.
 LineState getLineState()
          Get the LineState property.
 String getMyDescription()
          Get the MyDescription property.
 String getName()
          Get the name from the data choice
 int getSide()
          Get the Side property.
 void setDataChoice(DataChoice value)
          Set the DataChoice property.
 void setLineState(LineState value)
          Set the LineState property.
 void setMyDescription(String value)
          Set the MyDescription property.
 void setSide(int value)
          Set the Side property.
 String toString()
          to string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIDE_UNDEFINED

public static final int SIDE_UNDEFINED
which side in legend

See Also:
Constant Field Values

SIDE_LEFT

public static final int SIDE_LEFT
which side in legend

See Also:
Constant Field Values

SIDE_RIGHT

public static final int SIDE_RIGHT
which side in legend

See Also:
Constant Field Values

SIDES

public static final int[] SIDES
which side in legend


SIDELABELS

public static final String[] SIDELABELS
which side in legend

Constructor Detail

DataChoiceWrapper

public DataChoiceWrapper()
ctor


DataChoiceWrapper

public DataChoiceWrapper(DataChoice dataChoice)
ctor

Parameters:
dataChoice - The data choice to wrap
Method Detail

setDataChoice

public void setDataChoice(DataChoice value)
Set the DataChoice property.

Parameters:
value - The new value for DataChoice

getDataChoice

public DataChoice getDataChoice()
Get the DataChoice property.

Returns:
The DataChoice

getColor

public Color getColor(int index)
Either get the color defined for this wrapper or, if null, return the index'ed color

Parameters:
index - color index
Returns:
color

getColor

public Color getColor()
Get the color from the line state

Returns:
the color

getName

public String getName()
Get the name from the data choice

Returns:
the name

getDescription

public String getDescription()
Get the description either from me or from the data choice

Returns:
the description

getLabel

public String getLabel(Unit unit)
A utility to format the description with the given unit.

Parameters:
unit - The unit. May be null.
Returns:
The label

toString

public String toString()
to string

Overrides:
toString in class Object
Returns:
to string

setSide

public void setSide(int value)
Set the Side property.

Parameters:
value - The new value for Side

getSide

public int getSide()
Get the Side property.

Returns:
The Side

setMyDescription

public void setMyDescription(String value)
Set the MyDescription property.

Parameters:
value - The new value for MyDescription

getMyDescription

public String getMyDescription()
Get the MyDescription property.

Returns:
The MyDescription

setLineState

public void setLineState(LineState value)
Set the LineState property.

Parameters:
value - The new value for LineState

getLineState

public LineState getLineState()
Get the LineState property.

Returns:
The LineState