Class Options
java.lang.Object
org.pushingpixels.substance.internal.contrib.jgoodies.looks.Options
Provides access to several optional properties for the JGoodies L&Fs,
either by a key to the
UIDefaults
table or via a method or both.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
A client property key for JTabbedPanes that indicates that tabs are painted with a special embedded appearance.static final String
Deprecated.static final String
static final String
Hint for the style: Single or Both, seeHeaderStyle
.static final String
Hint that the scroll pane border should be etched.static final String
Hint that the button margin should be narrow.static final String
static final String
static final String
A client property key for JTabbedPanes that indicates that no content border shall be painted.static final String
Hint that the menu items in the menu have no icons.static final String
static final String
static final String
static final String
static final String
static final String
A client property value for JTrees that indicates that lines shall be drawn.static final String
A client property key for JTrees.static final String
A client property value for JTrees that indicates that lines shall be hidden.static final String
static final String
static final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Returns the class name for a cross-platformLookAndFeel
.static Dimension
Returns the default icon size that is used in menus, menu items and toolbars.static FontSizeHints
Returns the globalFontSizeHints
that can be overriden by a look-specific setting.static String
getReplacementClassNameFor
(String className) Returns the class name that can be used to replace the specifiedLookAndFeel
class name.static String
Returns the class name for a system specificLookAndFeel
.static boolean
Checks and answers if we shall use narrow button margins of 4 pixels.static boolean
Returns whether a hint is set in the UIManager that indicates, that a look&feel may use the native system fonts.static void
Initializes some default class name replacements, that replace Sun's Java look and feel, and Sun's Windows look and feel by the appropriate JGoodies replacements.static boolean
Checks and answers whether popup drop shadows are active.static boolean
Checks and answers whether the optional drop shadows for PopupMenus are enabled or disabled.static boolean
Checks and answers if we shall use icons in JTabbedPanes.static void
putLookAndFeelReplacement
(String original, String replacement) Puts a replacement name for a givenLookAndFeel
class name in the list of all look and feel replacements.static void
removeLookAndFeelReplacement
(String original) Removes a replacement name for a givenLookAndFeel
class name from the list of all look and feel replacements.static void
setDefaultIconSize
(Dimension defaultIconSize) Sets the default icon size.static void
Sets the globalFontSizeHints
.static void
setPopupDropShadowEnabled
(boolean b) Enables or disables drop shadows in PopupMenus.static void
setTabIconsEnabled
(boolean b) Enables or disables the use of icons in JTabbedPanes.static void
setUseNarrowButtons
(boolean b) Sets if we use narrow or standard button margins.static void
setUseSystemFonts
(boolean useSystemFonts) Sets a value in the UIManager to indicate, that a look&feel may use the native system fonts.
-
Field Details
-
PLASTIC_NAME
- See Also:
-
PLASTIC3D_NAME
- See Also:
-
PLASTICXP_NAME
- See Also:
-
JGOODIES_WINDOWS_NAME
- See Also:
-
EXT_WINDOWS_NAME
Deprecated.Replaced byJGOODIES_WINDOWS_NAME
.This outdated constant will be removed in the Looks version 1.4.- See Also:
-
DEFAULT_LOOK_NAME
- See Also:
-
MENU_FONT_KEY
- See Also:
-
CONTROL_FONT_KEY
- See Also:
-
FONT_SIZE_HINTS_KEY
- See Also:
-
USE_SYSTEM_FONTS_KEY
- See Also:
-
USE_SYSTEM_FONTS_APP_KEY
- See Also:
-
DEFAULT_ICON_SIZE_KEY
- See Also:
-
USE_NARROW_BUTTONS_KEY
- See Also:
-
TAB_ICONS_ENABLED_KEY
- See Also:
-
POPUP_DROP_SHADOW_ENABLED_KEY
- See Also:
-
IS_NARROW_KEY
Hint that the button margin should be narrow.- See Also:
-
IS_ETCHED_KEY
Hint that the scroll pane border should be etched.- See Also:
-
HEADER_STYLE_KEY
Hint for the style: Single or Both, seeHeaderStyle
.- See Also:
-
NO_ICONS_KEY
Hint that the menu items in the menu have no icons.- See Also:
-
TREE_LINE_STYLE_KEY
A client property key for JTrees. Used with the angled and none style values.- See Also:
-
TREE_LINE_STYLE_ANGLED_VALUE
A client property value for JTrees that indicates that lines shall be drawn.- See Also:
-
TREE_LINE_STYLE_NONE_VALUE
A client property value for JTrees that indicates that lines shall be hidden.- See Also:
-
NO_CONTENT_BORDER_KEY
A client property key for JTabbedPanes that indicates that no content border shall be painted. Supported by the Plastic look&feel family. This effect will be achieved also if the EMBEDDED property is true.- See Also:
-
EMBEDDED_TABS_KEY
A client property key for JTabbedPanes that indicates that tabs are painted with a special embedded appearance. Supported by the Plastic look&feel family. This effect will be achieved also if the EMBEDDED property is true.- See Also:
-
-
Method Details
-
getUseSystemFonts
public static boolean getUseSystemFonts()Returns whether a hint is set in the UIManager that indicates, that a look&feel may use the native system fonts.- Returns:
- true if the UIManager indicates that system fonts shall be used
- See Also:
-
setUseSystemFonts
public static void setUseSystemFonts(boolean useSystemFonts) Sets a value in the UIManager to indicate, that a look&feel may use the native system fonts.- Parameters:
useSystemFonts
- true to enable system fonts in the UIManager- See Also:
-
getDefaultIconSize
Returns the default icon size that is used in menus, menu items and toolbars. Menu items that have no icon set are aligned using the default icon dimensions.- Returns:
- the dimension of the default icon
- See Also:
-
setDefaultIconSize
Sets the default icon size.- Parameters:
defaultIconSize
- the default icon size to set- See Also:
-
getGlobalFontSizeHints
Returns the globalFontSizeHints
that can be overriden by a look-specific setting.- Returns:
- the gobally used FontSizeHints object
- See Also:
-
setGlobalFontSizeHints
Sets the globalFontSizeHints
.- Parameters:
hints
- the FontSizeHints object to be used globally- See Also:
-
getUseNarrowButtons
public static boolean getUseNarrowButtons()Checks and answers if we shall use narrow button margins of 4 pixels. Sun's L&F implementations use a much wider button margin of 14 pixels, which leads to good button minimum width in the typical case.Using narrow button margins can potentially cause compatibility issues, so this feature must be switched on programmatically.
If you use narrow margin, you should take care of minimum button width, either by the layout management or appropriate ButtonUI minimum widths.
- Returns:
- true if all buttons shall use narrow margins
- See Also:
-
setUseNarrowButtons
public static void setUseNarrowButtons(boolean b) Sets if we use narrow or standard button margins.- Parameters:
b
- true to use narrow button margins globally- See Also:
-
isTabIconsEnabled
public static boolean isTabIconsEnabled()Checks and answers if we shall use icons in JTabbedPanes. By default, tab icons are enabled. If the user has set a system property, we log a message about the choosen style.- Returns:
- true if icons in tabbed panes are enabled, false if disabled
- See Also:
-
setTabIconsEnabled
public static void setTabIconsEnabled(boolean b) Enables or disables the use of icons in JTabbedPanes.- Parameters:
b
- true to enable icons in tabbed panes, false to disable them- See Also:
-
isPopupDropShadowActive
public static boolean isPopupDropShadowActive()Checks and answers whether popup drop shadows are active. This feature shall be inactive with toolkits that use native drop shadows, such as Aqua on the Mac OS X. It is also inactive if the ShadowPopup cannot snapshot the desktop background (due to security and AWT exceptions). Otherwise the feature's enablement state is returned.Currently only the Mac OS X is detected as platform where the toolkit uses native drop shadows.
- Returns:
- true if drop shadows are active, false if inactive
- See Also:
-
isPopupDropShadowEnabled
public static boolean isPopupDropShadowEnabled()Checks and answers whether the optional drop shadows for PopupMenus are enabled or disabled.- Returns:
- true if drop shadows are enabled, false if disabled
- See Also:
-
setPopupDropShadowEnabled
public static void setPopupDropShadowEnabled(boolean b) Enables or disables drop shadows in PopupMenus. Note that drop shadows are always inactive on platforms that provide native drop shadows such as the Mac OS X.It is recommended to enable this feature only on platforms that accelerate translucency and snapshots with the hardware.
- Parameters:
b
- true to enable drop shadows, false to disable them- See Also:
-
putLookAndFeelReplacement
Puts a replacement name for a givenLookAndFeel
class name in the list of all look and feel replacements.- Parameters:
original
- the name of the look-and-feel to replacereplacement
- the name of the replacement look-and-feel- See Also:
-
removeLookAndFeelReplacement
Removes a replacement name for a givenLookAndFeel
class name from the list of all look and feel replacements.- Parameters:
original
- the name of the look-and-feel that has been replaced- See Also:
-
initializeDefaultReplacements
public static void initializeDefaultReplacements()Initializes some default class name replacements, that replace Sun's Java look and feel, and Sun's Windows look and feel by the appropriate JGoodies replacements. -
getReplacementClassNameFor
Returns the class name that can be used to replace the specifiedLookAndFeel
class name.- Parameters:
className
- the name of the look-and-feel class- Returns:
- the name of the suggested replacement class
- See Also:
-
getCrossPlatformLookAndFeelClassName
Returns the class name for a cross-platformLookAndFeel
.- Returns:
- the name of a cross platform look-and-feel class
- See Also:
-
getSystemLookAndFeelClassName
Returns the class name for a system specificLookAndFeel
.- Returns:
- the name of the system look-and-feel class
- See Also:
-
JGOODIES_WINDOWS_NAME
.