|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.DockUI
@Todo(compatibility=BREAK_MAJOR, target=VERSION_1_1_0, priority=MAJOR, description="Use an UIManager instead of bundles to handle text, also applies to the Common library") public class DockUI
A list of icons, text and methods used by the framework.
Field Summary | |
---|---|
static String |
OVERFLOW_MENU_ICON
Key for an Icon stored in the IconManager for an overflow-menu |
Constructor Summary | |
---|---|
protected |
DockUI()
Creates a new DockUI |
Method Summary | ||
---|---|---|
void |
addLocaleListener(LocaleListener listener)
Adds a new LocaleListener . |
|
void |
addLookAndFeelColorsListener(LookAndFeelColorsListener listener)
Adds a listener which gets informed when a color of the current LookAndFeelColors changes. |
|
void |
fillIcons(IconManager manager)
Fills all known icons as default-icons into the given manager. |
|
ResourceBundle |
getBundle()
Gets the local resource bundle. |
|
static Color |
getColor(String key)
Gets the color key where key is one of
the keys specified in LookAndFeelColors . |
|
LookAndFeelColors |
getColors()
Gets the current source of colors that depend on the LookAndFeel . |
|
static Combiner |
getCombiner(Combiner combiner,
DockStation station)
Gets a Combiner for station . |
|
static DockUI |
getDefaultDockUI()
Gets the default instance of DockUI. |
|
ThemeFactory |
getDefaultTheme()
Gets the default-theme to be used by all DockController s when
nothing else is specified. |
|
static DisplayerFactory |
getDisplayerFactory(DisplayerFactory factory,
DockStation station)
Gets a DisplayerFactory for station . |
|
Icon |
getIcon(String key)
Gets the icon stored under key . |
|
Locale |
getLocale()
Gets the Locale for which the ResourceBundle
was loaded. |
|
static StationPaint |
getPaint(StationPaint paint,
DockStation station)
Gets a StationPaint for station . |
|
String |
getString(String key)
Gets a string of the current bundle . |
|
ThemeFactory[] |
getThemes()
Gets the list of all available themes. |
|
void |
registerColors(String lookAndFeelClassNameRegex,
LookAndFeelColors colors)
Registeres a new LookAndFeelColors . |
|
|
registerTheme(Class<T> theme,
ResourceBundle bundle)
Registers a factory for theme . |
|
void |
registerTheme(ThemeFactory factory)
Stores a new theme. |
|
void |
removeLocaleListener(LocaleListener listener)
Removes listener from this DockUI . |
|
void |
removeLookAndFeelColorsListener(LookAndFeelColorsListener listener)
Removes a listener from this DockUI . |
|
protected LookAndFeelColors |
selectBestMatchingColors()
Gets the LookAndFeelColors which matches the current
LookAndFeel best. |
|
void |
setBundle(Locale locale)
Deprecated. replaced by setLocale(Locale) |
|
void |
setBundle(ResourceBundle bundle)
Sets the resource bundle which should be used. |
|
void |
setIcon(String key,
Icon icon)
Sets the icon that is used for a certain key. |
|
void |
setLocale(Locale locale)
Sets the locale for which a ResourceBundle
should be loaded. |
|
void |
unregisterTheme(ThemeFactory factory)
Removes an earlier added factory from the set of theme-factories. |
|
protected void |
updateLookAndFeelColors()
Updates the currently used LookAndFeelColors to the best
matching colors. |
|
static
|
updateTheme(D station,
DockFactory<D,L> factory)
Removes all children of station and then adds
the children again. |
|
protected void |
updateUI()
Called when the LookAndFeel changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Todo(compatibility=BREAK_MINOR, priority=MINOR, target=VERSION_1_1_0, description="Instead of just a simple icon allow clients more influence of what an overflow-menu can do. This key may remain, but its value may not be used all the time.") public static final String OVERFLOW_MENU_ICON
Icon
stored in the IconManager
for an overflow-menu
Constructor Detail |
---|
protected DockUI()
Method Detail |
---|
public static DockUI getDefaultDockUI()
protected void updateUI()
LookAndFeel
changed.
public ThemeFactory getDefaultTheme()
DockController
s when
nothing else is specified.
public ThemeFactory[] getThemes()
public <T extends DockTheme> void registerTheme(Class<T> theme, ResourceBundle bundle)
theme
.
T
- the type of the DockTheme
.theme
- A class which must have the annotation
ThemeProperties
bundle
- The ResourceBundle
that should be used to read
name and description. This argument can be null
, in that
case the bundle of this DockUI will be used.public void registerTheme(ThemeFactory factory)
factory
- the new themepublic void unregisterTheme(ThemeFactory factory)
factory
- the factory to removepublic void registerColors(String lookAndFeelClassNameRegex, LookAndFeelColors colors)
LookAndFeelColors
. The lookAndFeelClassNameRegex
is a regular expression. If a LookAndFeel
is active whose class name
matches
lookAndFeelClassNameRegex
,
then colors
becomes the selected source for colors. If more
then one regex matches, the last one that was added to this DockUI
is taken. So generally one would first add the most general regexes, and
the more detailed ones later.
lookAndFeelClassNameRegex
- a description of a class namecolors
- the new set of colorspublic void addLookAndFeelColorsListener(LookAndFeelColorsListener listener)
LookAndFeelColors
changes. This listener gets not informed
about any changes when the LookAndFeel
itself gets replaced.
This listener will automatically be transfered when another
LookAndFeelColors
gets selected.
listener
- the new listener, not null
public void removeLookAndFeelColorsListener(LookAndFeelColorsListener listener)
DockUI
.
listener
- the listener to removeprotected void updateLookAndFeelColors()
LookAndFeelColors
to the best
matching colors.
protected LookAndFeelColors selectBestMatchingColors()
LookAndFeelColors
which matches the current
LookAndFeel
best.
public LookAndFeelColors getColors()
LookAndFeel
.
public static Color getColor(String key)
key
where key
is one of
the keys specified in LookAndFeelColors
.
key
- the name of the color
null
public ResourceBundle getBundle()
public String getString(String key)
bundle
.
key
- the key of the string
public void setLocale(Locale locale)
ResourceBundle
should be loaded.
locale
- the new locale, not null
public Locale getLocale()
Locale
for which the ResourceBundle
was loaded.
null
public void addLocaleListener(LocaleListener listener)
LocaleListener
.
listener
- the new listener, not null
public void removeLocaleListener(LocaleListener listener)
listener
from this DockUI
.
listener
- the listener to removepublic void setBundle(ResourceBundle bundle)
bundle
- the bundle@Deprecated public void setBundle(Locale locale)
setLocale(Locale)
locale
- the language of the DockUIpublic Icon getIcon(String key)
key
. The keys are stored in
a file "icons.ini" in the directory "data".
key
- the key for the icon
null
public void setIcon(String key, Icon icon)
key
- the keyicon
- the icon to return if getIcon(String)
is invokedpublic void fillIcons(IconManager manager)
manager
- the manager to fillpublic static StationPaint getPaint(StationPaint paint, DockStation station)
StationPaint
for station
.
paint
- a default value, may be null
station
- the station for which a paint is searched
paint
or another StationPaint, not null
public static DisplayerFactory getDisplayerFactory(DisplayerFactory factory, DockStation station)
DisplayerFactory
for station
.
factory
- a default value, may be null
station
- the station for which a factory is searched
factory
or another DisplayerFactory, not null
public static Combiner getCombiner(Combiner combiner, DockStation station)
Combiner
for station
.
combiner
- a default value, may be null
station
- the station for which a combiner is searched
combiner
or another Combiner, not null
public static <D extends DockStation,L> void updateTheme(D station, DockFactory<D,L> factory) throws IOException
station
and then adds
the children again. Reading the children ensures that all components are
build up again with the current theme of the station
D
- the type of the stationL
- the type of the layout needed to describe the contents
of the stationstation
- the station to updatefactory
- a factory used to remove and to add the elements
IOException
- if the factory throws an exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |