Package com.luciad.gui.swing
Class TLcdContrastIcon
java.lang.Object
com.luciad.gui.swing.TLcdContrastIcon
- All Implemented Interfaces:
ILcdIcon
,ILcdCloneable
,Serializable
,Cloneable
A contrasted/brightened version of an icon.
The contrast value modifies the contrast of the delegate icon. For example
- A contrast value of 0.0 maps all r, g and b values to 128 (grey).
- A contrast value of 0.5 maps the r, g and b ranges [0, 256) on [64, 192), so there is less contrast
- A contrast value of 1.0 doesn't modify the icon.
- A contrast value of 2.0 maps the r, g and b ranges [0, 64) on 0, [64, 192) on [0, 256) and [192, 256) on 255, So there is more contrast than in the original icon.
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
- A brightness value of 0.0 makes the icon black.
- A brightness value of 1.0 doesn't modify the icon.
- A brightness value of 2.0 makes the icon twice as bright.
Notice that this class is not guaranteed to work correctly with non-static icons.
- Since:
- 11.0
- See Also:
-
Constructor Summary
ConstructorDescriptionTLcdContrastIcon
(ILcdIcon aNormalIcon, double aContrast, double aBrightness) Create a new grey icon, based on the iconaNormalIcon
.TLcdContrastIcon
(Icon aNormalIcon, double aContrast, double aBrightness) Create a new grey icon, based on the iconaNormalIcon
. -
Method Summary
Modifier and TypeMethodDescriptionclone()
MakesObject.clone()
public.int
Returns the fixed height of the icon.int
Returns the fixed width of the icon.void
Draw theILcdIcon
at the specified location.
-
Constructor Details
-
TLcdContrastIcon
Create a new grey icon, based on the icon
aNormalIcon
. Notice that this class is not guaranteed to work correctly with non-static icons.- Parameters:
aNormalIcon
- the icon of which a grey version must be createdaContrast
- the applied contrastaBrightness
- the applied brightness.
-
TLcdContrastIcon
Create a new grey icon, based on the icon
aNormalIcon
. Notice that this class is not guaranteed to work correctly with non-static icons.- Parameters:
aNormalIcon
- the icon of which a grey version must be createdaContrast
- the applied contrastaBrightness
- the applied brightness.
-
-
Method Details
-
paintIcon
Description copied from interface:ILcdIcon
Draw theILcdIcon
at the specified location.ILcdIcon
implementations may use theComponent
argument to get properties useful for painting, e.g. the foreground or background color.- Specified by:
paintIcon
in interfaceILcdIcon
- Parameters:
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.
-
getIconWidth
public int getIconWidth()Description copied from interface:ILcdIcon
Returns the fixed width of the icon.- Specified by:
getIconWidth
in interfaceILcdIcon
- Returns:
- the fixed width of the icon.
-
getIconHeight
public int getIconHeight()Description copied from interface:ILcdIcon
Returns the fixed height of the icon.- Specified by:
getIconHeight
in interfaceILcdIcon
- Returns:
- the fixed height of the icon.
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.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 ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-