|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.common.theme.ThemeMap
@FrameworkOnly public class ThemeMap
A map of ThemeFactory
s. This map can change the DockTheme
of its associated CControl
. New factories can be added or removed
from the map.
Field Summary | |
---|---|
static java.lang.String |
KEY_BASIC_THEME
standard key for the CBasicTheme |
static java.lang.String |
KEY_BUBBLE_THEME
standard key for the CBubbleTheme |
static java.lang.String |
KEY_ECLIPSE_THEME
standard key for the CEclipseTheme |
static java.lang.String |
KEY_FLAT_THEME
standard key for the CFlatTheme |
static java.lang.String |
KEY_SMOOTH_THEME
standard key for the CSmoothTheme |
Constructor Summary | |
---|---|
ThemeMap()
Creates a new empty map. |
|
ThemeMap(CControl control)
Creates a new map and wires this map to control . |
Method Summary | |
---|---|
void |
add(java.lang.String key,
ThemeFactory factory)
Adds factory at the end of this map. |
void |
addThemeMapListener(ThemeMapListener listener)
Adds a new listener to this map. |
ThemeFactory |
getFactory(int index)
Gets the index 'th factory. |
ThemeFactory |
getFactory(java.lang.String key)
Searches the factory which is associated with key . |
java.lang.String |
getKey(int index)
Gets the key of the index 'th element. |
DockThemeModifier |
getModifier()
Gets the object which will modify the DockTheme before applying
the theme to the DockController . |
ThemeFactory |
getSelectedFactory()
Gets the currently selected factory. |
java.lang.String |
getSelectedKey()
Gets the name of the currently selected factory. |
int |
indexOf(java.lang.String key)
Searches for key and returns its location. |
int |
indexOf(ThemeFactory factory)
Searches for factory and returns its index. |
void |
insert(int index,
java.lang.String key,
ThemeFactory factory)
Inserts a new factory into this map. |
protected ThemeMapListener[] |
listeners()
Gets an array containing all ThemeMapListener s of this map. |
void |
put(java.lang.String key,
ThemeFactory factory)
Searches for an entry named key and changes its factory. |
void |
remove(int index)
Removes the index 'th entry of this map. |
boolean |
remove(java.lang.String key)
Deletes the factory associated with key . |
void |
removeThemeMapListener(ThemeMapListener listener)
Removes a listener from this map. |
void |
select(int index)
Changes the selected factory. |
void |
select(int index,
boolean force)
Changes the selected factory. |
void |
select(java.lang.String key)
Changes the selected factory. |
void |
select(java.lang.String key,
boolean force)
Changes the selected factory. |
void |
select(ThemeFactory factory)
Changes the selected factory to factory . |
void |
setModifier(DockThemeModifier modifier)
Sets the object which will modify the DockTheme before applying
the theme to the DockController . |
int |
size()
Gets the number of elements of this map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String KEY_BASIC_THEME
CBasicTheme
public static final java.lang.String KEY_BUBBLE_THEME
CBubbleTheme
public static final java.lang.String KEY_ECLIPSE_THEME
CEclipseTheme
public static final java.lang.String KEY_FLAT_THEME
CFlatTheme
public static final java.lang.String KEY_SMOOTH_THEME
CSmoothTheme
Constructor Detail |
---|
public ThemeMap()
public ThemeMap(CControl control)
control
. Ensures
that the standard themes are available.control
,
and this map will ensure that the name of the theme is stored in the
ApplicationResourceManager
.
control
- the control to monitorMethod Detail |
---|
public void addThemeMapListener(ThemeMapListener listener)
listener
- the new listenerpublic void removeThemeMapListener(ThemeMapListener listener)
listener
- the listener to removeprotected ThemeMapListener[] listeners()
ThemeMapListener
s of this map.
public void setModifier(DockThemeModifier modifier)
DockTheme
before applying
the theme to the DockController
.
modifier
- the new modifier, can be null
public DockThemeModifier getModifier()
DockTheme
before applying
the theme to the DockController
.
null
public void select(java.lang.String key)
key
or key
is null
, then the
null
-factory is selected.
key
- the name of the newly selected factory, can be null
public void select(java.lang.String key, boolean force)
key
or key
is null
, then the
null
-factory is selected.
key
- the name of the newly selected factory, can be null
force
- true
if the theme is to be loaded even
if it is already selectedpublic void select(ThemeFactory factory)
factory
.
factory
- the factory to select
java.lang.IllegalArgumentException
- if factory
is not registered
in this map.public void select(int index)
index
- the index of the newly selected factory, -1 will deselect
any factorypublic void select(int index, boolean force)
index
- the index of the newly selected factory, -1 will deselect
any factoryforce
- true
if an update should be forced even if
there seems not to be a changepublic java.lang.String getSelectedKey()
null
public ThemeFactory getSelectedFactory()
null
public int size()
public void put(java.lang.String key, ThemeFactory factory)
key
and changes its factory.
If no such entry is found, then factory
is added at the
end of this map.
key
- the name of the factoryfactory
- the new factorypublic void add(java.lang.String key, ThemeFactory factory)
factory
at the end of this map. If there is already
a factory named key
, then that other factory is first removed.
key
- the key of the new factoryfactory
- the new factorypublic void insert(int index, java.lang.String key, ThemeFactory factory)
key
in this map, then that other factory is removed.
index
- the index where to insert the new factorykey
- the key of the new factoryfactory
- the new factorypublic void remove(int index)
index
'th entry of this map.
index
- the name of the element to removepublic boolean remove(java.lang.String key)
key
.
key
- the name of the element to remove
true
if the element was deleted, false
if no element named key
was foundpublic int indexOf(ThemeFactory factory)
factory
and returns its index.
factory
- the factory to search
public int indexOf(java.lang.String key)
key
and returns its location.
key
- the key to search
public java.lang.String getKey(int index)
index
'th element.
index
- the index of the element
public ThemeFactory getFactory(int index)
index
'th factory.
index
- the index of the factory
null
public ThemeFactory getFactory(java.lang.String key)
key
.
key
- the unique name of a factory
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |