public class SynthLookAndFeel extends BasicLookAndFeel
load(java.io.InputStream, java.lang.Class<?>) method, or provide your own
SynthStyleFactory to
setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory). Refer to the
package summary for an example of loading a file, and
SynthStyleFactory for an example of providing your own
SynthStyleFactory to
setStyleFactory.
Warning: This class implements Serializable as a side effect of it extending BasicLookAndFeel. It is not intended to be serialized. An attempt to serialize it will result in NotSerializableException.
| Constructor and Description |
|---|
SynthLookAndFeel()
Creates a SynthLookAndFeel.
|
| Modifier and Type | Method and Description |
|---|---|
static ComponentUI |
createUI(JComponent
Creates the Synth look and feel
ComponentUI for the passed in
JComponent.
|
UIDefaults |
getDefaults()
Returns the defaults for this SynthLookAndFeel.
|
String |
getDescription()
Returns a textual description of SynthLookAndFeel.
|
String |
getID()
Return a string that identifies this look and feel.
|
String |
getName()
Return a short string that identifies this look and feel.
|
static Region |
getRegion(JComponent
Returns the Region for the JComponent
c.
|
static SynthStyle |
getStyle(JComponent
Gets a SynthStyle for the specified region of the specified component.
|
static SynthStyleFactory |
getStyleFactory()
Returns the current SynthStyleFactory.
|
void |
initialize()
Called by UIManager when this look and feel is installed.
|
boolean |
isNativeLookAndFeel()
Returns false, SynthLookAndFeel is not a native look and feel.
|
boolean |
isSupportedLookAndFeel()
Returns true, SynthLookAndFeel is always supported.
|
void |
load(InputStream
Loads the set of
SynthStyles that will be used by this
SynthLookAndFeel.
|
void |
load(URL
Loads the set of
SynthStyles that will be used by this
SynthLookAndFeel.
|
static void |
setStyleFactory(SynthStyleFactory
Sets the SynthStyleFactory that the UI classes provided by synth will use to obtain a SynthStyle.
|
boolean |
shouldUpdateStyleOnAncestorChanged()
Returns whether or not the UIs should update their
SynthStyles from the
SynthStyleFactory when the ancestor of the
JComponent changes.
|
protected boolean |
shouldUpdateStyleOnEvent(PropertyChangeEvent
Returns whether or not the UIs should update their styles when a particular event occurs.
|
void |
uninitialize()
Called by UIManager when this look and feel is uninstalled.
|
static void |
updateStyles(Component
Updates the style associated with
c, and all its children.
|
createAudioAction, getAudioActionMap, initClassDefaults, initComponentDefaults, initSystemColorDefaults, loadSystemColors, playSoundgetDesktopPropertyValue, getDisabledIcon, getDisabledSelectedIcon, getLayoutStyle, getSupportsWindowDecorations, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninstallBorderpublic SynthLookAndFeel()
For the returned SynthLookAndFeel to be useful you need to invoke load to specify the set of SynthStyles, or invoke setStyleFactory.
public static void setStyleFactory(SynthStyleFactorycache)
cache - SynthStyleFactory the UIs should use.
public static SynthStyleFactorygetStyleFactory()
public static SynthStylegetStyle(JComponent c, Region region)
c - JComponent to get the SynthStyle for
region - Identifies the region of the specified component
public static void updateStyles(Componentc)
c, and all its children. This is a lighter version of
SwingUtilities.updateComponentTreeUI.
c - Component to update style for.
public static RegiongetRegion(JComponent c)
c.
c - JComponent to fetch the Region for
c
public static ComponentUIcreateUI(JComponent c)
ComponentUI for the passed in
JComponent.
c - JComponent to create the
ComponentUI for
c
public void load(InputStreaminput, Class <?> resourceBase) throws ParseException
SynthStyles that will be used by this
SynthLookAndFeel.
resourceBase is used to resolve any path based resources, for example an
Image would be resolved by
resourceBase.getResource(path). Refer to
Synth File Format for more information.
input - InputStream to load from
resourceBase - used to resolve any images or other resources
ParseException - if there is an error in parsing
IllegalArgumentException - if input or resourceBase is
null
public void load(URLurl) throws ParseException , IOException
SynthStyles that will be used by this
SynthLookAndFeel. Path based resources are resolved relatively to the specified
URL of the style. For example an
Image would be resolved by
new URL(synthFile, path). Refer to
Synth File Format for more information.
url - the
URL to load the set of
SynthStyle from
ParseException - if there is an error in parsing
IllegalArgumentException - if synthSet is
null
IOException - if synthSet cannot be opened as an
InputStream
public void initialize()
initialize in class
BasicLookAndFeel
LookAndFeel.uninitialize() ,
UIManager.setLookAndFeel(javax.swing.LookAndFeel)
public void uninitialize()
uninitialize in class
BasicLookAndFeel
LookAndFeel.initialize() ,
UIManager.setLookAndFeel(javax.swing.LookAndFeel)
public UIDefaultsgetDefaults()
getDefaults in class
BasicLookAndFeel
BasicLookAndFeel.initClassDefaults(javax.swing.UIDefaults) ,
BasicLookAndFeel.initSystemColorDefaults(javax.swing.UIDefaults) ,
BasicLookAndFeel.initComponentDefaults(javax.swing.UIDefaults)
public boolean isSupportedLookAndFeel()
isSupportedLookAndFeel in class
LookAndFeel
UIManager.setLookAndFeel(javax.swing.LookAndFeel)
public boolean isNativeLookAndFeel()
isNativeLookAndFeel in class
LookAndFeel
public StringgetDescription()
getDescription in class
LookAndFeel
public StringgetName()
getName in class
LookAndFeel
public StringgetID()
getID in class
LookAndFeel
public boolean shouldUpdateStyleOnAncestorChanged()
SynthStyles from the
SynthStyleFactory when the ancestor of the
JComponent changes. A subclass that provided a
SynthStyleFactory that based the return value from
getStyle off the containment hierarchy would override this method to return true.
SynthStyles from the
SynthStyleFactory when the ancestor changed.
protected boolean shouldUpdateStyleOnEvent(PropertyChangeEventev)
ev - a
PropertyChangeEvent