org.openpermis.editor.policy.gui
Class IconRegistry

java.lang.Object
  extended by org.openpermis.editor.policy.gui.IconRegistry

public class IconRegistry
extends Object

Registry for icons.

Icons can be accessed by keys defined in a resource map. Annotated icons in form "key[annotation1,annotation2]" are supported.

See Also:
IconAnnotation
Since:
0.3.0

Field Summary
private  IconRegistry parent
          The parent registry to ask first if there is a request for an icon.
private  String prefix
          The prefix to use when loading icons from the resource map.
private  Map<String,Icon> registry
          Registry of loaded icons.
private  org.jdesktop.application.ResourceMap resourceMap
          The resource map to load icons from.
 
Constructor Summary
IconRegistry(IconRegistry parent, org.jdesktop.application.ResourceMap resourceMap, String prefix)
          Creates an icon registry that loads its icons according to the keys stored in the specified resource map.
 
Method Summary
 Icon getIcon(String key)
          Returns an icon for the specified key.
private  Icon load(String key)
          Loads an icon with the specified key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

private final IconRegistry parent
The parent registry to ask first if there is a request for an icon.

Since:
0.3.0

resourceMap

private final org.jdesktop.application.ResourceMap resourceMap
The resource map to load icons from.

Since:
0.3.0

registry

private final Map<String,Icon> registry
Registry of loaded icons.

Since:
0.3.0

prefix

private final String prefix
The prefix to use when loading icons from the resource map.

Since:
0.3.0
Constructor Detail

IconRegistry

public IconRegistry(IconRegistry parent,
                    org.jdesktop.application.ResourceMap resourceMap,
                    String prefix)
Creates an icon registry that loads its icons according to the keys stored in the specified resource map.

Parameters:
parent - parent registry to ask first for icons, may be null.
resourceMap - the resource map to load the icons from.
prefix - the prefix to use when loading icons from the resource map.
Since:
0.3.0
Method Detail

load

private Icon load(String key)
Loads an icon with the specified key.

Parameters:
key - the resource map icon key to load the icon from.
Returns:
the icon loaded, null if there is no such icon.
Since:
0.3.0

getIcon

public Icon getIcon(String key)
Returns an icon for the specified key.

The key may be annotated.

Parameters:
key - the key for wihch to retrieve an icon.
Returns:
the icon requested, null if there is no such icon.
Since:
0.3.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:22
Copyright (c) 2002-2007 Ergon Informatik AG