org.jtheque.core.managers.resource
Class ResourceManager

java.lang.Object
  extended by org.jtheque.core.managers.resource.ResourceManager
All Implemented Interfaces:
IManager, IResourceManager

public final class ResourceManager
extends java.lang.Object
implements IResourceManager, IManager

A resource manager implementation. WARNING : BeansManager must be inited before this manager for his good working.

Author:
Baptiste Wicht

Constructor Summary
ResourceManager()
           
 
Method Summary
 void close()
          Close the manager.
 JThequeAction getAction(java.lang.String name)
          Return the action of the specified name.
 java.awt.Color getColor(java.lang.String name)
          Return the color of the specified name.
 javax.swing.ImageIcon getIcon(java.lang.String path)
          Load and return the icon.
 javax.swing.ImageIcon getIcon(java.lang.String id, ImageType type)
          Load and return the icon.
 javax.swing.ImageIcon getIcon(java.lang.String basename, java.lang.String id, ImageType type)
          Load and return the icon.
 java.awt.image.BufferedImage getImage(java.lang.String path)
          Load and return the image.
 java.awt.image.BufferedImage getImage(java.lang.String id, ImageType type)
          Load and return the image.
 java.awt.image.BufferedImage getImage(java.lang.String id, ImageType type, int width)
          Load, return and resize the image.
 java.awt.image.BufferedImage getImage(java.lang.String id, int width)
          Load, return and resize the image.
 java.awt.image.BufferedImage getImage(java.lang.String basename, java.lang.String id, ImageType type)
          Load and return the image.
 java.awt.image.BufferedImage getImage(java.lang.String basename, java.lang.String id, ImageType type, int width)
          Load, return and resize the image.
 org.springframework.core.io.Resource getResource(java.lang.String path)
          Return the ressource of the path.
 java.io.InputStream getResourceAsStream(java.lang.String path)
          Return the ressource as stream.
 void init()
          Init the manager.
 void preInit()
          Pre-init the manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceManager

public ResourceManager()
Method Detail

preInit

public void preInit()
Description copied from interface: IManager
Pre-init the manager. This operation is called before modules preplug.

Specified by:
preInit in interface IManager

init

public void init()
          throws ManagerException
Description copied from interface: IManager
Init the manager. This operation is called after modules preplug but before module plug.

Specified by:
init in interface IManager
Throws:
ManagerException - If an error occurs during the init process.

close

public void close()
           throws ManagerException
Description copied from interface: IManager
Close the manager.

Specified by:
close in interface IManager
Throws:
ManagerException - If an error occurs during the close process.

getIcon

public javax.swing.ImageIcon getIcon(java.lang.String basename,
                                     java.lang.String id,
                                     ImageType type)
Description copied from interface: IResourceManager
Load and return the icon.

Specified by:
getIcon in interface IResourceManager
Parameters:
basename - The images basename.
id - The image index.
type - The image type.
Returns:
The loaded icon.

getIcon

public javax.swing.ImageIcon getIcon(java.lang.String id,
                                     ImageType type)
Description copied from interface: IResourceManager
Load and return the icon.

Specified by:
getIcon in interface IResourceManager
Parameters:
id - The image index.
type - The image type.
Returns:
The loaded icon.

getIcon

public javax.swing.ImageIcon getIcon(java.lang.String path)
Description copied from interface: IResourceManager
Load and return the icon.

Specified by:
getIcon in interface IResourceManager
Parameters:
path - The image index.
Returns:
The loaded icon.

getImage

public java.awt.image.BufferedImage getImage(java.lang.String basename,
                                             java.lang.String id,
                                             ImageType type,
                                             int width)
Description copied from interface: IResourceManager
Load, return and resize the image.

Specified by:
getImage in interface IResourceManager
Parameters:
basename - The image base name.
id - The image index.
type - The image type.
width - The width.
Returns:
The loaded icon.

getImage

public java.awt.image.BufferedImage getImage(java.lang.String basename,
                                             java.lang.String id,
                                             ImageType type)
Description copied from interface: IResourceManager
Load and return the image.

Specified by:
getImage in interface IResourceManager
Parameters:
basename - The image base name.
id - The image index.
type - The image type.
Returns:
The loaded icon.

getImage

public java.awt.image.BufferedImage getImage(java.lang.String id,
                                             ImageType type,
                                             int width)
Description copied from interface: IResourceManager
Load, return and resize the image.

Specified by:
getImage in interface IResourceManager
Parameters:
id - The image index.
type - The image type.
width - The width.
Returns:
The loaded icon.

getImage

public java.awt.image.BufferedImage getImage(java.lang.String id,
                                             ImageType type)
Description copied from interface: IResourceManager
Load and return the image.

Specified by:
getImage in interface IResourceManager
Parameters:
id - The image index.
type - The image type.
Returns:
The loaded icon.

getImage

public java.awt.image.BufferedImage getImage(java.lang.String id,
                                             int width)
Description copied from interface: IResourceManager
Load, return and resize the image.

Specified by:
getImage in interface IResourceManager
Parameters:
id - The image index.
width - The width.
Returns:
The loaded icon.

getImage

public java.awt.image.BufferedImage getImage(java.lang.String path)
Description copied from interface: IResourceManager
Load and return the image.

Specified by:
getImage in interface IResourceManager
Parameters:
path - The image index.
Returns:
The loaded icon.

getColor

public java.awt.Color getColor(java.lang.String name)
Description copied from interface: IResourceManager
Return the color of the specified name.

Specified by:
getColor in interface IResourceManager
Parameters:
name - The name of the color.
Returns:
The color of the specified name.

getAction

public JThequeAction getAction(java.lang.String name)
Description copied from interface: IResourceManager
Return the action of the specified name.

Specified by:
getAction in interface IResourceManager
Parameters:
name - The name of the color.
Returns:
The action of the specified name.

getResource

public org.springframework.core.io.Resource getResource(java.lang.String path)
Description copied from interface: IResourceManager
Return the ressource of the path.

Specified by:
getResource in interface IResourceManager
Parameters:
path - The path to the ressource.
Returns:
The loaded Ressource.

getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String path)
Description copied from interface: IResourceManager
Return the ressource as stream.

Specified by:
getResourceAsStream in interface IResourceManager
Parameters:
path - The path to the ressource.
Returns:
The inputstream of the loaded ressource.


Copyright © 2009 JTheque. All Rights Reserved.