|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jdsl.extension.LEDA.Color
This class represents a color. A color can be definied by an index or a rgb tripel. There are several access methods. Switches between both representation are internal.
| Field Summary | |
static int |
BLACK
A valid color: black. |
static int |
BLUE
A valid color: blue. |
static int |
BLUE2
A valid color: dark blue. |
static int |
BROWN
A valid color: brown. |
static int |
CYAN
A valid color: cyan. |
static int |
DEFAULTCOLOR
A valid color: standard color. |
static int |
GREEN
A valid color: green. |
static int |
GREEN2
A valid color: dark green. |
static int |
GREY1
A valid color: light grey. |
static int |
GREY2
A valid color: grey. |
static int |
GREY3
A valid color: dark grey. |
static int |
INVISIBLE
A valid color: invisible. |
static int |
ORANGE
A valid color: orange. |
static int |
PINK
A valid color: pink. |
static int |
RED
A valid color: red. |
static int |
VIOLET
A valid color: violet |
static int |
WHITE
A valid color: white. |
static int |
YELLOW
A valid color: yellow. |
| Constructor Summary | |
Color(Color c)
Copy-Constructor. |
|
Color(int index)
Contructs a new color by an index value. |
|
Color(int r,
int g,
int b)
Constructs a new color by an rgb tripel. |
|
| Method Summary | |
int |
bestPossibleIndex()
Returns current color as index. |
java.lang.Object |
clone()
Cloneable implenentation. |
static java.lang.String |
codeIndexToRGB(int index)
Returns color definied by index as a rgb tripel
(as a string). |
static java.lang.String |
codeRGBToIndex(int r,
int g,
int b)
Returns color definied by r, g, b as an index
(as a string). |
int |
getB()
Returns the blue part of current color. |
int |
getG()
Returns the green part of current color. |
int |
getIndex()
Returns current color index. |
int |
getR()
Returns the red part of current color. |
void |
setB(int b)
Sets a new blue part. |
void |
setG(int g)
Sets a new green part. |
void |
setIndex(int colorIndex)
Sets a new color index; |
void |
setR(int r)
Sets a new red part. |
java.lang.String |
toString()
Returns current used representation (as an index or as a rgb tripel). |
java.lang.String |
toString(boolean useIndex)
Returns a representation (as an index or as a rgb tripel). |
java.lang.String |
toStringBoth()
Returns both representations (as an index and as a rgb tripel). |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int INVISIBLE
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int WHITE
INVISIBLE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int BLACK
INVISIBLE,
WHITE,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int RED
INVISIBLE,
WHITE,
BLACK,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int GREEN
INVISIBLE,
WHITE,
BLACK,
RED,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int BLUE
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int YELLOW
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int VIOLET
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int ORANGE
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int CYAN
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int BROWN
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int PINK
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int GREEN2
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
BLUE2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int BLUE2
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
GREY1,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int GREY1
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY2,
GREY3,
DEFAULTCOLORpublic static final int GREY2
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY3,
DEFAULTCOLORpublic static final int GREY3
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
DEFAULTCOLORpublic static final int DEFAULTCOLOR
INVISIBLE,
WHITE,
BLACK,
RED,
GREEN,
BLUE,
YELLOW,
VIOLET,
ORANGE,
CYAN,
BROWN,
PINK,
GREEN2,
BLUE2,
GREY1,
GREY2,
GREY3| Constructor Detail |
public Color(int index)
public Color(int r,
int g,
int b)
r - red partg - green partb - blue partpublic Color(Color c)
| Method Detail |
public java.lang.Object clone()
public int getIndex()
public void setIndex(int colorIndex)
colorIndex - value to assign to index.public int getR()
public int getG()
public int getB()
public void setR(int r)
r - new red partpublic void setG(int g)
g - new green partpublic void setB(int b)
b - new blue partpublic java.lang.String toStringBoth()
public java.lang.String toString()
public java.lang.String toString(boolean useIndex)
useIndex - if true a index representation is used, else
a rgb representation.public int bestPossibleIndex()
public static java.lang.String codeIndexToRGB(int index)
index as a rgb tripel
(as a string).
public static java.lang.String codeRGBToIndex(int r,
int g,
int b)
r, g, b as an index
(as a string).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||