public class TLcdContrastIcon extends Object implements ILcdIcon, Cloneable
A contrasted/brightened version of an icon.
The contrast value modifies the contrast of the delegate icon. For example
The brightness value is applied on the icon after applying the contrast value. It multiplies the r, g and b values with the brightness value. For example
Notice that this class is not guaranteed to work correctly with non-static icons.
TLcdGreyIcon
,
Serialized FormConstructor and Description |
---|
TLcdContrastIcon(Icon aNormalIcon,
double aContrast,
double aBrightness)
Create a new grey icon, based on the icon
aNormalIcon . |
TLcdContrastIcon(ILcdIcon aNormalIcon,
double aContrast,
double aBrightness)
Create a new grey icon, based on the icon
aNormalIcon . |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Makes
Object.clone() public. |
int |
getIconHeight()
Returns the fixed height of the icon.
|
int |
getIconWidth()
Returns the fixed width of the icon.
|
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
Draw the
ILcdIcon at the specified location. |
public TLcdContrastIcon(ILcdIcon aNormalIcon, double aContrast, double aBrightness)
Create a new grey icon, based on the icon aNormalIcon
. Notice that this class
is not guaranteed to work correctly with non-static icons.
aNormalIcon
- the icon of which a grey version must be createdaContrast
- the applied contrastaBrightness
- the applied brightness.public TLcdContrastIcon(Icon aNormalIcon, double aContrast, double aBrightness)
Create a new grey icon, based on the icon aNormalIcon
. Notice that this class
is not guaranteed to work correctly with non-static icons.
aNormalIcon
- the icon of which a grey version must be createdaContrast
- the applied contrastaBrightness
- the applied brightness.public void paintIcon(Component c, Graphics g, int x, int y)
ILcdIcon
ILcdIcon
at the specified location. ILcdIcon
implementations
may use the Component
argument to get properties useful for
painting, e.g. the foreground or background color.paintIcon
in interface ILcdIcon
c
- a Component to retrieve properties from.g
- the Graphics on which the icon will be painted.x
- the x position where the icon will be painted. x is the first coordinate of the top left
corner point of the icon.y
- the y position where the icon will be painted. y is the second coordinate of the top left
corner point of the icon.public int getIconWidth()
ILcdIcon
getIconWidth
in interface ILcdIcon
public int getIconHeight()
ILcdIcon
getIconHeight
in interface ILcdIcon
public Object clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()