Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.javatools.controls
Class WashedIcon

java.lang.Object
  extended by oracle.javatools.controls.WashedIcon
All Implemented Interfaces:
javax.swing.Icon

public class WashedIcon
extends java.lang.Object
implements javax.swing.Icon

An implementation of the Icon interface that can render another icon in a faded, or washed-out, state. The level of fading can be controlled by specifying the alpha level to be used for rendering; if no level of fading is specified, a default level is used.


Field Summary
protected static float DEFAULT_ALPHA
          The default alpha level to use for rendering.
 
Constructor Summary
WashedIcon(javax.swing.Icon icon)
          Creates a washed-out icon from another icon, using a default level of fading.
WashedIcon(javax.swing.Icon icon, float alpha)
          Creates a washed-out icon from another icon, using the specified level of fading.
 
Method Summary
 float getAlpha()
          Gets the alpha level to use for rendering.
protected  java.awt.AlphaComposite getComposite()
          Gets the AlphaComposite to use for rendering.
 javax.swing.Icon getIcon()
          Gets the original source Icon to use for rendering.
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ALPHA

protected static final float DEFAULT_ALPHA
The default alpha level to use for rendering.

See Also:
Constant Field Values
Constructor Detail

WashedIcon

public WashedIcon(javax.swing.Icon icon)
Creates a washed-out icon from another icon, using a default level of fading.

Parameters:
icon - the icon image to display

WashedIcon

public WashedIcon(javax.swing.Icon icon,
                  float alpha)
Creates a washed-out icon from another icon, using the specified level of fading.

Parameters:
icon - the icon image to display
alpha - the alpha value to use for rendering, in the range of [0.0, 1.0]. An alpha of 1.0 is completely opaque, and an alpha of 0.0 is completely transparent.
Method Detail

getIcon

public javax.swing.Icon getIcon()
Gets the original source Icon to use for rendering.

Returns:
the source icon from which this icon is derived

getAlpha

public float getAlpha()
Gets the alpha level to use for rendering.

Returns:
the alpha level used for rendering. The alpha value is in the range of [0.0, 1.0].

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

getComposite

protected java.awt.AlphaComposite getComposite()
Gets the AlphaComposite to use for rendering.

Returns:
the composite object used for rendering in the graphics context

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.