ucar.visad.display
Class ColorScaleInfo

java.lang.Object
  extended by ucar.visad.display.ColorScaleInfo

public class ColorScaleInfo
extends Object

Class to hold information about a ColorScale

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

Field Summary
static String BOTTOM
          Upper Right Placement
static int HORIZONTAL
          Horizontal orientation
static String LEFT
          Lower Left Placement
static String RIGHT
          Upper Left Placement
static String TOP
          Upper Left Placement
static int VERTICAL
          Vertical orientation
 
Constructor Summary
ColorScaleInfo()
          default ctor
ColorScaleInfo(ColorScaleInfo that)
          Create a color scale information object from another
ColorScaleInfo(String name)
          Construct a new ColorScaleInfo with the given name and default orientation.
ColorScaleInfo(String name, int orient)
          Construct a new ColorScaleInfo with the given name and orientation.
ColorScaleInfo(String name, int orient, float[][] palette)
          Create a color scale information object with the given parameters.
ColorScaleInfo(String name, int orient, float x, float y, Font labelFont, float[][] colorPalette)
          Create a color scale information object with the given parameters.
ColorScaleInfo(String name, int orient, float x, float y, Font labelFont, float[][] colorPalette, Color labelColor)
          Create a color scale information object with the given parameters.
ColorScaleInfo(String name, int orient, String placement)
          Construct a new ColorScaleInfo with the given name and orientation and placement.
ColorScaleInfo(String name, int orient, String placement, Font labelFont, float[][] colorPalette)
          Create a color scale information object with the given parameters.
 
Method Summary
 float[][] getColorPalette()
          Get the color palette of the color scale.
 boolean getIsVisible()
          Get the color of the labels
 Color getLabelColor()
          Get the label Font of the color scale.
 Font getLabelFont()
          Get the label Font of the color scale.
 int getLabelSide()
          Get the color of the labels
 String getName()
          Get the name of the color scale.
 int getOrientation()
          Get the orientation of the color scale.
 String getPlacement()
          Get the placment of the color scale.
 float getX()
          Get the x position of the color scale.
 float getY()
          Get the y position of the color scale.
 void setColorPalette(float[][] colorPalette)
          Set the color palette of the color scale.
 void setIsVisible(boolean show)
          Set the visibility
 void setLabelColor(Color color)
          Set the label Color of the color scale.
 void setLabelFont(Font font)
          Set the label Font of the color scale.
 void setLabelSide(int side)
          Set the labelling side.
 void setName(String name)
          Set the name of the color scale.
 void setOrientation(int orient)
          Set the orientation of the color scale.
 void setPlacement(String place)
          Set the placement of the color scale.
 void setX(float x)
          Set the x position of the color scale.
 void setY(float y)
          Set the y position of the color scale.
 String toString()
          To string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HORIZONTAL

public static final int HORIZONTAL
Horizontal orientation

See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
Vertical orientation

See Also:
Constant Field Values

TOP

public static final String TOP
Upper Left Placement

See Also:
Constant Field Values

BOTTOM

public static final String BOTTOM
Upper Right Placement

See Also:
Constant Field Values

LEFT

public static final String LEFT
Lower Left Placement

See Also:
Constant Field Values

RIGHT

public static final String RIGHT
Upper Left Placement

See Also:
Constant Field Values
Constructor Detail

ColorScaleInfo

public ColorScaleInfo()
default ctor


ColorScaleInfo

public ColorScaleInfo(String name)
Construct a new ColorScaleInfo with the given name and default orientation.

Parameters:
name - name for this color scale object.

ColorScaleInfo

public ColorScaleInfo(String name,
                      int orient)
Construct a new ColorScaleInfo with the given name and orientation.

Parameters:
name - name for this color scale object.
orient - orientation for this ColorScale

ColorScaleInfo

public ColorScaleInfo(String name,
                      int orient,
                      String placement)
Construct a new ColorScaleInfo with the given name and orientation and placement.

Parameters:
name - name for this color scale object.
orient - orientation for this ColorScale
placement - the placement

ColorScaleInfo

public ColorScaleInfo(String name,
                      int orient,
                      float[][] palette)
Create a color scale information object with the given parameters.

Parameters:
name - name of the ColorScale
orient - orientation (HORIZONTAL, VERTICAL)
palette - color palette (rgb values)

ColorScaleInfo

public ColorScaleInfo(String name,
                      int orient,
                      float x,
                      float y,
                      Font labelFont,
                      float[][] colorPalette)
Create a color scale information object with the given parameters.

Parameters:
name - name of the ColorScale
orient - orientation (HORIZONTAL, VERTICAL)
x - x location (percent from left side of display)
y - y location (percent from top side of display)
labelFont - font used for labels
colorPalette - color palette (rgb values)

ColorScaleInfo

public ColorScaleInfo(String name,
                      int orient,
                      String placement,
                      Font labelFont,
                      float[][] colorPalette)
Create a color scale information object with the given parameters.

Parameters:
name - name of the ColorScale
orient - orientation (HORIZONTAL, VERTICAL)
placement - placement (TOP, LEFT, etc)
labelFont - font used for labels
colorPalette - color palette (rgb values)

ColorScaleInfo

public ColorScaleInfo(String name,
                      int orient,
                      float x,
                      float y,
                      Font labelFont,
                      float[][] colorPalette,
                      Color labelColor)
Create a color scale information object with the given parameters.

Parameters:
name - name of the ColorScale
orient - orientation (HORIZONTAL, VERTICAL)
x - x location (percent from left side of display)
y - y location (percent from top side of display)
labelFont - font used for labels
colorPalette - color palette (rgb values)
labelColor - color for labels

ColorScaleInfo

public ColorScaleInfo(ColorScaleInfo that)
Create a color scale information object from another

Parameters:
that - the other ColorScaleInfo
Method Detail

setName

public void setName(String name)
Set the name of the color scale.

Parameters:
name - name to use

getName

public String getName()
Get the name of the color scale.

Returns:
name of color scale.

setOrientation

public void setOrientation(int orient)
Set the orientation of the color scale.

Parameters:
orient - orientation to use

getOrientation

public int getOrientation()
Get the orientation of the color scale.

Returns:
orientation of color scale.

setPlacement

public void setPlacement(String place)
Set the placement of the color scale.

Parameters:
place - placement to use (e.g. TOP)

getPlacement

public String getPlacement()
Get the placment of the color scale.

Returns:
placement of color scale.

setX

public void setX(float x)
Set the x position of the color scale.

Parameters:
x - x position to use

getX

public float getX()
Get the x position of the color scale.

Returns:
x position of color scale.

setY

public void setY(float y)
Set the y position of the color scale.

Parameters:
y - y position to use

getY

public float getY()
Get the y position of the color scale.

Returns:
y position of color scale.

setLabelFont

public void setLabelFont(Font font)
Set the label Font of the color scale.

Parameters:
font - font to use

getLabelFont

public Font getLabelFont()
Get the label Font of the color scale.

Returns:
label Font of color scale.

setColorPalette

public void setColorPalette(float[][] colorPalette)
Set the color palette of the color scale.

Parameters:
colorPalette - color palette to use

getColorPalette

public float[][] getColorPalette()
Get the color palette of the color scale.

Returns:
color palette color scale.

setLabelColor

public void setLabelColor(Color color)
Set the label Color of the color scale.

Parameters:
color - Color to use

getLabelColor

public Color getLabelColor()
Get the label Font of the color scale.

Returns:
label Font of color scale.

setLabelSide

public void setLabelSide(int side)
Set the labelling side.

Parameters:
side - labelling side (PRIMARY, SECONDARY);

getLabelSide

public int getLabelSide()
Get the color of the labels

Returns:
label color

setIsVisible

public void setIsVisible(boolean show)
Set the visibility

Parameters:
show - true to be visible

getIsVisible

public boolean getIsVisible()
Get the color of the labels

Returns:
label color

toString

public String toString()
To string

Overrides:
toString in class Object
Returns:
To string