com.cc.framework.ui.painter
Class ResourceMapImp

java.lang.Object
  extended bycom.cc.framework.ui.painter.ResourceMapImp
All Implemented Interfaces:
ResourceMap, java.io.Serializable
Direct Known Subclasses:
AjaxResourceMap, DefResourceMap, GlobalResourceMap, HtmlResourceMap

public abstract class ResourceMapImp
extends java.lang.Object
implements ResourceMap, java.io.Serializable

ResourceMap

Since:
1.1
Version:
$Revision: 1.23 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private  ColorPalette colorpalette
          Color Palette
private static int IGNORE_SIZE
           
private  boolean initialized
          Flag for lazy initialization
private  java.lang.String resourceDir
          Resource directory
private  java.util.Hashtable resources
          The Resource repository
private static long serialVersionUID
          Serial Version UID
 
Constructor Summary
ResourceMapImp()
          Constructor
 
Method Summary
protected abstract  void doRegisterColors()
          Registers all local colors
protected abstract  void doRegisterImages()
          Registers all local images
protected abstract  void doRegisterStrings()
          Registers all local strings
 Color getColor(java.lang.String resourceId)
          Retrieves a color for the specified Id
 ColorPalette getColorPalette()
          Returns the color palette
 java.lang.String getId(int size, java.lang.String resourceId)
          Creates a resource identifier for an image
 ImageModel getImage(int size, java.lang.String resourceId)
          Retrieves an image for the specified Id
 ImageModel getImage(java.lang.String resourceId)
          Retrieves an image for the specified Id
 java.lang.Object getResource(int size, java.lang.String resourceId)
          Retrieves an image for the specified Id
 java.lang.String getResourceDir()
          Returns the base directory used for resource by the PainterFactory
 java.util.Set getResourceKeys()
          Returns a set with all the Resource Keys of this Resource Map
 java.lang.String getString(java.lang.String resourceId, boolean returnNull)
          Retrieves an String for the specified Id
 java.lang.String getString(java.lang.String resourceId, java.lang.Object[] params, boolean returnNull)
          Retrieves an String for the specified Id
protected  void init()
          For initialization
 void register(java.lang.String resourceId, java.lang.Object resource)
          Registers a locale resource
 void registerColor(java.lang.String resourceId, Color color)
          Registers one locale color
 void registerImage(int size, java.lang.String resourceId, ImageModel image)
          Registers one locale image
 void registerImage(java.lang.String resourceId, ImageModel image)
          Registers one local image
 void registerString(java.lang.String resourceId, java.lang.String text)
          Registers a string resource
 void setColorPalette(ColorPalette palette)
          Sets the color palette.
 void setResourceDir(java.lang.String resourceDir)
          Sets the directory used for resource by the PainterFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

IGNORE_SIZE

private static final int IGNORE_SIZE
See Also:
Constant Field Values

resourceDir

private java.lang.String resourceDir
Resource directory


resources

private java.util.Hashtable resources
The Resource repository


colorpalette

private ColorPalette colorpalette
Color Palette


initialized

private boolean initialized
Flag for lazy initialization

Constructor Detail

ResourceMapImp

public ResourceMapImp()
Constructor

Method Detail

init

protected void init()
For initialization


doRegisterImages

protected abstract void doRegisterImages()
Registers all local images


doRegisterColors

protected abstract void doRegisterColors()
Registers all local colors


doRegisterStrings

protected abstract void doRegisterStrings()
Registers all local strings


registerImage

public void registerImage(java.lang.String resourceId,
                          ImageModel image)
Description copied from interface: ResourceMap
Registers one local image

Specified by:
registerImage in interface ResourceMap
Parameters:
resourceId - The Image Resource Id
image - The Image
See Also:
ResourceMap.registerImage(java.lang.String, com.cc.framework.ui.model.ImageModel)

getId

public java.lang.String getId(int size,
                              java.lang.String resourceId)
Description copied from interface: ResourceMap
Creates a resource identifier for an image

Specified by:
getId in interface ResourceMap
Parameters:
size - The image size
resourceId - The Image Resource Id
Returns:
Resource Identifier
See Also:
ResourceMap.getId(int, java.lang.String)

registerImage

public void registerImage(int size,
                          java.lang.String resourceId,
                          ImageModel image)
Description copied from interface: ResourceMap
Registers one locale image

Specified by:
registerImage in interface ResourceMap
Parameters:
size - The image size
resourceId - The Image Resource Id
image - The Image
See Also:
ResourceMap.registerImage(int, java.lang.String, com.cc.framework.ui.model.ImageModel)

registerColor

public void registerColor(java.lang.String resourceId,
                          Color color)
Description copied from interface: ResourceMap
Registers one locale color

Specified by:
registerColor in interface ResourceMap
Parameters:
resourceId - The Image Resource Id
color - the Color
See Also:
ResourceMap.registerColor(java.lang.String, com.cc.framework.ui.Color)

registerString

public void registerString(java.lang.String resourceId,
                           java.lang.String text)
Description copied from interface: ResourceMap
Registers a string resource

Specified by:
registerString in interface ResourceMap
Parameters:
resourceId - The string resource Id
text - The text associated with the resource Id
See Also:
ResourceMap.registerString(java.lang.String, java.lang.String)

setColorPalette

public void setColorPalette(ColorPalette palette)
Description copied from interface: ResourceMap
Sets the color palette. You can register individual colors with registerColor which will hide the entries of the color palette.

Specified by:
setColorPalette in interface ResourceMap
Parameters:
palette - Color Palette
See Also:
ResourceMap.setColorPalette(com.cc.framework.ui.painter.ColorPalette)

register

public void register(java.lang.String resourceId,
                     java.lang.Object resource)
Description copied from interface: ResourceMap
Registers a locale resource

Specified by:
register in interface ResourceMap
Parameters:
resourceId - The Resource Id
resource - The Resource
See Also:
ResourceMap.register(java.lang.String, java.lang.Object)

getImage

public final ImageModel getImage(java.lang.String resourceId)
Description copied from interface: ResourceMap
Retrieves an image for the specified Id

Specified by:
getImage in interface ResourceMap
Parameters:
resourceId - Image Id
Returns:
The Image or null
See Also:
ResourceMap.getImage(java.lang.String)

getImage

public ImageModel getImage(int size,
                           java.lang.String resourceId)
Description copied from interface: ResourceMap
Retrieves an image for the specified Id

Specified by:
getImage in interface ResourceMap
Parameters:
size - Image Size
resourceId - Image Id
Returns:
The Image or null
See Also:
ResourceMap.getImage(int, java.lang.String)

getColor

public Color getColor(java.lang.String resourceId)
Description copied from interface: ResourceMap
Retrieves a color for the specified Id

Specified by:
getColor in interface ResourceMap
Parameters:
resourceId - Color Id
Returns:
The Color or null
See Also:
ResourceMap.getColor(java.lang.String)

getResource

public java.lang.Object getResource(int size,
                                    java.lang.String resourceId)
Description copied from interface: ResourceMap
Retrieves an image for the specified Id

Specified by:
getResource in interface ResourceMap
Parameters:
size - The size
resourceId - The resource id
Returns:
The Resource or null
See Also:
ResourceMap.getResource(int, java.lang.String)

getString

public final java.lang.String getString(java.lang.String resourceId,
                                        boolean returnNull)
Description copied from interface: ResourceMap
Retrieves an String for the specified Id

Specified by:
getString in interface ResourceMap
Parameters:
resourceId - String Id
returnNull - controls whether to return null or a not present indicator
Returns:
The String or null
See Also:
ResourceMap.getString(java.lang.String, boolean)

getString

public java.lang.String getString(java.lang.String resourceId,
                                  java.lang.Object[] params,
                                  boolean returnNull)
Description copied from interface: ResourceMap
Retrieves an String for the specified Id

Specified by:
getString in interface ResourceMap
Parameters:
resourceId - String Id
params - Array with parameters for markup substitution
returnNull - controls whether to return null or a not present indicator
Returns:
The String or null
See Also:
ResourceMap.getString(java.lang.String, java.lang.Object[], boolean)

getResourceDir

public java.lang.String getResourceDir()
Description copied from interface: ResourceMap
Returns the base directory used for resource by the PainterFactory

Specified by:
getResourceDir in interface ResourceMap
Returns:
The web resource directory
See Also:
ResourceMap.getResourceDir()

setResourceDir

public void setResourceDir(java.lang.String resourceDir)
Description copied from interface: ResourceMap
Sets the directory used for resource by the PainterFactory

Specified by:
setResourceDir in interface ResourceMap
Parameters:
resourceDir - The resource directory
See Also:
ResourceMap.setResourceDir(java.lang.String)

getResourceKeys

public java.util.Set getResourceKeys()
Returns a set with all the Resource Keys of this Resource Map

Returns:
Key Set

getColorPalette

public ColorPalette getColorPalette()
Returns the color palette

Returns:
Color palette or null


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.