|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.monitorenter.gui.util.ColorMutable
public class ColorMutable
Mutable
implementation.
Color
The color is wrapped by the logic to fake mutability. As long as the color is not set setting of values will not have an effect but only be stored until color is set and then applied to it.
Constructor Summary | |
---|---|
ColorMutable()
|
Method Summary | |
---|---|
java.awt.Color |
applyColorIfChange(java.awt.Graphics g)
Sets the color to the graphics context if it is different and returns the previous one of the graphics context or null if there was no change. |
java.awt.Color |
applyColorUnconditionally(java.awt.Graphics g)
Sets the color to the graphics context. |
boolean |
equals(java.lang.Object obj)
|
int |
getAlpha()
Returns the alpha value of the wrapped color. |
int |
getBlue()
Returns the blue value of the wrapped color. |
java.awt.Color |
getColor()
Returns the wrapped color. |
int |
getGreen()
Returns the green value of the wrapped color. |
int |
getRed()
Returns the red value of the wrapped color. |
int |
hashCode()
|
int |
setAlpha(int alpha)
Sets the transparency to use for painting. |
int |
setBlue(int blue)
Sets the blue to use for painting. |
java.awt.Color |
setColor(java.awt.Color color)
Sets the color to use. |
int |
setGreen(int green)
Sets the green to use for painting. |
int |
setRed(int red)
Sets the red to use for painting. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorMutable()
Method Detail |
---|
public java.awt.Color applyColorIfChange(java.awt.Graphics g)
g
- the graphics context to use.
public java.awt.Color applyColorUnconditionally(java.awt.Graphics g)
g
- the graphics context to use.
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int getAlpha()
public int getBlue()
public java.awt.Color getColor()
This will be null
if no color has been set before even if
other values have been set before.
public int getGreen()
public int getRed()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public int setAlpha(int alpha)
This value will be fold into color. If color has not been configured before it will not have any effect (until a color is set).
Caution: using a value greater 0 may cost a multiple cpu load!
alpha
- a transparency value between 0 and 255.
public int setBlue(int blue)
This value will be fold into color. If color has not been configured before it will not have any effect (until a color is set).
blue
- a blue value between 0 and 255.
public java.awt.Color setColor(java.awt.Color color)
If any other setters have been invoked before (e.g.
) and the internal color was null those
values will be implanted to the new color before overtaking it.
setAlpha(int)
color
- the new color to use as base for modifications.
public int setGreen(int green)
This value will be fold into color. If color has not been configured before it will not have any effect (until a color is set).
green
- a green value between 0 and 255.
public int setRed(int red)
This value will be fold into color. If color has not been configured before it will not have any effect (until a color is set).
red
- a red value between 0 and 255.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |