com.cc.framework.ui
Class AbstractImageMap

java.lang.Object
  extended bycom.cc.framework.ui.AbstractImageMap
All Implemented Interfaces:
ImageMap, java.io.Serializable
Direct Known Subclasses:
RegExpImageMap, SimpleImageMap

public abstract class AbstractImageMap
extends java.lang.Object
implements ImageMap, java.io.Serializable

Abstract ImageMap implementation

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

Nested Class Summary
static class AbstractImageMap.ImageMapping
          A ImageMapping maps a regular expression to an image
 
Field Summary
private  java.lang.String base
          The base directory for all the images
private  java.util.Vector mappings
          Collection with all images in the image map in the format Tupel: (regular expression, image)
private  java.lang.String name
          Name of the ImageMap
private  RunAt runat
          Specifies if the image map should be exposed as a java script object to the client browser (RunAt.CLIENT)
private static long serialVersionUID
          Serial Version UID
 
Constructor Summary
AbstractImageMap()
          Constructor for ImageMap
 
Method Summary
 void addImage(java.lang.String rule, ImageModel image)
          Adds an image to the image map
 java.lang.String getBase()
          Returns the base directory for all the images
 java.util.Collection getMappings()
          Deprecated. use method iterator()
 java.lang.String getName()
          Returns the name for this ImageMap
 RunAt getRunat()
          Returns the RunAt attribute
 java.util.Iterator iterator()
          Returns an iterator for ImageMapping Objects
 ImageModel mapValueToImage(java.lang.Object value)
          Returns an image for an expression
protected abstract  boolean match(AbstractImageMap.ImageMapping mapping, java.lang.Object value)
          A derived class has to implement this abstract method and implement a strategy how values are mapped on Image Mappings.
 void setBase(java.lang.String base)
          Sets the base directory for all the images
 void setName(java.lang.String name)
          Sets the name for this ImageMap
 void setRunat(RunAt runat)
          Sets the RunAt attribute
 
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

mappings

private java.util.Vector mappings
Collection with all images in the image map in the format Tupel: (regular expression, image)


name

private java.lang.String name
Name of the ImageMap


base

private java.lang.String base
The base directory for all the images


runat

private RunAt runat
Specifies if the image map should be exposed as a java script object to the client browser (RunAt.CLIENT)

Constructor Detail

AbstractImageMap

public AbstractImageMap()
Constructor for ImageMap

Method Detail

addImage

public void addImage(java.lang.String rule,
                     ImageModel image)
Adds an image to the image map

Parameters:
rule - A regular expression
image - The image
See Also:
ImageModel

getMappings

public java.util.Collection getMappings()
Deprecated. use method iterator()

Returns a collection of ImageMapping objects

Returns:
ImageMap.ImageMapping collection

iterator

public java.util.Iterator iterator()
Returns an iterator for ImageMapping Objects

Returns:
ImageMap.ImageMapping iterator

mapValueToImage

public ImageModel mapValueToImage(java.lang.Object value)
Returns an image for an expression

Specified by:
mapValueToImage in interface ImageMap
Parameters:
value - Object
Returns:
The image

match

protected abstract boolean match(AbstractImageMap.ImageMapping mapping,
                                 java.lang.Object value)
                          throws java.lang.Exception
A derived class has to implement this abstract method and implement a strategy how values are mapped on Image Mappings.

Parameters:
mapping - The Image Mapping
value - the key
Returns:
return when the mapping matches the given key
Throws:
java.lang.Exception - Is thrown when an error occurs

getBase

public java.lang.String getBase()
Returns the base directory for all the images

Specified by:
getBase in interface ImageMap
Returns:
The base directory for all the images

getName

public java.lang.String getName()
Returns the name for this ImageMap

Specified by:
getName in interface ImageMap
Returns:
The name for this ImageMap

getRunat

public RunAt getRunat()
Returns the RunAt attribute

Specified by:
getRunat in interface ImageMap
Returns:
The RunAt attribute

setBase

public void setBase(java.lang.String base)
Sets the base directory for all the images

Parameters:
base - The base directory

setName

public void setName(java.lang.String name)
Sets the name for this ImageMap

Parameters:
name - The name for the ImageMap

setRunat

public void setRunat(RunAt runat)
Sets the RunAt attribute

Parameters:
runat - The RunAt attribute


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