public class ColourRule
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
CONTINUOUS
Rule represents part of a continuous colour table.
|
static int |
DISCRETE
Rule represents part of a discrete colour table.
|
Constructor and Description |
---|
ColourRule(float i,
int c)
Creates a categorical colour rule.
|
ColourRule(float i1,
int c1,
float i2,
int c2)
Creates a continuous colour rule.
|
ColourRule(float i,
int r,
int g,
int b)
Creates a categorical colour rule.
|
ColourRule(float i1,
int r1,
int g1,
int b1,
float i2,
int r2,
int g2,
int b2)
Creates a continuous colour rule.
|
ColourRule(float i,
int r,
int g,
int b,
int a)
Creates a categorical colour rule.
|
ColourRule(float i1,
int r1,
int g1,
int b1,
int a1,
float i2,
int r2,
int g2,
int b2,
int a2)
Creates a continuous colour rule.
|
Modifier and Type | Method and Description |
---|---|
int |
getColour(float index)
Interpolates the colour associated with the given index.
|
int |
getlColour()
Finds the colour associated with the lower index.
|
float |
getlIndex()
Finds the lower index associated with colour rule.
|
int |
getType()
Reports the type of colour rule.
|
int |
getuColour()
Finds the colour associated with the upper index.
|
float |
getuIndex()
Finds the upper index associated with colour rule.
|
void |
setlColour(int lColour)
Sets the colour associated with the lower index of the rule.
|
void |
setlIndex(float lIndex)
Sets the index associated with the lower colour.
|
void |
setType(int type)
Sets the rule type (either DISCRETE or CONTINUOUS).
|
void |
setuColour(int uColour)
Sets the colour associated with the upper index of the rule.
|
void |
setuIndex(float uIndex)
Sets the index associated with the upper colour.
|
java.lang.String |
toString()
Reports the current colour rule.
|
static java.lang.String |
toString(int intColour)
Converts a given colour value from integer to R,G,B,A string
for display and storage.
|
public static final int CONTINUOUS
public static final int DISCRETE
public ColourRule(float i, int r, int g, int b)
i
- Index value associated with rule.r
- Red component of colour associated with index.g
- Green component of colour associated with index.b
- Blue component of colour associated with index.public ColourRule(float i, int r, int g, int b, int a)
i
- Index value associated with rule.r
- Red component of colour associated with index.g
- Green component of colour associated with index.b
- Blue component of colour associated with index.a
- Alpha (transparency) component associated with index.public ColourRule(float i, int c)
i
- index value associated with rule.c
- Combined ARGB colour associated with index.public ColourRule(float i1, int r1, int g1, int b1, float i2, int r2, int g2, int b2)
i1
- Lower index value associated with rule.r1
- Red component of colour associated with lower index.g1
- Green component of colour associated with lower index.b1
- Blue component of colour associated with lower index.i2
- Upper index value associated with rule.r2
- Red component of colour associated with upper index.g2
- Green component of colour associated with upper index.b2
- Blue component of colour associated with upper index.public ColourRule(float i1, int r1, int g1, int b1, int a1, float i2, int r2, int g2, int b2, int a2)
i1
- Lower index value associated with rule.r1
- Red component of colour associated with lower index.g1
- Green component of colour associated with lower index.b1
- Blue component of colour associated with lower index.a1
- Alpha (transparency) component associated with lower index.i2
- Upper index value associated with rule.r2
- Red component of colour associated with upper index.g2
- Green component of colour associated with upper index.b2
- Blue component of colour associated with upper index.a2
- Alpha (transparency) component associated with upper index.public ColourRule(float i1, int c1, float i2, int c2)
i1
- Lower index value associated with rule.c1
- Combined RGBA colour associated with lower index.i2
- Upper index value associated with rule.c2
- Combined RGBA colour associated with upper index.public int getColour(float index)
index
- Index to associate colour with.public float getlIndex()
public void setlIndex(float lIndex)
lIndex
- New lower index for colour rule.public float getuIndex()
public void setuIndex(float uIndex)
uIndex
- New upper index for colour rule.public int getType()
public void setType(int type)
type
- Type of colour rule. Either DISCRETE or CONTINUOUS.public int getlColour()
public void setlColour(int lColour)
lColour
- New colour for lower index (combined ARGB).public void setuColour(int uColour)
uColour
- New colour for upper index (combined ARGB).public int getuColour()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String toString(int intColour)
intColour
- Colour represented as integer.