bibliothek.gui.dock.util
Class IconManager

java.lang.Object
  extended by bibliothek.gui.dock.util.UIProperties<Icon,DockIcon,DockIconBridge>
      extended by bibliothek.gui.dock.util.IconManager

public class IconManager
extends UIProperties<Icon,DockIcon,DockIconBridge>

A map of icons which are used by various objects. The icon is stored under a given String-key. Every icon can be stored with three different priorities, only the icon with the highest priority will be returned.
Clients have to add an DockIcon in order to read values from this manager.
The default icons are stored as png files alongside the framework, the "icons.ini" files tells what keys are used for the icons. Additional keys for icons are:

Author:
Benjamin Sigg

Field Summary
static PropertyKey<Dimension> MINIMUM_ICON_SIZE
          What size the framework should expect the smallest icon to be.
 
Constructor Summary
IconManager(DockController controller)
          Creates a new IconManager.
 
Method Summary
 void setIcon(String key, Priority priority, Icon icon)
          Stores an icon.
 void setIconClient(String key, Icon icon)
          Sets an icon with client-priority.
 void setIconDefault(String key, Icon icon)
          Sets an icon with default-priority.
 void setIconTheme(String key, Icon icon)
          Sets an icon with theme-priority.
 
Methods inherited from class bibliothek.gui.dock.util.UIProperties
add, clear, get, get, getBridge, getBridgeFor, getController, getScheme, isObserved, isObserved, isStored, lockUpdate, publish, put, remove, setScheme, unlockUpdate, unpublish, unpublish
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINIMUM_ICON_SIZE

public static final PropertyKey<Dimension> MINIMUM_ICON_SIZE
What size the framework should expect the smallest icon to be. This number is used to calculate the minimum and the preferred size of various Components. This is not a hard boundary, just expect any icon smaller than this constant to be surrounded by some addional empty space. The default size is 16x16 pixels.

Constructor Detail

IconManager

public IconManager(DockController controller)
Creates a new IconManager.

Parameters:
controller - the owner of this map
Method Detail

setIcon

public void setIcon(String key,
                    Priority priority,
                    Icon icon)
Stores an icon.

Parameters:
key - the key of the icon
priority - the priority, where Priority.CLIENT is the highest, Priority.DEFAULT the lowest. Icons stored with the same key but another priority are not deleted.
icon - the icon, null if the icon should be removed

setIconDefault

public void setIconDefault(String key,
                           Icon icon)
Sets an icon with default-priority.

Parameters:
key - the key of the icon
icon - the icon or null

setIconTheme

public void setIconTheme(String key,
                         Icon icon)
Sets an icon with theme-priority.

Parameters:
key - the key of the icon
icon - the icon or null

setIconClient

public void setIconClient(String key,
                          Icon icon)
Sets an icon with client-priority.

Parameters:
key - the key of the icon
icon - the icon or null