|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.DockUI
public class DockUI
A list of icons, text and methods used by the framework.
Field Summary | |
---|---|
static java.lang.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 |
addLookAndFeelColorsListener(LookAndFeelColorsListener listener)
Adds a listener which gets informed when a color of the current LookAndFeelColors changes. |
|
static java.awt.Color |
getColor(java.lang.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)
Deprecated. this method is no longer used, clients should use the ThemeManager to retrieve such resources |
|
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 javax.swing.JDesktopPane |
getDesktopPane(java.awt.Component component)
Searches the first JDesktopPane which either is component
or a parent of component . |
|
static DisplayerFactory |
getDisplayerFactory(DisplayerFactory factory,
DockStation station)
Deprecated. this method is no longer used, clients should use the ThemeManager to retrieve such resources |
|
static StationPaint |
getPaint(StationPaint paint,
DockStation station)
Deprecated. since the ThemeManager exists, this method should no longer be used. Instead an
UIValue should be registered at the ThemeManager , see DefaultStationPaintValue . |
|
ThemeFactory[] |
getThemes()
Gets the list of all available themes. |
|
static boolean |
isOverlapping(java.awt.Component above,
java.awt.Component under)
Tells whether above overlaps under . |
|
boolean |
isSecureEnvironment()
Tells whether this application runs in a restricted environment or not. |
|
void |
registerColors(java.lang.String lookAndFeelClassNameRegex,
LookAndFeelColors colors)
Registeres a new LookAndFeelColors . |
|
|
registerTheme(java.lang.Class<T> theme)
Registers a factory for theme . |
|
void |
registerTheme(ThemeFactory factory)
Stores a new theme. |
|
void |
removeLookAndFeelColorsListener(LookAndFeelColorsListener listener)
Removes a listener from this DockUI . |
|
protected LookAndFeelColors |
selectBestMatchingColors()
Gets the LookAndFeelColors which matches the current
LookAndFeel best. |
|
void |
setSecureEnvironment(boolean secureEnvironment)
Overrides the result of isSecureEnvironment() , any future call of that method will
return secureEnvironment . |
|
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_1, 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 java.lang.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(java.lang.Class<T> theme)
theme
.
T
- the type of the DockTheme
.theme
- A class which must have the annotation
ThemeProperties
public void registerTheme(ThemeFactory factory)
factory
- the new themepublic void unregisterTheme(ThemeFactory factory)
factory
- the factory to removepublic void registerColors(java.lang.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 java.awt.Color getColor(java.lang.String key)
key
where key
is one of
the keys specified in LookAndFeelColors
.
key
- the name of the color
null
@Deprecated @Todo(compatibility=BREAK_MINOR, priority=ENHANCEMENT, target=VERSION_1_1_1, description="remove this methode") public static StationPaint getPaint(StationPaint paint, DockStation station)
ThemeManager
exists, this method should no longer be used. Instead an
UIValue
should be registered at the ThemeManager
, see DefaultStationPaintValue
.
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
@Deprecated @Todo(compatibility=BREAK_MINOR, priority=ENHANCEMENT, target=VERSION_1_1_1, description="remove this methode") public static DisplayerFactory getDisplayerFactory(DisplayerFactory factory, DockStation station)
ThemeManager
to retrieve such resources
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
@Deprecated @Todo(compatibility=BREAK_MINOR, priority=ENHANCEMENT, target=VERSION_1_1_1, description="remove this methode") public static Combiner getCombiner(Combiner combiner, DockStation station)
ThemeManager
to retrieve such resources
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 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 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
java.io.IOException
- if the factory throws an exceptionpublic static javax.swing.JDesktopPane getDesktopPane(java.awt.Component component)
JDesktopPane
which either is component
or a parent of component
.
component
- the component whose parent is searched
JDesktopPane
or null
if not foundpublic static boolean isOverlapping(java.awt.Component above, java.awt.Component under)
above
overlaps under
. This method
assumes that both components have a mutual parent. The method checks the location
and the z-order of both components.
above
- the component that is supposed to be above under
under
- the component that is supposed to be under above
true
is above
is overlapping under
public boolean isSecureEnvironment()
public void setSecureEnvironment(boolean secureEnvironment)
isSecureEnvironment()
, any future call of that method will
return secureEnvironment
.
secureEnvironment
- Whether global AWTEventListener
s are allowed or not, a value of true
indicates that listeners are not allowed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |