|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.DockUI
public class DockUI
A list of icons, text and methods used by the framework.
Field Summary | |
---|---|
private java.util.ResourceBundle |
bundle
The resource bundle for some text shown in this framework |
private java.util.Map<java.lang.String,javax.swing.Icon> |
icons
The icons used in this framework |
private java.util.List<ThemeFactory> |
themes
A list of all available themes |
private static DockUI |
ui
An instance of DockUI |
Constructor Summary | |
---|---|
protected |
DockUI()
Creates a new DockUI |
Method Summary | ||
---|---|---|
void |
fillIcons(IconManager manager)
Fills all known icons as default-icons into the given manager. |
|
java.util.ResourceBundle |
getBundle()
Gets the local resource bundle. |
|
static Combiner |
getCombiner(Combiner combiner,
DockStation station)
Gets a Combiner for station . |
|
static DockUI |
getDefaultDockUI()
Gets the default instance of DockUI. |
|
static DisplayerFactory |
getDisplayerFactory(DisplayerFactory factory,
DockStation station)
Gets a DisplayerFactory for station . |
|
javax.swing.Icon |
getIcon(java.lang.String key)
Gets the icon stored under key . |
|
static StationPaint |
getPaint(StationPaint paint,
DockStation station)
Gets a StationPaint for station . |
|
java.lang.String |
getString(java.lang.String key)
Gets a string of the current bundle . |
|
ThemeFactory[] |
getThemes()
Gets the list of all available themes. |
|
protected java.util.Map<java.lang.String,java.lang.String> |
loadKeyPathMapping()
Gets a map containing keys and path for icon. |
|
void |
registerTheme(java.lang.Class<? extends DockTheme> theme,
java.util.ResourceBundle bundle)
Registers a factory for theme . |
|
void |
registerTheme(ThemeFactory factory)
Stores a new theme. |
|
private void |
registerThemes()
|
|
void |
setBundle(java.util.Locale locale)
Replaces the bundle of this DockUI using the given Locale |
|
void |
setBundle(java.util.ResourceBundle bundle)
Sets the resource bundle which should be used. |
|
void |
setIcon(java.lang.String key,
javax.swing.Icon icon)
Sets the icon that is used for a certain key. |
|
static
|
updateTheme(D station,
DockFactory<? super D> factory)
Removes all children of station and then adds
the children again. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static DockUI ui
private java.util.ResourceBundle bundle
private java.util.Map<java.lang.String,javax.swing.Icon> icons
private java.util.List<ThemeFactory> themes
Constructor Detail |
---|
protected DockUI()
Method Detail |
---|
public static DockUI getDefaultDockUI()
private void registerThemes()
public ThemeFactory[] getThemes()
public void registerTheme(java.lang.Class<? extends DockTheme> theme, java.util.ResourceBundle bundle)
theme
.
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 java.util.ResourceBundle getBundle()
public java.lang.String getString(java.lang.String key)
bundle
.
key
- the key of the string
public void setBundle(java.util.ResourceBundle bundle)
bundle
- the bundlepublic void setBundle(java.util.Locale locale)
locale
- the language of the DockUIpublic javax.swing.Icon getIcon(java.lang.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(java.lang.String key, javax.swing.Icon icon)
key
- the keyicon
- the icon to return if getIcon(String)
is invokedprotected java.util.Map<java.lang.String,java.lang.String> loadKeyPathMapping()
public 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> void updateTheme(D station, DockFactory<? super D> factory) throws java.io.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 stationstation
- the station to updatefactory
- a factory used to remove and to add the elements
java.io.IOException
- if the factory throws an exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |