|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.LookAndFeel
javax.swing.plaf.basic.BasicLookAndFeel
javax.swing.plaf.synth.SynthLookAndFeel
de.javasoft.plaf.synthetica.SyntheticaLookAndFeel
public abstract class SyntheticaLookAndFeel
Synthetica's base Look and Feel.
| Nested Class Summary | |
|---|---|
static class |
SyntheticaLookAndFeel.JVMCompatibilityMode
|
| Field Summary | |
|---|---|
static java.util.logging.Logger |
logger
|
| Constructor Summary | |
|---|---|
SyntheticaLookAndFeel()
Constructor. |
|
SyntheticaLookAndFeel(java.lang.String fileName)
Constructor. |
|
| Method Summary | ||
|---|---|---|
static javax.swing.plaf.synth.SynthContext |
createContext(javax.swing.JComponent c,
javax.swing.plaf.synth.Region region,
int state)
|
|
static java.awt.Paint |
createLinearGradientPaint(float startX,
float startY,
float endX,
float endY,
float[] fractions,
java.awt.Color[] colors)
Convenient method to create a LinearGradientPaint for Java 1.5 and Java 6. |
|
static java.awt.Component |
findComponent(java.lang.Class<?> childClass,
java.awt.Container container)
Convenient method to find a child component within the specified container. |
|
static java.awt.Component |
findComponent(java.lang.String name,
java.awt.Container container)
Convenient method to find a child component within the specified container. |
|
static
|
findComponents(java.lang.Class<T> childClass,
java.awt.Container container,
java.util.List<T> components)
Convenient method to find all child components within the specified container. |
|
static
|
findComponents(java.lang.String name,
java.awt.Container container,
java.util.List<T> components)
Convenient method to find all child components within the specified container. |
|
static javax.swing.border.Border |
findDefaultBorder(javax.swing.border.Border b)
Convenient method to check if a border contains a default (UIResource) border. |
|
static
|
findOpaqueParentOfClass(java.lang.Class<T> clazz,
java.awt.Container c,
boolean respectOpacity)
Returns the first opaque ancestor of the given type. |
|
static java.lang.Object |
get(java.lang.String key,
java.awt.Component c)
Returns an object from the defaults table with respect to components name. |
|
static java.lang.Object |
get(java.lang.String key,
java.lang.String name)
Returns an object from the defaults table with respect to component name. |
|
static java.lang.Object |
get(java.lang.String propertyKey,
java.lang.String propertyName,
java.lang.String componentName,
boolean fallback)
Checks UIManager for the created DefaultsProperty. |
|
static boolean |
getAntiAliasEnabled()
Getter for anti-alias. |
|
static boolean |
getBoolean(java.lang.String key,
java.awt.Component c)
Returns a boolean value from the defaults table in respect of the component name. |
|
static boolean |
getBoolean(java.lang.String key,
java.awt.Component c,
boolean defaultValue)
Returns a boolean value from the defaults table in respect of the component name. |
|
static
|
getClientProperty(java.lang.String key,
javax.swing.JComponent c,
T defaultValue)
Returns client property value of the specified component. |
|
static java.awt.Color |
getColor(java.lang.String key,
java.awt.Component c)
Returns a color object from the defaults table in respect of the component name. |
|
static java.awt.Color |
getColor(java.lang.String key,
java.awt.Component c,
java.awt.Color defaultColor)
Returns a color object from the defaults table in respect of the component name. |
|
java.lang.String |
getConfigFileName()
Returns the XML file name which was used to initialize this LAF. |
|
javax.swing.UIDefaults |
getDefaults()
Overwrites the LAF#getDefaults method to set the metal FileChooserUI for Synthetica. |
|
static boolean |
getDefaultsCompatibilityMode()
Getter for defaultsCompatibilityMode option. |
|
java.lang.String |
getDescription()
|
|
static java.awt.Dimension |
getDim(java.lang.String key,
java.awt.Component c)
Returns Dimension from the defaults table in respect of the component name. |
|
static java.awt.Dimension |
getDim(java.lang.String key,
java.awt.Component c,
java.awt.Dimension defaultValue)
Returns Dimension from the defaults table in respect of the component name. |
|
javax.swing.Icon |
getDisabledIcon(javax.swing.JComponent c,
javax.swing.Icon icon)
|
|
static boolean |
getExtendedFileChooserEnabled()
Getter for extendedFileChooser option. |
|
static java.awt.Font |
getFont()
Getter for default font. |
|
static java.lang.String |
getFontName()
Getter for fontName. |
|
static int |
getFontSize()
Getter for fontSize. |
|
static javax.swing.Icon |
getIcon(java.lang.String key,
java.awt.Component c)
Returns an icon object from the defaults table in respect of the component name. |
|
abstract java.lang.String |
getID()
|
|
static java.awt.Insets |
getInsets(java.lang.String key,
java.awt.Component c)
Returns an insets object from the defaults table in respect of the component name. |
|
static java.awt.Insets |
getInsets(java.lang.String key,
java.awt.Component c,
boolean nullAllowed)
Returns an insets object from the defaults table in respect of the component name. |
|
static java.awt.Insets |
getInsets(java.lang.String key,
java.awt.Component c,
java.awt.Insets defaultValue)
Returns an insets object from the defaults table in respect of the component name. |
|
static java.awt.Insets |
getInsets(java.lang.String propertyKey,
java.lang.String propertyName,
java.lang.String componentName,
boolean fallback)
|
|
static int |
getInt(java.lang.String key,
java.awt.Component c)
Returns an int value from the defaults table in respect of the component name. |
|
static int |
getInt(java.lang.String key,
java.awt.Component c,
int defaultValue)
Returns an int value from the defaults table in respect of the component name. |
|
static int |
getInt(java.lang.String propertyKey,
java.lang.String propertyName,
java.lang.String componentName,
boolean fallback,
int defaultValue)
|
|
static SyntheticaLookAndFeel.JVMCompatibilityMode |
getJVMCompatibilityMode()
Returns the active JVM compatibility mode used by Synthetica. |
|
abstract java.lang.String |
getName()
|
|
static boolean |
getRememberFileChooserPreferences()
Getter for rememberFileChooserPreferences option. |
|
static java.lang.String |
getString(java.lang.String key,
java.awt.Component c)
Returns a string object from the defaults table in respect of the component name. |
|
static java.lang.String |
getString(java.lang.String propertyKey,
java.lang.String propertyName,
java.lang.String componentName,
boolean fallback)
|
|
static java.lang.String |
getStyleName(java.awt.Component c)
Static utility methods. |
|
boolean |
getSupportsWindowDecorations()
|
|
IVersion |
getSyntheticaVersion()
Returns Synthetica's core version information. |
|
static java.awt.Dimension |
getToolbarSeparatorDimension()
Getter for toolbar separator dimension. |
|
static boolean |
getUseSystemFileIcons()
Getter for useSystemFileIcons. |
|
IVersion |
getVersion()
Returns version info of the currently active Synthetica theme. |
|
void |
initialize()
Overwrites the LAF#initialize method to install Synthetica's styleFactory and popupFactory. |
|
protected void |
installCompatibilityDefaults()
Some applications need certain DefaultProperties to initialize their own components. |
|
protected void |
installSyntheticaDefaults()
|
|
static boolean |
isOpaque(javax.swing.JComponent c)
Convenient method to check Synthetica component opacity ("Synthetica.opaque" key) with respect of "Synthetica.textComponents.useSwingOpaqueness". |
|
static boolean |
isSystemPropertySet(java.lang.String systemPropertyName)
|
|
static boolean |
isSystemPropertySet(java.lang.String systemPropertyName,
java.lang.String value)
|
|
static boolean |
isToplevelPopupMenu(javax.swing.JPopupMenu popup)
Returns true if toplevel popup menu handling is enabled and the invoker is a toplevel JMenu (or marked by client property "Synthetica.menu.toplevel") or popup is marked as toplevel popup by client property "Synthetica.popupMenu.toplevel". |
|
static boolean |
isWindowOpacityEnabled(java.awt.Window w)
Helper method to check if window opacity support "Synthetica.window.opaque" is enabled/disabled. |
|
static boolean |
isWindowShapeEnabled(java.awt.Window w)
Helper method to check if window shape "Synthetica.window.shape" is enabled/disabled. |
|
static boolean |
isWindowShapeSupported(java.awt.Window w)
Helper method to check if window shape support is provided by the JVM. |
|
protected void |
loadAddonsXMLConfig(java.lang.String path)
Load addons XML configuration files. |
|
protected void |
loadCustomXML()
Override to load custom config files via loadXMLConfig(String) |
|
static javax.swing.Icon |
loadIcon(java.lang.String key)
Loads an icon by UI property key. |
|
static javax.swing.Icon |
loadIcon(java.lang.String key,
java.awt.Component c)
Loads an icon by UI property key. |
|
protected void |
loadXMLConfig(java.lang.String fileName)
Loads XML configuration file. |
|
static boolean |
popupHasCheckRadio(javax.swing.JPopupMenu popup)
Convenient method to check if a popupMenu contains checkBox or radioButton menuItems. |
|
static boolean |
popupHasCheckRadioWithIcon(javax.swing.JPopupMenu popup)
Convenient method to check if a popupMenu contains checkBox or radioButton menuItems with icon. |
|
static boolean |
popupHasIcons(javax.swing.JPopupMenu popup)
Convenient method to check if a popupMenu contains menuItems with icons. |
|
static boolean |
preservePopupIconSpace(javax.swing.JPopupMenu popup)
Retruns true if a popup requires some extra space because of icon usage. |
|
static float |
scaleFontSize(float fontSize)
Calculates environment dependent font size - i. e. to respect current screen resolution. |
|
static void |
setAntiAliasEnabled(boolean value)
Setter for anti-alias. |
|
static void |
setChildrenName(java.awt.Container container,
java.lang.String oldName,
java.lang.String newName)
Convenient method to change the style names of child components within the specified container. |
|
static void |
setChildrenOpaque(java.awt.Container container,
boolean opaque)
Convenient method to change opaqueness for a component child components. |
|
static void |
setDefaultsCompatibilityMode(boolean value)
Setter for defaultsCompatibilityMode. |
|
static void |
setExtendedFileChooserEnabled(boolean value)
Setter for extendedFileChooser option. |
|
static void |
setFont(java.awt.Font font)
Setter for default font - respects scale factor UI-property. |
|
static void |
setFont(java.awt.Font font,
boolean respectScaleFactor)
Setter for default font. |
|
static void |
setFont(java.lang.String name,
int size)
Override the xml default font with the specified. |
|
static void |
setLookAndFeel(java.lang.String lookAndFeelClassName)
Convenient method for setting a look and feel. |
|
static void |
setLookAndFeel(java.lang.String lookAndFeelClassName,
boolean antiAlias,
boolean useScreenMenuBar)
Convenient method for setting a look and feel. |
|
static void |
setRememberFileChooserPreferences(boolean value)
Setter for rememberFileChooserPreferences option. |
|
static void |
setToolbarSeparatorDimension(java.awt.Dimension dim)
Setter for toolbar separator dimension. |
|
static void |
setUseSystemFileIcons(boolean value)
Setter for useSystemFileIcons. |
|
static void |
setWindowOpaque(java.awt.Window w,
boolean opaque)
Helper method to modify window opacity. |
|
static void |
setWindowsDecorated(boolean decorated)
Setter for decorated windows. |
|
protected boolean |
shouldUpdateStyleOnEvent(java.beans.PropertyChangeEvent evt)
|
|
void |
uninitialize()
Override the LAF#uninitialize method to uninstall Synthetica's component settings and defaults. |
|
static void |
updateWindowShape(java.awt.Window w)
Helper method to modify window shape. |
|
static java.awt.Rectangle |
validateWindowBounds(java.awt.Rectangle windowBounds)
Checks if the specified window bounds are valid for the current environment (i.e. multi-screen). |
|
static boolean |
windowIsFullScreen(java.awt.Window w)
|
|
| Methods inherited from class javax.swing.plaf.synth.SynthLookAndFeel |
|---|
createUI, getRegion, getStyle, getStyleFactory, isNativeLookAndFeel, isSupportedLookAndFeel, load, load, setStyleFactory, shouldUpdateStyleOnAncestorChanged, updateStyles |
| Methods inherited from class javax.swing.plaf.basic.BasicLookAndFeel |
|---|
createAudioAction, getAudioActionMap, initClassDefaults, initComponentDefaults, initSystemColorDefaults, loadSystemColors, playSound |
| Methods inherited from class javax.swing.LookAndFeel |
|---|
getDesktopPropertyValue, getDisabledSelectedIcon, getLayoutStyle, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninstallBorder |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.logging.Logger logger
| Constructor Detail |
|---|
public SyntheticaLookAndFeel()
throws java.text.ParseException
java.text.ParseException
public SyntheticaLookAndFeel(java.lang.String fileName)
throws java.text.ParseException
fileName - Name of XML file with relative path to this package,
or absolute path.
java.text.ParseException| Method Detail |
|---|
public java.lang.String getConfigFileName()
protected void loadCustomXML()
throws java.text.ParseException
loadXMLConfig(String)
java.text.ParseException
protected void loadAddonsXMLConfig(java.lang.String path)
throws java.text.ParseException
java.text.ParseException
protected void loadXMLConfig(java.lang.String fileName)
throws java.text.ParseException
fileName - Name of XML file with relative path to this package,
or absolute path.
java.text.ParseExceptionpublic abstract java.lang.String getID()
getID in class javax.swing.plaf.synth.SynthLookAndFeelpublic abstract java.lang.String getName()
getName in class javax.swing.plaf.synth.SynthLookAndFeelpublic java.lang.String getDescription()
getDescription in class javax.swing.plaf.synth.SynthLookAndFeelpublic IVersion getVersion()
getSyntheticaVersion()public boolean getSupportsWindowDecorations()
getSupportsWindowDecorations in class javax.swing.LookAndFeelpublic javax.swing.UIDefaults getDefaults()
getDefaults in class javax.swing.plaf.synth.SynthLookAndFeelpublic void initialize()
initialize in class javax.swing.plaf.synth.SynthLookAndFeelprotected void installSyntheticaDefaults()
protected void installCompatibilityDefaults()
public void uninitialize()
uninitialize in class javax.swing.plaf.synth.SynthLookAndFeelprotected boolean shouldUpdateStyleOnEvent(java.beans.PropertyChangeEvent evt)
public static javax.swing.plaf.synth.SynthContext createContext(javax.swing.JComponent c,
javax.swing.plaf.synth.Region region,
int state)
public static void setFont(java.lang.String name,
int size)
name - the font namesize - the font sizepublic static void setFont(java.awt.Font font)
setFont(Font, boolean)
public static void setFont(java.awt.Font font,
boolean respectScaleFactor)
public static java.awt.Font getFont()
public static java.lang.String getFontName()
public static int getFontSize()
public static boolean getAntiAliasEnabled()
public static void setAntiAliasEnabled(boolean value)
setLookAndFeel(String, boolean, boolean) instead.
setLookAndFeel(String, boolean, boolean)public static void setWindowsDecorated(boolean decorated)
public static boolean getExtendedFileChooserEnabled()
public static void setExtendedFileChooserEnabled(boolean value)
public javax.swing.Icon getDisabledIcon(javax.swing.JComponent c,
javax.swing.Icon icon)
getDisabledIcon in class javax.swing.LookAndFeelpublic static boolean getRememberFileChooserPreferences()
public static void setRememberFileChooserPreferences(boolean value)
public static boolean getUseSystemFileIcons()
public static void setUseSystemFileIcons(boolean value)
public static void setDefaultsCompatibilityMode(boolean value)
public static boolean getDefaultsCompatibilityMode()
public static void setToolbarSeparatorDimension(java.awt.Dimension dim)
public static java.awt.Dimension getToolbarSeparatorDimension()
public IVersion getSyntheticaVersion()
getVersion()public static java.lang.String getStyleName(java.awt.Component c)
public static SyntheticaLookAndFeel.JVMCompatibilityMode getJVMCompatibilityMode()
public static <T> T getClientProperty(java.lang.String key,
javax.swing.JComponent c,
T defaultValue)
key - Client property key.c - The component.defaultValue - Default value if key does not exist.JComponent.getClientProperty(Object)public static javax.swing.Icon loadIcon(java.lang.String key)
key - The UI-key.
public static javax.swing.Icon loadIcon(java.lang.String key,
java.awt.Component c)
key - The UI-key.c - The relevant component.
public static java.lang.Object get(java.lang.String propertyKey,
java.lang.String propertyName,
java.lang.String componentName,
boolean fallback)
propertyKey - Component specific property key without "Synthetica." prefix, e.g. "button", "checkBox", "focus.button".propertyName - Name of the wanted property e.g. "insets", "animation.delay". Can be null.componentName - Name of the component. Can be null.fallback - Check propertyKey hierarchy for valid values.UIManager.get(Object key)
public static java.lang.String getString(java.lang.String propertyKey,
java.lang.String propertyName,
java.lang.String componentName,
boolean fallback)
public static java.awt.Insets getInsets(java.lang.String propertyKey,
java.lang.String propertyName,
java.lang.String componentName,
boolean fallback)
public static int getInt(java.lang.String propertyKey,
java.lang.String propertyName,
java.lang.String componentName,
boolean fallback,
int defaultValue)
public static java.lang.Object get(java.lang.String key,
java.awt.Component c)
UIManager.get(Object key),
get(String propertyKey, String propertyName, String componentName, boolean fallback)
public static java.lang.Object get(java.lang.String key,
java.lang.String name)
UIManager.get(Object key),
get(String, Component),
get(String propertyKey, String propertyName, String componentName, boolean fallback)
public static boolean getBoolean(java.lang.String key,
java.awt.Component c)
get(String, Component)
public static boolean getBoolean(java.lang.String key,
java.awt.Component c,
boolean defaultValue)
key - Key.c - Component (name) used for lookup.defaultValue - Default value if key does not exist.get(String, Component)
public static int getInt(java.lang.String key,
java.awt.Component c)
get(String, Component)
public static int getInt(java.lang.String key,
java.awt.Component c,
int defaultValue)
key - Key.c - Component (name) used for lookup.defaultValue - Default value if key does not exist.get(String, Component)
public static java.awt.Dimension getDim(java.lang.String key,
java.awt.Component c)
get(String, Component)
public static java.awt.Dimension getDim(java.lang.String key,
java.awt.Component c,
java.awt.Dimension defaultValue)
key - Key.c - Component (name) used for lookup.defaultValue - Default value if key does not exist.get(String, Component)
public static java.awt.Insets getInsets(java.lang.String key,
java.awt.Component c)
get(String, Component)
public static java.awt.Insets getInsets(java.lang.String key,
java.awt.Component c,
boolean nullAllowed)
key - Key.c - Component (name) used for lookup.nullAllowed - False means do not return null if corresponding key object doesn't exist - instead a new Insets object (0,0,0,0) will be returned.get(String, Component)
public static java.awt.Insets getInsets(java.lang.String key,
java.awt.Component c,
java.awt.Insets defaultValue)
key - Key.c - Component (name) used for lookup.defaultValue - Default value if key does not exist.
public static java.lang.String getString(java.lang.String key,
java.awt.Component c)
get(String, Component)
public static java.awt.Color getColor(java.lang.String key,
java.awt.Component c)
get(String, Component)
public static java.awt.Color getColor(java.lang.String key,
java.awt.Component c,
java.awt.Color defaultColor)
key - Key.c - Component (name) used for lookup.defaultColor - Default value if key does not exist.get(String, Component)
public static javax.swing.Icon getIcon(java.lang.String key,
java.awt.Component c)
get(String, Component)public static boolean isToplevelPopupMenu(javax.swing.JPopupMenu popup)
popup - The popup menu.
public static <T extends javax.swing.JComponent> T findOpaqueParentOfClass(java.lang.Class<T> clazz,
java.awt.Container c,
boolean respectOpacity)
true.
The method returns null, if ancestor is opauqe
clazz - The requested parent class typec - The containerrespectOpacity - Additionally check Swing opacity
public static boolean isOpaque(javax.swing.JComponent c)
c - JComponent to check for opacity.
public static void setChildrenOpaque(java.awt.Container container,
boolean opaque)
container - Used container or JComponent.opaque - true - set child components to opaque.public static java.awt.Rectangle validateWindowBounds(java.awt.Rectangle windowBounds)
windowBounds - bounds to validate
public static boolean isWindowOpacityEnabled(java.awt.Window w)
w - Window to check for opacity.
public static void setWindowOpaque(java.awt.Window w,
boolean opaque)
w - Window.opaque - False means translucent.public static boolean isWindowShapeEnabled(java.awt.Window w)
w - Window to check for shape.
public static boolean isWindowShapeSupported(java.awt.Window w)
w - Window to check for shape.
public static void updateWindowShape(java.awt.Window w)
w - Window.public static boolean windowIsFullScreen(java.awt.Window w)
public static boolean isSystemPropertySet(java.lang.String systemPropertyName)
public static boolean isSystemPropertySet(java.lang.String systemPropertyName,
java.lang.String value)
public static float scaleFontSize(float fontSize)
fontSize - The regular font size.
public static void setChildrenName(java.awt.Container container,
java.lang.String oldName,
java.lang.String newName)
container - Used container or JComponent.oldName - Current name of the component.newName - New component name.
public static java.awt.Component findComponent(java.lang.String name,
java.awt.Container container)
name - Style name of the component.container - Used container or JComponent.
public static java.awt.Component findComponent(java.lang.Class<?> childClass,
java.awt.Container container)
childClass - Class of the searched child component.container - Used container or JComponent.
public static <T extends java.awt.Component> java.util.List<T> findComponents(java.lang.String name,
java.awt.Container container,
java.util.List<T> components)
name - Style name of the components to search for.container - Used container or JComponent.components - Resultlist used to return found components.
public static <T extends java.awt.Component> java.util.List<T> findComponents(java.lang.Class<T> childClass,
java.awt.Container container,
java.util.List<T> components)
childClass - Class of the searched child component.container - Used container or JComponent.components - Resultlist used to return found components.public static javax.swing.border.Border findDefaultBorder(javax.swing.border.Border b)
b - Border to check for SynthBorder existance.
public static boolean preservePopupIconSpace(javax.swing.JPopupMenu popup)
popup - Popup menu.
public static boolean popupHasIcons(javax.swing.JPopupMenu popup)
popup - Popup menu.
public static boolean popupHasCheckRadio(javax.swing.JPopupMenu popup)
popup - Popup menu.
public static boolean popupHasCheckRadioWithIcon(javax.swing.JPopupMenu popup)
popup - Popup menu.
public static java.awt.Paint createLinearGradientPaint(float startX,
float startY,
float endX,
float endY,
float[] fractions,
java.awt.Color[] colors)
public static void setLookAndFeel(java.lang.String lookAndFeelClassName)
UIManager.setLookAndFeel(String).
lookAndFeelClassName - Class name of the look and feel to be set.setLookAndFeel(String, boolean, boolean)
public static void setLookAndFeel(java.lang.String lookAndFeelClassName,
boolean antiAlias,
boolean useScreenMenuBar)
UIManager.setLookAndFeel(String).
lookAndFeelClassName - Class name of the look and feel to be set.antiAlias - True means enable anti-alias by System property
"swing.aatext". Note: this works only with Java 1.5
with Java 6 the Desktop settings will be used to
enable anti-aliasing.useScreenMenuBar - Enables usage of the screenMenuBar on Mac OSX 10.5
(Leopard). Note: the screenMenuBar feature does
not work on Mac OSX 10.4.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||