bibliothek.gui.dock.util
Class IconManager

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

public class IconManager
extends UIProperties<javax.swing.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.

Author:
Benjamin Sigg

Constructor Summary
IconManager(DockController controller)
          Creates a new IconManager.
 
Method Summary
 void setIcon(java.lang.String key, Priority priority, javax.swing.Icon icon)
          Stores an icon.
 void setIconClient(java.lang.String key, javax.swing.Icon icon)
          Sets an icon with client-priority.
 void setIconDefault(java.lang.String key, javax.swing.Icon icon)
          Sets an icon with default-priority.
 void setIconTheme(java.lang.String key, javax.swing.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
 

Constructor Detail

IconManager

public IconManager(DockController controller)
Creates a new IconManager.

Parameters:
controller - the owner of this map
Method Detail

setIcon

public void setIcon(java.lang.String key,
                    Priority priority,
                    javax.swing.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(java.lang.String key,
                           javax.swing.Icon icon)
Sets an icon with default-priority.

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

setIconTheme

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

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

setIconClient

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

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