Package bibliothek.gui.dock.common
Class FontMap
java.lang.Object
bibliothek.gui.dock.common.FontMap
A map containing
FontModifiers. Each FontMap is associated
with exactly one CDockable. This map is used to set the font
of various elements like titles or tabs. Changes in the map will
immediately be forwarded and applied.- Author:
- Benjamin Sigg
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringkey for font used on the button for a minimized dockablestatic final Stringkey for font used on the focused button for a minimized dockablestatic final Stringkey for font used on a tabstatic final Stringkey for font used on a focused tabstatic final Stringkey for font used on a selected tabstatic final Stringkey for font used in titlesstatic final Stringkey for font used in titles if the title is focused -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(FontMapListener listener) Adds a listener to this map.Gets the owner of this map.Gets the font which is associated withkey.voidremoveFont(String key) Ensures that the original font is used forkeyvoidremoveListener(FontMapListener listener) Removeslistenerfrom this map.voidsetFont(String key, FontModifier font) Sets the font forkey.voidSets the font which should be used forkey.voidTells to use a font that is derived from the original font ofkey.
-
Field Details
-
FONT_KEY_TITLE
key for font used in titles- See Also:
-
FONT_KEY_TITLE_FOCUSED
key for font used in titles if the title is focused- See Also:
-
FONT_KEY_MINIMIZED_BUTTON
key for font used on the button for a minimized dockable- See Also:
-
FONT_KEY_MINIMIZED_BUTTON_FOCUSED
key for font used on the focused button for a minimized dockable- See Also:
-
FONT_KEY_TAB
key for font used on a tab- See Also:
-
FONT_KEY_TAB_SELECTED
key for font used on a selected tab- See Also:
-
FONT_KEY_TAB_FOCUSED
key for font used on a focused tab- See Also:
-
-
Constructor Details
-
FontMap
Creates a new map- Parameters:
dockable- the owner of this map
-
-
Method Details
-
getDockable
Gets the owner of this map.- Returns:
- the owner
-
addListener
Adds a listener to this map.- Parameters:
listener- the new listener
-
removeListener
Removeslistenerfrom this map.- Parameters:
listener- the listener to remove
-
getFont
Gets the font which is associated withkey.- Parameters:
key- the key of the font- Returns:
- the font or
null
-
setFont
Sets the font which should be used forkey.- Parameters:
key- the key of the fontfont- the new font, can benull
-
setFont
Tells to use a font that is derived from the original font ofkey. There are different modifications possible, all have to be supplied in the same form:key=value.
Example:setFont( x, "i=!", "b=+", s=14" );would create a modification that reverses the italic flag, sets any font to bold and creates only fonts of size 14- 'i': italic
- '+': make the font italic
- '-': make the font not italic
- '!': reverse the italic property of the font
- 'b': bold
- '+': make the font bold
- '-': make the font not bold
- '!': reverse the bold property of the font
- 's': size
- '+number': increase the size by
number - '-number': decrease the size by
number - 'number': set the size to
number
- '+number': increase the size by
- Parameters:
key- the key for the fontmodifications- a set of modifications
- 'i': italic
-
removeFont
Ensures that the original font is used forkey- Parameters:
key- the key which should no longer use a modified font
-
setFont
Sets the font forkey.- Parameters:
key- the key of the fontfont- the new value ornullto set the default value
-