Package org.jdesktop.swingx.plaf.synth
Class SynthUtils
java.lang.Object
org.jdesktop.swingx.plaf.synth.SynthUtils
Utility class as stand-in for package private synth utility methods.
- Author:
- Jeanette Winzenburg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
static SynthContext
getContext
(JComponent c, Region region, SynthStyle style, int state) Returns a SynthContext with the specified values.static SynthContext
getContext
(SynthContext context, int state) Returns a context with the given component state and all other fields same as input context.static SynthContext
getContext
(SynthContext context, SynthStyle style) static SynthPainter
getPainter
(SynthContext context) Returns a SynthPainter from the context's style.static boolean
Returns true if the Style should be updated in response to the specified PropertyChangeEvent.static void
update
(SynthContext context, Graphics g) A convenience method that handles painting of the background.static void
update
(SynthContext context, Graphics g, Rectangle bounds) A convenience method that handles painting of the background.
-
Constructor Details
-
SynthUtils
public SynthUtils()
-
-
Method Details
-
getContext
Returns a SynthContext with the specified values.- Parameters:
c
- JComponentregion
- Identifies the portion of the JComponentstyle
- Style associated with the componentstate
- State of the component as defined in SynthConstants.- Returns:
- a SynthContext with the specified values.
- Throws:
NullPointerException
- if component, region of style is null.
-
getContext
- Parameters:
context
-style
-- Returns:
-
getContext
Returns a context with the given component state and all other fields same as input context.- Parameters:
context
- the context, must not be nullstate
- the component state.- Returns:
- a context with the given component state and other fields as inpu context.
-
getPainter
Returns a SynthPainter from the context's style. Fall-back to default if none available.- Parameters:
context
- SynthContext containing the style, must not be null.- Returns:
- a SynthPainter from the context's style, or a default if null.
-
shouldUpdateStyle
Returns true if the Style should be updated in response to the specified PropertyChangeEvent. This forwards toshouldUpdateStyleOnAncestorChanged
as necessary. -
getComponentState
-
update
A convenience method that handles painting of the background. All SynthUI implementations should override update and invoke this method.- Parameters:
context
- must not be nullg
- must not be null
-
update
A convenience method that handles painting of the background. All SynthUI implementations should override update and invoke this method.- Parameters:
context
- must not be nullg
- must not be nullbounds
- to fill, may be null to indicate the complete size
-