|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Color
javax.tv.graphics.AlphaColor
org.dvb.ui.DVBColor
A Color class which adds the notion of alpha. Because DVBColor extends Color the signatures in the existing classes do not change. Classes like Component should work with DVBColor internally. Instances of this class are a container for the values which are passed in to the constructor. Any approximations made by the platform are made when the colors are used. Note: org.dvb.ui.DVBColor adds support for alpha (compared to JDK1.1.8) and is intended to be compatible with the JDK1.2 java.awt.Color class - since org.dvb.ui.DVBColor extends javax.tv.graphics.AlphaColor which in turn extends java.awt.Color. In implementations where java.awt.Color supports alpha, such as JDK1.2, etc., the alpha-related methods in org.dvb.ui.DVBColor could just call super.
Field Summary |
Fields inherited from class java.awt.Color |
black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, white, yellow |
Constructor Summary | |
DVBColor(java.awt.Color c)
Constructs a new DVBColor using the specified color. |
|
DVBColor(float r,
float g,
float b,
float a)
Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0,0 to 1,0). |
|
DVBColor(int rgba,
boolean hasalpha)
Creates an sRGB color with the specified combined RGBA value consisting of the alpha component in bits 24 to 31, the red component in bits 16 to 23, the green component in bits 8 to 15, and the blue component in bits 0 to 7. |
|
DVBColor(int r,
int g,
int b,
int a)
Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0 to 255). |
Method Summary | |
java.awt.Color |
brighter()
Creates a brighter version of this color. |
java.awt.Color |
darker()
Creates a darker version of this color. |
boolean |
equals(java.lang.Object obj)
Determines whether another object is equal to this color. |
int |
getAlpha()
Returns the alpha component. |
int |
getRGB()
Returns the RGB value representing the color in the default sRGB ColorModel. |
java.lang.String |
toString()
Creates a string that represents this color and indicates the values of its ARGB components. |
Methods inherited from class javax.tv.graphics.AlphaColor |
hashCode |
Methods inherited from class java.awt.Color |
decode, getBlue, getColor, getColor, getColor, getGreen, getHSBColor, getRed, HSBtoRGB, RGBtoHSB |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DVBColor(float r, float g, float b, float a)
r
- the red componentg
- the green componentb
- the blue componenta
- the alpha componentColor.getRed()
,
Color.getGreen()
,
Color.getBlue()
,
getAlpha()
,
getRGB()
public DVBColor(int r, int g, int b, int a)
r
- the red componentg
- the green componentb
- the blue componenta
- the alpha componentColor.getRed()
,
Color.getGreen()
,
Color.getBlue()
,
getAlpha()
,
getRGB()
public DVBColor(int rgba, boolean hasalpha)
rgba
- the combined RGBA componentshasalpha
- true if the alpha bits are valid, false otherwiseColor.getRed()
,
Color.getGreen()
,
Color.getBlue()
,
getAlpha()
,
getRGB()
public DVBColor(java.awt.Color c)
c
- the java.awt.Color used to create a new DVBColorMethod Detail |
public java.awt.Color brighter()
Color.brighter()
public java.awt.Color darker()
Color.darker()
public boolean equals(java.lang.Object obj)
obj
- - the object to compare with.
public int getAlpha()
getRGB()
public int getRGB()
Color.getRed()
,
Color.getGreen()
,
Color.getBlue()
,
getAlpha()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |