load method, or provide your own SynthStyleFactory
to setStyleFactory. Refer to the
package summary for an example of
loading a file, and javax.swing.plaf.synth.SynthStyleFactory for
an example of providing your own SynthStyleFactory to
setStyleFactory.
SynthIcon interface provides
paintIcon(synthContext, graphics, x, y, width, height) method that
allows to draw the icon with the given SynthContext.
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.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private SynthLookAndFeel. | |
| private Map | defaultsMap
Map of defaults table entries. |
| pack-priv static final Insets | EMPTY_UIRESOURCE_INSETS
Used in a handful of places where we need an empty Insets. |
| private SynthStyleFactory | factory
SynthStyleFactory for the this SynthLookAndFeel. |
| private static SynthStyleFactory | lastFactory
The last SynthStyleFactory that was set. |
| private static ReferenceQueue | |
| private static ComponentUI | |
| private static int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static ComponentUI | Returns: ComponentUI to use forcJComponent to create the c)ComponentUI forCreates the Synth look and feel |
| private static void | |
| pack-priv static int | |
| public UIDefaults | Returns: Defaults table.Overrides javax. Returns the defaults for this SynthLookAndFeel. |
| public String | Returns: textual description of synth.Implements abstract javax. Returns a textual description of SynthLookAndFeel. |
| public String | Returns: a short string identifying this look and feel.Implements abstract javax. Return a string that identifies this look and feel. |
| public String | Returns: a short string identifying this look and feel.Implements abstract javax. Return a short string that identifies this look and feel. |
| pack-priv static Insets | getPaintingInsets(SynthContext state, Insets insets)
A convenience method to return where the foreground should be painted for the Component identified by the passed in AbstractSynthContext. |
| public static Region | Returns: Region corresponding tocJComponent to fetch the Region for c)Returns the Region for the JComponent |
| pack-priv static ComponentUI | |
| pack-priv static int | |
| public static SynthStyle | Returns: SynthStyle to use.JComponent to get the SynthStyle for c, Region Identifies the region of the specified component region)Gets a SynthStyle for the specified region of the specified component. |
| public static SynthStyleFactory | |
| pack-priv static Object | getUIOfType(ComponentUI ui, Class<?> klass)
Hides javax. Returns the ui that is of type |
| public void | initialize()
Overrides javax. Called by UIManager when this look and feel is installed. |
| pack-priv static boolean | |
| public boolean | Returns: falseImplements abstract javax. Returns false, SynthLookAndFeel is not a native look and feel. |
| public boolean | Returns: true.Implements abstract javax. Returns true, SynthLookAndFeel is always supported. |
| public void | load(InputStream
InputStream to load from input, Class<?> used to resolve any images or other resources resourceBase)Loads the set of |
| private static void | |
| pack-priv static void | |
| pack-priv static void | setSelectedUI(ComponentUI uix, boolean selected, boolean focused, boolean enabled, boolean rollover)
Used by the renderers. |
| public static void | setStyleFactory(SynthStyleFactory
SynthStyleFactory the UIs should use. cache)Sets the SynthStyleFactory that the UI classes provided by synth will use to obtain a SynthStyle. |
| pack-priv static boolean | shouldUpdateStyle(PropertyChangeEvent event)
Returns true if the Style should be updated in response to the specified PropertyChangeEvent. |
| public boolean | Returns: whether or not the UIs should update theirSynthStyles from the SynthStyleFactory
when the ancestor changed.Returns whether or not the UIs should update their
|
| protected boolean | Returns: whether or not the UIs should update their stylesa ev)PropertyChangeEventReturns whether or not the UIs should update their styles when a particular event occurs. |
| public void | uninitialize()
Overrides javax. Called by UIManager when this look and feel is uninstalled. |
| pack-priv static void | |
| pack-priv static SynthStyle | Returns: newStyleA convenience method that will reset the Style of StyleContext if necessary. |
| public static void | updateStyles(Component
Component to update style for. c)Updates the style associated with |
| pack-priv static void | updateSubregion(SynthContext state, Graphics g, Rectangle bounds)
A convenience method that handles painting of the background for subregions. |
| private static boolean | Returns: the text antialiasing information associated to the desktopReturns the antialiasing information as specified by the host desktop. |
| private void |
| _handler | back to summary |
|---|---|
| private SynthLookAndFeel. | |
| defaultsMap | back to summary |
|---|---|
| private Map<String, Object> defaultsMap Map of defaults table entries. This is populated via the load method. | |
| EMPTY_UIRESOURCE_INSETS | back to summary |
|---|---|
| pack-priv static final Insets EMPTY_UIRESOURCE_INSETS Used in a handful of places where we need an empty Insets. | |
| factory | back to summary |
|---|---|
| private SynthStyleFactory factory SynthStyleFactory for the this SynthLookAndFeel. | |
| lastFactory | back to summary |
|---|---|
| private static SynthStyleFactory lastFactory The last SynthStyleFactory that was set. | |
| queue | back to summary |
|---|---|
| private static ReferenceQueue<LookAndFeel> queue | |
| selectedUI | back to summary |
|---|---|
| private static ComponentUI selectedUI | |
| selectedUIStateValue | back to summary |
|---|---|
| private static int selectedUIStateValue | |
| SynthLookAndFeel | back to summary |
|---|---|
| public SynthLookAndFeel() Creates a SynthLookAndFeel.
For the returned
| |
| createUI | back to summary |
|---|---|
| public static ComponentUI createUI(JComponent c) Creates the Synth look and feel
| |
| flushUnreferenced | back to summary |
|---|---|
| private static void flushUnreferenced() | |
| getComponentState | back to summary |
|---|---|
| pack-priv static int getComponentState(Component c) Returns the component state for the specified component. This should only be used for Components that don't have any special state beyond that of ENABLED, DISABLED or FOCUSED. For example, buttons shouldn't call into this method. | |
| getDefaults | back to summary |
|---|---|
| public UIDefaults getDefaults() Overrides javax. Returns the defaults for this SynthLookAndFeel.
| |
| getDescription | back to summary |
|---|---|
| public String getDescription() Implements abstract javax. Returns a textual description of SynthLookAndFeel. | |
| getID | back to summary |
|---|---|
| public String getID() Implements abstract javax. Return a string that identifies this look and feel. | |
| getName | back to summary |
|---|---|
| public String getName() Implements abstract javax. Return a short string that identifies this look and feel. | |
| getPaintingInsets | back to summary |
|---|---|
| pack-priv static Insets getPaintingInsets(SynthContext state, Insets insets) A convenience method to return where the foreground should be painted for the Component identified by the passed in AbstractSynthContext. | |
| getRegion | back to summary |
|---|---|
| public static Region getRegion(JComponent c) Returns the Region for the JComponent
| |
| getSelectedUI | back to summary |
|---|---|
| pack-priv static ComponentUI getSelectedUI() | |
| getSelectedUIState | back to summary |
|---|---|
| pack-priv static int getSelectedUIState() | |
| getStyle | back to summary |
|---|---|
| public static SynthStyle getStyle(JComponent c, Region region) Gets a SynthStyle for the specified region of the specified component. This is not for general consumption, only custom UIs should call this method.
| |
| getStyleFactory | back to summary |
|---|---|
| public static SynthStyleFactory getStyleFactory() Returns the current SynthStyleFactory.
| |
| getUIOfType | back to summary |
|---|---|
| pack-priv static Object getUIOfType(ComponentUI ui, Class<?> klass) Hides javax. Returns the ui that is of type | |
| initialize | back to summary |
|---|---|
| public void initialize() Overrides javax. Called by UIManager when this look and feel is installed.
| |
| isLeftToRight | back to summary |
|---|---|
| pack-priv static boolean isLeftToRight(Component c) | |
| isNativeLookAndFeel | back to summary |
|---|---|
| public boolean isNativeLookAndFeel() Implements abstract javax. Returns false, SynthLookAndFeel is not a native look and feel.
| |
| isSupportedLookAndFeel | back to summary |
|---|---|
| public boolean isSupportedLookAndFeel() Implements abstract javax. Returns true, SynthLookAndFeel is always supported.
| |
| load | back to summary |
|---|---|
| public void load(InputStream input, Class<?> resourceBase) throws ParseException Loads the set of
| |
| paintRegion | back to summary |
|---|---|
| private static void paintRegion(SynthContext state, Graphics g, Rectangle bounds) | |
| resetSelectedUI | back to summary |
|---|---|
| pack-priv static void resetSelectedUI() Clears out the selected UI that was last set in setSelectedUI. | |
| setSelectedUI | back to summary |
|---|---|
| pack-priv static void setSelectedUI(ComponentUI uix, boolean selected, boolean focused, boolean enabled, boolean rollover) Used by the renderers. For the most part the renderers are implemented
as Labels, which is problematic in so far as they are never selected.
To accommodate this SynthLabelUI checks if the current
UI matches that of | |
| setStyleFactory | back to summary |
|---|---|
| public static void setStyleFactory(SynthStyleFactory cache) Sets the SynthStyleFactory that the UI classes provided by synth will use to obtain a SynthStyle.
| |
| shouldUpdateStyle | back to summary |
|---|---|
| pack-priv static boolean shouldUpdateStyle(PropertyChangeEvent event) Returns true if the Style should be updated in response to the
specified PropertyChangeEvent. This forwards to
| |
| shouldUpdateStyleOnAncestorChanged | back to summary |
|---|---|
| public boolean shouldUpdateStyleOnAncestorChanged() Returns whether or not the UIs should update their
| |
| shouldUpdateStyleOnEvent | back to summary |
|---|---|
| protected boolean shouldUpdateStyleOnEvent(PropertyChangeEvent ev) Returns whether or not the UIs should update their styles when a particular event occurs.
| |
| uninitialize | back to summary |
|---|---|
| public void uninitialize() Overrides javax. Called by UIManager when this look and feel is uninstalled.
| |
| update | back to summary |
|---|---|
| pack-priv static void update(SynthContext state, Graphics g) A convenience method that handles painting of the background. All SynthUI implementations should override update and invoke this method. | |
| updateStyle | back to summary |
|---|---|
| pack-priv static SynthStyle updateStyle(SynthContext context, SynthUI ui) A convenience method that will reset the Style of StyleContext if necessary.
| |
| updateStyles | back to summary |
|---|---|
| public static void updateStyles(Component c) Updates the style associated with
| |
| updateSubregion | back to summary |
|---|---|
| pack-priv static void updateSubregion(SynthContext state, Graphics g, Rectangle bounds) A convenience method that handles painting of the background for subregions. All SynthUI's that have subregions should invoke this method, than paint the foreground. | |
| useLAFConditions | back to summary |
|---|---|
| private static boolean useLAFConditions() Returns the antialiasing information as specified by the host desktop. Antialiasing might be forced off if the desktop is GNOME and the user has set his locale to Chinese, Japanese or Korean. This is consistent with what GTK does. See com.sun.java.swing.plaf.gtk.GtkLookAndFeel for more information about CJK and antialiased fonts.
| |
| writeObject | back to summary |
|---|---|
private void writeObject(ObjectOutputStream out) throws IOException
| |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private static boolean | updatePending
Indicates if an updateUI call is pending. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| private static synchronized boolean | |
| public void | propertyChange(PropertyChangeEvent pce)
Implements java. This method gets called when a bound property is changed. |
| private static synchronized void | |
| private static void | |
| protected void | |
| private static void |
| key | back to summary |
|---|---|
| private String key | |
| updatePending | back to summary |
|---|---|
| private static boolean updatePending Indicates if an updateUI call is pending. | |
| AATextListener | back to summary |
|---|---|
| pack-priv AATextListener(LookAndFeel laf) | |
| dispose | back to summary |
|---|---|
| pack-priv void dispose() | |
| isUpdatePending | back to summary |
|---|---|
| private static synchronized boolean isUpdatePending() Returns true if a UI update is pending. | |
| propertyChange | back to summary |
|---|---|
| public void propertyChange(PropertyChangeEvent pce) Implements java. Doc from java. This method gets called when a bound property is changed.
| |
| setUpdatePending | back to summary |
|---|---|
| private static synchronized void setUpdatePending(boolean update) Sets whether or not an updateUI call is pending. | |
| updateAllUIs | back to summary |
|---|---|
| private static void updateAllUIs() Updates the UIs of all the known Frames. | |
| updateUI | back to summary |
|---|---|
| protected void updateUI() | |
| updateWindowUI | back to summary |
|---|---|
| private static void updateWindowUI(Window window) Updates the UI of the passed in window and all its children. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | propertyChange(PropertyChangeEvent evt)
Implements java. This method gets called when a bound property is changed. |
| private void | repaintIfBackgroundsDiffer(JComponent comp)
This is a support method that will check if the background colors of the specified component differ between focused and unfocused states. |
| Handler | back to summary |
|---|---|
| private Handler() | |
| propertyChange | back to summary |
|---|---|
| public void propertyChange(PropertyChangeEvent evt) Implements java. Doc from java. This method gets called when a bound property is changed.
| |
| repaintIfBackgroundsDiffer | back to summary |
|---|---|
| private void repaintIfBackgroundsDiffer(JComponent comp) This is a support method that will check if the background colors of the specified component differ between focused and unfocused states. If the color differ the component will then repaint itself. | |