com.sdm.quasar.client.swing.dialogbase.features
Class ImageProviderFeature

java.lang.Object
  extended bycom.sdm.quasar.client.core.dialog.AbstractFeature
      extended bycom.sdm.quasar.client.swing.dialogbase.features.ImageProviderFeature
All Implemented Interfaces:
Feature, ImageProviderService, Service, SystemInfoProvider

public class ImageProviderFeature
extends AbstractFeature
implements ImageProviderService

An implementation of ImageProviderService, that uses configuration entries to load images.

Version:
1.0
Author:
Thomas Wolf

Constructor Summary
ImageProviderFeature()
          Creates a new ImageProviderFeature.
 
Method Summary
protected  void dispose()
          Called when the feature or dialog is disposed.
 java.awt.Image getImage(java.lang.String id)
          Returns the Image associated with the given id.
 javax.swing.ImageIcon getImageIcon(java.lang.String id)
          Returns the ImageIcon associated with the given id.
static byte[] getResourceBytes(java.io.InputStream in)
          Returns an array of bytes containing the given InputStream content.
protected  void init()
          Called when the feature is initializing.
 
Methods inherited from class com.sdm.quasar.client.core.dialog.AbstractFeature
activate, attachDialogControl, collectSystemInfo, deactivate, disposeFeature, getDialogControl, isInitialized, prepare, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageProviderFeature

public ImageProviderFeature()
Creates a new ImageProviderFeature.

Method Detail

init

protected void init()
Description copied from class: AbstractFeature
Called when the feature is initializing. This is normally done, when the feature is connected to the lifecycle of the DialogControl installed to. To access the DialogControl use the AbstractFeature.getDialogControl() method.

Override this method to perform some action on initialization e.g. register public services.

Specified by:
init in class AbstractFeature
See Also:
AbstractFeature.init()

dispose

protected void dispose()
                throws DisposeException
Description copied from class: AbstractFeature
Called when the feature or dialog is disposed. Override this method to clean up resources and free memory when disposing.

Specified by:
dispose in class AbstractFeature
Throws:
DisposeException
See Also:
AbstractFeature.dispose()

getImageIcon

public javax.swing.ImageIcon getImageIcon(java.lang.String id)
Description copied from interface: ImageProviderService
Returns the ImageIcon associated with the given id.

Specified by:
getImageIcon in interface ImageProviderService
Parameters:
id - the id of the image
Returns:
the ImageIcon or null, if no icon was found
See Also:
ImageProviderService.getImageIcon(java.lang.String)

getImage

public java.awt.Image getImage(java.lang.String id)
Description copied from interface: ImageProviderService
Returns the Image associated with the given id.

Specified by:
getImage in interface ImageProviderService
Parameters:
id - the id of the image
Returns:
the ImageIcon or null, if no icon was found
See Also:
ImageProviderService.getImage(java.lang.String)

getResourceBytes

public static byte[] getResourceBytes(java.io.InputStream in)
Returns an array of bytes containing the given InputStream content.

Parameters:
in - the InputStream to read from
Returns:
an array of bytes containing the InputStream content