edu.wisc.ssec.mcidasv.ui
Class McIdasColorTableDefaults

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.ui.McIdasColorTableDefaults

public class McIdasColorTableDefaults
extends Object

A class to provide color tables suitable for data displays. Uses some code by Ugo Taddei. All methods are static.

Version:
$Id$

Field Summary
static String NAME_AOD
          The name of the "aod" color table
static String NAME_COT
          The name of the "cot" color table
 
Constructor Summary
McIdasColorTableDefaults()
           
 
Method Summary
static ColorTable createColorTable(ArrayList l, String name, String category, float[][] table)
          _more_
static ColorTable createColorTable(ArrayList l, String name, String category, float[][] table, boolean tableFlipped)
          Create a ColorTable and add it to the given list
static ColorTable createColorTable(String name, String category, float[][] table)
          Create a ColorTable and add it to the given list
private static ColorTable makeColorTable(String name, String cat, ArrayList colors)
          _more_
static float[][] makeTableFromASCII(String name)
          Read in and process a hydra color table
private static float[][] processFloats(List reds, List greens, List blues)
          Convert strings of floats to scaled colors
private static float[][] processInts(List reds, List greens, List blues)
          Convert strings of integers to scaled colors
private static float[][] toArray(List colors)
          Utility to convert list of colors to float array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_AOD

public static final String NAME_AOD
The name of the "aod" color table

See Also:
Constant Field Values

NAME_COT

public static final String NAME_COT
The name of the "cot" color table

See Also:
Constant Field Values
Constructor Detail

McIdasColorTableDefaults

public McIdasColorTableDefaults()
Method Detail

createColorTable

public static ColorTable createColorTable(String name,
                                          String category,
                                          float[][] table)
Create a ColorTable and add it to the given list

Parameters:
name - The CT name
category - Its category
table - The actual data
Returns:
The color table

createColorTable

public static ColorTable createColorTable(ArrayList l,
                                          String name,
                                          String category,
                                          float[][] table)
_more_

Parameters:
l - _more_
name - _more_
category - _more_
table - _more_
Returns:
_more_

createColorTable

public static ColorTable createColorTable(ArrayList l,
                                          String name,
                                          String category,
                                          float[][] table,
                                          boolean tableFlipped)
Create a ColorTable and add it to the given list

Parameters:
l - List to add the ColorTable to
name - The CT name
category - Its category
table - The actual data
tableFlipped - If true then the table data is not in row major order
Returns:
The color table

makeTableFromASCII

public static final float[][] makeTableFromASCII(String name)
                                          throws IllegalArgumentException
Read in and process a hydra color table

Parameters:
name - File name
Returns:
The processed CT data
Throws:
IllegalArgumentException

processInts

private static float[][] processInts(List reds,
                                     List greens,
                                     List blues)
Convert strings of integers to scaled colors

Parameters:
reds - list of red strings
green - list of green strings
blue - list of blue strings
Returns:
color table of scaled floats

processFloats

private static float[][] processFloats(List reds,
                                       List greens,
                                       List blues)
Convert strings of floats to scaled colors

Parameters:
reds - list of red strings
green - list of green strings
blue - list of blue strings
Returns:
color table of scaled floats

toArray

private static float[][] toArray(List colors)
Utility to convert list of colors to float array

Parameters:
colors - colors
Returns:
color array

makeColorTable

private static ColorTable makeColorTable(String name,
                                         String cat,
                                         ArrayList colors)
_more_

Parameters:
name - _more_
cat - _more_
colors - _more_
Returns:
_more_