public class ColorTable extends java.lang.Object implements NamedObject
Modifier and Type | Class and Description |
---|---|
static class |
ColorTable.Breakpoint
A class to hold color table breakpoint information
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CATEGORY_ATD_RADAR
the Atd-Radar category
|
static java.lang.String |
CATEGORY_BASIC
The "Basic" category
|
static java.lang.String |
CATEGORY_MISC
The Miscellaneous category
|
static java.lang.String |
CATEGORY_RADAR
The Radar category
|
static java.lang.String |
CATEGORY_SATELLITE
The Satellite category
|
static java.lang.String |
CATEGORY_SOLID
The solid category
|
static int |
IDX_ALPHA
Alpha index
|
static int |
IDX_BLUE
Blue index
|
static int |
IDX_GREEN
Green index
|
static int |
IDX_RED
Red index
|
Constructor and Description |
---|
ColorTable()
Default constructor
|
ColorTable(ColorTable otherTable)
Copy constructor
|
ColorTable(java.lang.String name,
java.lang.String category,
float[][] table)
Create a new ColorTable.
|
ColorTable(java.lang.String id,
java.lang.String name,
java.lang.String category,
float[][] table)
Create a new ColorTable.
|
ColorTable(java.lang.String id,
java.lang.String name,
java.lang.String category,
float[][] table,
boolean tableFlipped)
Create a new ColorTable.
|
Modifier and Type | Method and Description |
---|---|
static float[][] |
addAlpha(ColorTable colorTable)
Wrapper around
addAlpha(float[][]) . |
static float[][] |
addAlpha(float[][] colorTable)
Make a color-alpha table for VisAD displays mapped to Display.RGBA;
the 4th entry at each level being alpha (1.0) for transparency.
|
static float[][] |
changeTransparency(float[][] colorTable,
float alpha)
Revise a color-alpha table for VisAD displays mapped to Display.RGBA;
the 4th entry at each level (alpha) is reset to input arg alpha
|
java.lang.String |
dataToString()
Output the table as a String.
|
boolean |
equalsTable(ColorTable other)
See if another color table is equivalent to this one
|
boolean |
getActive()
Get the active flag.
|
float[][] |
getAlphaTable()
Get the table with alpha.
|
java.util.ArrayList |
getBreakpoints()
Get the breakpoints for this table.
|
java.lang.String |
getCategory()
Get the table category.
|
java.util.ArrayList<java.awt.Color> |
getColorList()
Convert the colorTable into a list of Color-s
|
java.util.ArrayList<java.awt.Color> |
getColorList(boolean includeAlpha)
Convert the colorTable into a list of Color-s
|
float[][] |
getColorTable()
Get the color table pallette.
|
java.lang.String |
getDescription()
Get the table description
|
java.lang.String |
getId()
Get the ID of this table
|
java.lang.String |
getName()
Get the name of this table.
|
float[][] |
getNonAlphaTable()
Get the table without alpha values.
|
Range |
getRange()
Get the Range for this color table.
|
float[] |
getScaleFactor()
Get the ScaleFactor property.
|
float[][] |
getTable()
Get the color table palette
Note: this is around for legacy purposes and we will move to
a new setTableArray/getTableArray method
|
ColorTable |
init(java.lang.String name,
java.lang.String category,
java.util.ArrayList colors,
java.util.ArrayList scales,
java.util.ArrayList breakpoints,
Range r)
Initialize a color table a new ColorTable.
|
ColorTable |
init(java.lang.String name,
java.lang.String category,
java.util.ArrayList colors,
java.util.ArrayList breakpoints,
Range r)
Initialize a color table a new ColorTable.
|
java.lang.String |
print()
Print the table info
|
static float[][] |
removeAlpha(float[][] colorTable)
Remove the alpha values
|
void |
setActive(boolean a)
Set the active flag.
|
void |
setBreakpoints(java.util.ArrayList l)
Set the breakpoints for this color table.
|
void |
setCategory(java.lang.String category)
Set the table category.
|
void |
setDescription(java.lang.String description)
Set the table description
|
void |
setId(java.lang.String id)
Set the id of this table
|
void |
setName(java.lang.String name)
Set the name of this table
|
void |
setRange(Range r)
Set the range for this table.
|
void |
setScaleFactor(float[] value)
Set the ScaleFactor property.
|
void |
setTable(java.util.ArrayList colors)
Set the table with a list of colors
|
void |
setTable(float[][] table)
Set the color table palette
Note: this is around for legacy purposes and we will move to
a new setTableArray/getTableArray method
|
void |
setTableArray(float[][] table)
Set the table array
|
void |
setTransparency(float alpha)
Set the transparency
|
java.lang.String |
toString()
Get a descriptive String for this object.
|
public static final int IDX_RED
public static final int IDX_GREEN
public static final int IDX_BLUE
public static final int IDX_ALPHA
public static final java.lang.String CATEGORY_BASIC
public static final java.lang.String CATEGORY_MISC
public static final java.lang.String CATEGORY_SATELLITE
public static final java.lang.String CATEGORY_RADAR
public static final java.lang.String CATEGORY_SOLID
public static final java.lang.String CATEGORY_ATD_RADAR
public ColorTable(ColorTable otherTable)
otherTable
- other table to copypublic ColorTable()
public ColorTable(java.lang.String name, java.lang.String category, float[][] table)
name
- name of the tablecategory
- category of the tabletable
- table valuespublic ColorTable(java.lang.String id, java.lang.String name, java.lang.String category, float[][] table)
id
- id of the tablename
- name of the tablecategory
- category of the tabletable
- table valuespublic ColorTable(java.lang.String id, java.lang.String name, java.lang.String category, float[][] table, boolean tableFlipped)
id
- id of the tablename
- name of the tablecategory
- category of the tabletable
- table valuestableFlipped
- flipped flagpublic ColorTable init(java.lang.String name, java.lang.String category, java.util.ArrayList colors, java.util.ArrayList breakpoints, Range r)
name
- name of the tablecategory
- category of the tablecolors
- table colorsbreakpoints
- breakpointsr
- Range of valuespublic ColorTable init(java.lang.String name, java.lang.String category, java.util.ArrayList colors, java.util.ArrayList scales, java.util.ArrayList breakpoints, Range r)
name
- name of the tablecategory
- category of the tablecolors
- table colorsscales
- scale factorsbreakpoints
- breakpointsr
- Range of valuespublic boolean equalsTable(ColorTable other)
other
- other table to checkpublic void setRange(Range r)
r
- rangepublic Range getRange()
public void setActive(boolean a)
a
- true for activepublic boolean getActive()
public void setBreakpoints(java.util.ArrayList l)
l
- list of breakpointspublic java.util.ArrayList getBreakpoints()
public float[][] getNonAlphaTable()
public float[][] getAlphaTable()
public float[][] getColorTable()
public void setTable(float[][] table)
table
- table of valuespublic float[][] getTable()
public void setTableArray(float[][] table)
table
- the table as a float arraypublic java.lang.String getName()
getName
in interface NamedObject
public void setName(java.lang.String name)
setName
in interface NamedObject
name
- the new namepublic java.lang.String getId()
public void setId(java.lang.String id)
id
- the table idpublic java.lang.String getDescription()
getDescription
in interface NamedObject
public void setDescription(java.lang.String description)
description
- the table descriptionpublic java.lang.String getCategory()
public void setCategory(java.lang.String category)
category
- the new categorypublic java.lang.String dataToString()
public java.lang.String print()
public java.lang.String toString()
toString
in class java.lang.Object
public void setTable(java.util.ArrayList colors)
colors
- list of colorspublic java.util.ArrayList<java.awt.Color> getColorList()
public java.util.ArrayList<java.awt.Color> getColorList(boolean includeAlpha)
includeAlpha
- true to use alphapublic static final float[][] addAlpha(ColorTable colorTable)
addAlpha(float[][])
.colorTable
- color table to usepublic static final float[][] removeAlpha(float[][] colorTable)
colorTable
- color table valuespublic static final float[][] addAlpha(float[][] colorTable)
colorTable
- a float [3][len], any usual VisAd color tablepublic void setTransparency(float alpha)
alpha
- the alpha valuepublic static final float[][] changeTransparency(float[][] colorTable, float alpha)
colorTable
- a float [4][len], a VisAd color-alpha tablealpha
- the new alpha valuepublic void setScaleFactor(float[] value)
value
- The new value for ScaleFactorpublic float[] getScaleFactor()