|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjwo.landserf.structure.ColourTable
Colour table class for storing colour rules associated with a spatial object.Each colour rule consists of two indices and associated RGBA colour values. Colours are interpolated for any values that fall between the lower and upper indices.
Field Summary | |
static int |
ASPECT
Indicates a (red-blue) aspect colour table. |
static int |
BIPOLAR_BLURED
Bi-polar blue to red colour table. |
static int |
BIPOLAR_GRNYEL
Bi-polar blue to red colour table. |
static int |
COLOUR_ATTRIB
Uses integer coding of the object's (floating point) attribute. |
static int |
COLOUR_RAW
Colour table uses raster values. |
static int |
COLOUR_RULES
Colour table uses colour rules. |
static int |
DEFAULT
Indicates a default (green-purple-white) colour table. |
static int |
FEATURES
Indicates a feature class (black, blue, green, yellow, red ) colour table. |
static int |
GREYSCALE
Greyscale (black to white) colour table. |
static int |
IMHOF_L1
Imhof land surface colour scheme (green to beige). |
static int |
IMHOF_L2
Imhof land surface colour scheme (green to brown). |
static int |
IMHOF_L3
Imhof land surface colour scheme (green to orange). |
static int |
IMHOF_L4
Imhof land surface colour scheme (green to white). |
static int |
IMHOF_S1
Imhof sea colour scheme (blue to white). |
static int |
IMHOF_S2
Imhof sea colour scheme (dark blue to white). |
static int |
IMHOF_SL
Imhof sea and land colour scheme (dark blue to brown). |
static int |
INV_GREYSCALE
Inverted greyscale (white to black) colour table. |
static int |
MSN_FEATURES
Indicates a feature class (black, blue, green, yellow, red ) colour table. |
static int |
RANDOM
Random colour scheme for nominal data. |
static int |
SLOPE
Indicates a slope (white - yellow - black) colour table. |
Constructor Summary | |
ColourTable()
Creates an initial (black) colour table. |
|
ColourTable(ColourTable oldColourTable)
Creates a colour table based on a copy of a colour table. |
Method Summary | |
void |
addContinuousColourRule(float index,
int colour)
Adds a continuous colour rule to the colour table. |
void |
addContinuousColourRule(float index,
int r,
int g,
int b)
Adds a continuous colour rule to the colour table. |
void |
addContinuousColourRule(float index,
int r,
int g,
int b,
int a)
Adds a continuous colour rule to the colour table. |
void |
addDiscreteColourRule(float index,
int colour)
Adds a discrete colour rule to the colour table. |
void |
addDiscreteColourRule(float index,
int r,
int g,
int b)
Adds a discrete colour rule to the colour table. |
void |
addDiscreteColourRule(float index,
int r,
int g,
int b,
int a)
Adds a discrete colour rule to the colour table. |
static int |
argbToRgba(int argb)
Converts an ARGB into an RGBA colour. |
int |
findColour(float index)
Interpolates a given index colour from colour rules. |
static int |
getAlpha(int colour)
Reports the alpha value of the given colour. |
Vector |
getColourRules()
|
int |
getColourTableType()
Reports type of colour table (COLOUR_RULES, COLOUR_ATTRIB or COLOUR_RAW). |
static String |
getHexString(int colour)
Converts a given colour into its HTML-like hex string. |
float |
getMaxIndex()
Finds the highest index value in a set of colour rules. |
float |
getMinIndex()
Finds the lowest index value in a set of colour rules. |
static ColourTable |
getPresetColourTable(int type)
Creates a preset colour table scaled between default min and max values. |
static ColourTable |
getPresetColourTable(int type,
float min,
float max)
Creates a preset colour table between the given values. |
boolean |
modifyColourRule(float existingIndex,
float newIndex,
int newColour,
int newType)
Modifies the rule with the existing index to use the given index and colour. |
boolean |
removeColourRule(float index)
Removes the rule with the given lower index. |
static int |
rgbaToArgb(int rgba)
Converts an RGBA into an ARGB colour. |
void |
setColourTableType(int cTableType)
Sets the type of colour table (COLOUR_RULES, COLOUR_ATTRIB or COLOUR_RAW). |
ListModel |
toListModel()
Converts the colour rules into a ListModel suitable for display by GUI JLists or JTables. |
String |
toString()
Reports the current colour table rules. |
String[] |
toStringArray()
Reports the current colour table rules. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int COLOUR_RULES
public static final int COLOUR_RAW
public static final int COLOUR_ATTRIB
public static final int DEFAULT
public static final int FEATURES
public static final int MSN_FEATURES
public static final int SLOPE
public static final int ASPECT
public static final int BIPOLAR_BLURED
public static final int BIPOLAR_GRNYEL
public static final int GREYSCALE
public static final int INV_GREYSCALE
public static final int IMHOF_L1
public static final int IMHOF_L2
public static final int IMHOF_L3
public static final int IMHOF_L4
public static final int IMHOF_S1
public static final int IMHOF_S2
public static final int IMHOF_SL
public static final int RANDOM
Constructor Detail |
public ColourTable()
public ColourTable(ColourTable oldColourTable)
oldColourTable
- Old colour table to copy.Method Detail |
public void addDiscreteColourRule(float index, int r, int g, int b)
index
- Index value associated with rule.r
- Red colour component associated with index.g
- Green colour component associated with index.b
- Blue colour component associated with index.public void addDiscreteColourRule(float index, int r, int g, int b, int a)
index
- Index value associated with rule.r
- Red colour component associated with index.g
- Green colour component associated with index.b
- Blue colour component associated with index.a
- Alpha component (transparency) associated with index.public void addDiscreteColourRule(float index, int colour)
index
- Index value associated with rule.colour
- Colour value associated with index.public void addContinuousColourRule(float index, int r, int g, int b)
index
- Index value associated with rule.r
- Red colour component associated with index.g
- Green colour component associated with index.b
- Blue colour component associated with index.public void addContinuousColourRule(float index, int r, int g, int b, int a)
index
- Index value associated with rule.r
- Red colour component associated with index.g
- Green colour component associated with index.b
- Blue colour component associated with index.a
- Alpha component (transparency) associated with index.public void addContinuousColourRule(float index, int colour)
index
- Index value associated with rule.colour
- Colour value associated with index.public boolean removeColourRule(float index)
public boolean modifyColourRule(float existingIndex, float newIndex, int newColour, int newType)
existingIndex
- Index value associated with rule.newIndex
- New index value associated with rule.newColour
- Colour value associated with index.newType
- New type of rule (either DISCRETE or CONTINUOUS).
public int findColour(float index)
index
- Index to associated interpolated colour with.
public float getMinIndex()
public float getMaxIndex()
public String toString()
public String[] toStringArray()
public ListModel toListModel()
public int getColourTableType()
public void setColourTableType(int cTableType)
cTableType
- Type of colour table.public Vector getColourRules()
public static int rgbaToArgb(int rgba)
rgba
- RGBA format colour.
public static int argbToRgba(int argb)
argb
- ARGB format colour.
public static String getHexString(int colour)
colour
- Colour to convert.
public static int getAlpha(int colour)
colour
- Colour to query.
public static ColourTable getPresetColourTable(int type)
type
- Type of colourtable to create (DEFAULT, GREYSCALE, SLOPE etc.).
public static ColourTable getPresetColourTable(int type, float min, float max)
type
- Type of colourtable to create (DEFAULT, GREYSCALE, SLOPE etc.).min
- Minimum value.max
- Maximum value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |