Documentation of 'visad.BaseColorControl' Java class
BaseColorControl
visad

Class BaseColorControl

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    ColorAlphaControl, ColorControl


    public class BaseColorControl
    extends Control
    BaseColorControl is the VisAD class for controlling N-component Color DisplayRealType-s.

    See Also:
    Serialized Form
    • Field Detail

      • ALPHA

        public static final int ALPHA
        The index of the alpha channel.

        NOTE: ALPHA will always be the last index.

        See Also:
        Constant Field Values
      • DEFAULT_NUMBER_OF_COLORS

        public static final int DEFAULT_NUMBER_OF_COLORS
        The default number of colors
        See Also:
        Constant Field Values
    • Constructor Detail

      • BaseColorControl

        public BaseColorControl(DisplayImpl d,
                                int components)
        Create a basic color control.
        Parameters:
        d - The display with which this control is associated.
        components - Either 3 (if this is a red/green/blue control) or 4 (if there is also an alpha component).
    • Method Detail

      • initTableGreyWedge

        public static float[][] initTableGreyWedge(float[][] table)
        Initialize table to a grey wedge.
        Parameters:
        table - Table to be initialized.
        Returns:
        the initialized table.
      • initTableGreyWedge

        public static float[][] initTableGreyWedge(float[][] table,
                                                   boolean invert)
      • initGreyWedge

        public void initGreyWedge()
        Initialize the colormap to a grey wedge
      • initGreyWedge

        public void initGreyWedge(boolean invert)
      • initTableVis5D

        public static float[][] initTableVis5D(float[][] table)
        Initialize table to the Vis5D colormap (opaque blue-green-red rainbow).
        Parameters:
        table - Table to be initialized.
        Returns:
        the initialized table.
      • initVis5D

        public void initVis5D()
        Initialize the colormap to the VisAD sine waves
      • initTableHSV

        public static float[][] initTableHSV(float[][] table)
        Initialize table to the Hue-Saturation-Value colormap.
        Parameters:
        table - Table to be initialized.
        Returns:
        the initialized table.
      • initHSV

        public void initHSV()
        Initialize the colormap to Hue-Saturation-Value
      • getNumberOfComponents

        public int getNumberOfComponents()
        Get the number of components of the range.
        Returns:
        Either 3 or 4
      • getNumberOfColors

        public int getNumberOfColors()
        Get the number of colors in the table.
        Returns:
        The number of colors in the colormap.
      • setFunction

        public void setFunction(Function func)
                         throws java.rmi.RemoteException,
                                VisADException
        Define the color lookup by a Function, whose MathType must have a 1-D domain and a 3-D or 4-D RealTupleType range; the domain and range Reals must vary over the range (0.0, 1.0)
        Parameters:
        func - The new Function.
        Throws:
        java.rmi.RemoteException - If there was an RMI-related problem.
        VisADException - If there was a problem with the function.
      • getFunction

        public Function getFunction()
        Return the color lookup Function.
        Returns:
        The function which defines this object's colors.
      • setTable

        public void setTable(float[][] t)
                      throws java.rmi.RemoteException,
                             VisADException
        Define the color lookup by an array of floats which must have the form float[components][table_length]; values should be in the range (0.0, 1.0)
        Parameters:
        t - The new table of colors.
        Throws:
        java.rmi.RemoteException - If there was a problem changing the control.
        VisADException - If there is a problem with the table.
      • getTable

        public float[][] getTable()
        Get the table of colors.
        Returns:
        The color table.
      • getSaveString

        public java.lang.String getSaveString()
        If the colors are defined using a color table, get a String that can be used to reconstruct this object later. If the colors are defined using a Function, return null.
        Specified by:
        getSaveString in class Control
        Returns:
        The save string describing this object.
      • setSaveString

        public void setSaveString(java.lang.String save)
                           throws java.rmi.RemoteException,
                                  VisADException
        Reconstruct this control using the specified save string.
        Specified by:
        setSaveString in class Control
        Parameters:
        save - The save string.
        Throws:
        VisADException - If the save string is not valid.
        java.rmi.RemoteException - If there was a problem setting the table.
      • lookupValues

        public float[][] lookupValues(float[] values)
                               throws java.rmi.RemoteException,
                                      VisADException
        Return a list of colors for specified values.
        Parameters:
        values - The values to look up. It is expected that they nominally lie in the range of 0 through 1. Values outside this range will be assigned the color of the nearest end. NaN values will be assigned NaN colors.
        Returns:
        The list of colors. Element [i][j] is the value of the i-th color component for values[j], where i is RED, GREEN, BLUE, or ALPHA. A component value is in the range from 0 through 1, or is NaN.
        Throws:
        java.rmi.RemoteException - If there was an RMI-related problem.
        VisADException - If the function encountered a problem.
      • lookupRange

        public float[][] lookupRange(int left,
                                     int right)
                              throws VisADException,
                                     java.rmi.RemoteException
        Return a list of colors for the specified range.
        Throws:
        VisADException
        java.rmi.RemoteException
      • setRange

        public void setRange(int left,
                             int right,
                             float[][] colors)
                      throws VisADException,
                             java.rmi.RemoteException
        Set the specified range to the specified colors.
        Throws:
        VisADException
        java.rmi.RemoteException
      • syncControl

        public void syncControl(Control rmt)
                         throws VisADException
        Copy the state of a remote control to this control.
        Specified by:
        syncControl in class Control
        Parameters:
        rmt - The control to be copied.
        Throws:
        VisADException - If the remote control cannot be copied.
      • equals

        public boolean equals(java.lang.Object o)
        Return true if this object is "equal" to the parameter.
        Overrides:
        equals in class Control
        Parameters:
        o - Object to compare.
        Returns:
        true if this object "equals" o.
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class Control
        Returns:
        a copy of this Control
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Control
        Returns:
        a simple String representation of this Control

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.