org.geotools.swt.utils
Class ImageCache

Object
  extended by ImageCache

public class ImageCache
extends Object

A singleton cache for images.

Author:
Andrea Antonello (www.hydrologis.com)

Field Summary
static String ALPHA
           
static String CHECKED
           
static String DOWN
           
static String FEATURE
           
static String GRID
           
static String IMAGE_FULLEXTENT
           
static String IMAGE_INFO
           
static String IMAGE_INFO_ICON
           
static String IMAGE_PAN
           
static String IMAGE_ZOOMIN
           
static String IMAGE_ZOOMOUT
           
static String OPEN
           
static String REMOVE_LAYER
           
static String STYLE
           
static String UNCHECKED
           
static String UP
           
 
Method Summary
 void addImage(String key, Image image)
          Method to add images with key.
 void dispose()
          Disposes the images and clears the internal map.
 Image getImage(String key)
          Get an image for a certain key.
static ImageCache getInstance()
           
 List<String> getRelativePaths()
          Getter for the list of keys of the images, which are also the relative path.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHECKED

public static final String CHECKED
See Also:
Constant Field Values

UNCHECKED

public static final String UNCHECKED
See Also:
Constant Field Values

STYLE

public static final String STYLE
See Also:
Constant Field Values

GRID

public static final String GRID
See Also:
Constant Field Values

FEATURE

public static final String FEATURE
See Also:
Constant Field Values

UP

public static final String UP
See Also:
Constant Field Values

DOWN

public static final String DOWN
See Also:
Constant Field Values

OPEN

public static final String OPEN
See Also:
Constant Field Values

ALPHA

public static final String ALPHA
See Also:
Constant Field Values

REMOVE_LAYER

public static final String REMOVE_LAYER
See Also:
Constant Field Values

IMAGE_INFO

public static final String IMAGE_INFO
See Also:
Constant Field Values

IMAGE_INFO_ICON

public static final String IMAGE_INFO_ICON
See Also:
Constant Field Values

IMAGE_PAN

public static final String IMAGE_PAN
See Also:
Constant Field Values

IMAGE_ZOOMIN

public static final String IMAGE_ZOOMIN
See Also:
Constant Field Values

IMAGE_ZOOMOUT

public static final String IMAGE_ZOOMOUT
See Also:
Constant Field Values

IMAGE_FULLEXTENT

public static final String IMAGE_FULLEXTENT
See Also:
Constant Field Values
Method Detail

getInstance

public static ImageCache getInstance()

getImage

public Image getImage(String key)
Get an image for a certain key.

The only keys to be used are the static strings in this class

Parameters:
key - a file key, as for example IMAGE_PAN.
Returns:
the image.

dispose

public void dispose()
Disposes the images and clears the internal map.


addImage

public void addImage(String key,
                     Image image)
Method to add images with key.

This is handy for example in cases in which it is not possible to retrieve the images from within the bundle. Ex. eclipse plugin environment.

Parameters:
key - the key for the image.
image - the image to add.

getRelativePaths

public List<String> getRelativePaths()
Getter for the list of keys of the images, which are also the relative path.

Returns:
the list of keys.


Copyright © 1996-2014 Geotools. All Rights Reserved.