Class ColorScaleInfo

java.lang.Object
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 Details

  • Constructor Details

    • ColorScaleInfo

      public ColorScaleInfo()
      default ctor
    • ColorScaleInfo

      public ColorScaleInfo(String name)
      Create a ColorScaleInfo with a name
      Parameters:
      name - the name
    • 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(String name, int orient, float x, float y, Font labelFont, float[][] colorPalette, Color labelColor, boolean useAlpha)
      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
      useAlpha - true to use alpha when drawing color scale
    • ColorScaleInfo

      public ColorScaleInfo(ColorScaleInfo that)
      Create a color scale information object from another
      Parameters:
      that - the other ColorScaleInfo
    • ColorScaleInfo

      public ColorScaleInfo(String params, boolean isParamString)
      Create a color scale information object from the given param string
      Parameters:
      params - the param string. see getParamStringFormat for details
      isParamString - true if this is a param string
  • Method Details

    • getParamStringFormat

      public static String getParamStringFormat()
      Get the param string format
      Returns:
      the param string format
    • 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 visibility
      Returns:
      visibility
    • setLabelVisible

      public void setLabelVisible(boolean show)
      Set the label visibility
      Parameters:
      show - true to be label visible
    • getLabelVisible

      public boolean getLabelVisible()
      Get the label visibility
      Returns:
      label visibility
    • getUseAlpha

      public boolean getUseAlpha()
      Gets the useAlpha property
      Returns:
      the useAlpha
    • setUseAlpha

      public void setUseAlpha(boolean useAlpha)
      Sets the useAlpha property
      Parameters:
      useAlpha - the useAlpha to set
    • toString

      public String toString()
      To string
      Overrides:
      toString in class Object
      Returns:
      To string
    • setUnit

      public void setUnit(Unit unit)
      Sets the unit.
      Parameters:
      unit - the new unit
    • getUnit

      public Unit getUnit()
      Gets the unit.
      Returns:
      the unit
    • isUnitVisible

      public boolean isUnitVisible()
      Checks if is unit visible.
      Returns:
      true, if is unit visible
    • setUnitVisible

      public void setUnitVisible(boolean unitVisible)
      Sets the unit visible.
      Parameters:
      unitVisible - the new unit visible