UIX 2.2.16

oracle.cabo.ui.laf.icon
Class Icon

java.lang.Object
  |
  +--oracle.cabo.ui.laf.icon.Icon
Direct Known Subclasses:
BaseImageIcon, TextIcon

public abstract class Icon
extends java.lang.Object

An object which represents a customizable icon that is capable of rendering itself. Icons objects are registered with a LookAndFeel via the LookAndFeel.registerIcon() method and are retrieved by Renderers via LookAndFeel.getIcon(). Customizers can override icons declaratively in section of the look and feel configuration file.

Icon implementations which are capable of providing an image representation of the icon should override getImageURI(), getImageWidth() and getImageHeight(). The default implementations of these methods return null, which is an acceptable default for Icons which do not make use of images (ie. for text-based Icon implementations).


Constructor Summary
Icon()
           
 
Method Summary
 InputStreamProvider getImageData(RenderingContext context)
          Returns an InputStreamProvider which provides access to the image data for image-based Icons.
 java.lang.Integer getImageHeight(RenderingContext context)
          Returns the height of the image.
 java.lang.Object getImageURI(RenderingContext context)
          Returns a URI to the image that is used as the icon's content.
 java.lang.Integer getImageWidth(RenderingContext context)
          Returns the width of the image.
abstract  void renderIcon(RenderingContext context, AttributeMap attrs)
          Renders the Icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Icon

public Icon()
Method Detail

renderIcon

public abstract void renderIcon(RenderingContext context,
                                AttributeMap attrs)
                         throws java.io.IOException
Renders the Icon.
Parameters:
context - The RenderingContext for the current request.
attrs - An AttributeMap which which provides access to attribute values that might be useful to Icon implementations, such as ID_ATTR and SHORT_DESC_ATTR. Note that Icons are not allowed to modify values in the AttributeMap. Calling AttributeMap.setAttribute() will result in an UnsupportedOperationException.

getImageURI

public java.lang.Object getImageURI(RenderingContext context)
Returns a URI to the image that is used as the icon's content. The default implementation of this method simply returns null, which indicates to the caller that no image representation of the Icon is available.
Parameters:
RenderingContext - context The RenderingContext for the current request.

getImageWidth

public java.lang.Integer getImageWidth(RenderingContext context)
Returns the width of the image. The default implementation of this method simply returns null, which indicates to the caller the width of the image is not known - or that the Icon does not provide an image representation.
Parameters:
RenderingContext - context The RenderingContext for the current request.

getImageHeight

public java.lang.Integer getImageHeight(RenderingContext context)
Returns the height of the image. The default implementation of this method simply returns null, which indicates to the caller the height of the image is not known - or that the Icon does not provide an image representation.
Parameters:
RenderingContext - context The RenderingContext for the current request.

getImageData

public InputStreamProvider getImageData(RenderingContext context)
                                 throws java.io.IOException
Returns an InputStreamProvider which provides access to the image data for image-based Icons.

UIX 2.2.16