|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.util.color.ColorManager
public class ColorManager
A ColorManager
contains Color
s, ColorProvider
s and
DockColor
s. Some DockColor
s are associated with a
ColorProvider
. If a Color
in this manager is
set
, then each DockColor
that listens
for that color gets informed about the change either through its
provider or directly from the manager.
Constructor Summary | |
---|---|
ColorManager()
|
Method Summary | ||
---|---|---|
|
add(String colorId,
Class<? super D> kind,
D observer)
Installs a new observer. |
|
void |
clear(Priority priority)
Removes all values that stored under the given priority. |
|
Color |
get(String id)
Gets a color of this manager. |
|
protected ColorProvider<?> |
getProviderFor(Class<?> clazz)
Searches a provider that can be used for clazz . |
|
void |
lockUpdate()
Tells this manager to stall all updates. |
|
|
publish(Priority priority,
Class<? extends D> kind,
ColorProvider<D> provider)
Adds a new provider of colors to this manager. |
|
void |
put(Priority priority,
String id,
Color color)
Sets a color of this manager. |
|
void |
remove(DockColor observer)
Uninstalls an observer |
|
void |
unlockUpdate()
Tells this manager no longer to stall updates. |
|
void |
unpublish(Priority priority,
Class<? extends DockColor> kind)
Removes the ColorProvider that handles DockColor s
of kind kind . |
|
void |
unpublish(Priority priority,
ColorProvider<?> provider)
Searches for all occurrences of provider and removes them. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorManager()
Method Detail |
---|
public void lockUpdate()
DockColor
will
be informed when a color or provider changes.
public void unlockUpdate()
DockColor
s.
public <D extends DockColor> void publish(Priority priority, Class<? extends D> kind, ColorProvider<D> provider)
D
- the kind of observers this provider likespriority
- the importance of the new providerkind
- the kind of observers this provider likesprovider
- the new providerpublic void unpublish(Priority priority, Class<? extends DockColor> kind)
ColorProvider
that handles DockColor
s
of kind kind
.
priority
- the importance of the providerkind
- some kind of DockColor
public void unpublish(Priority priority, ColorProvider<?> provider)
provider
and removes them.
All DockColor
s that used provider
are redistributed.
priority
- the importance of the providerprovider
- the provider to removepublic <D extends DockColor> void add(String colorId, Class<? super D> kind, D observer)
D
- the type of the observercolorId
- the id of the color that should be observedkind
- the type of the observerobserver
- the new observerpublic void remove(DockColor observer)
observer
- the observer to removeprotected ColorProvider<?> getProviderFor(Class<?> clazz)
clazz
.
clazz
- the type whose provider is searched
null
public void put(Priority priority, String id, Color color)
priority
- the importance of this valueid
- the id of the colorcolor
- the new colorpublic Color get(String id)
id
- the id of the color
null
put(Priority, String, Color)
public void clear(Priority priority)
priority
- the priority whose elements should be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |