Package org.jdesktop.swingx.plaf.synth
Class SynthUtils
- java.lang.Object
-
- org.jdesktop.swingx.plaf.synth.SynthUtils
-
public class SynthUtils extends java.lang.ObjectUtility class as stand-in for package private synth utility methods.- Author:
- Jeanette Winzenburg
-
-
Constructor Summary
Constructors Constructor Description SynthUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetComponentState(javax.swing.JComponent c)static javax.swing.plaf.synth.SynthContextgetContext(javax.swing.JComponent c, javax.swing.plaf.synth.Region region, javax.swing.plaf.synth.SynthStyle style, int state)Returns a SynthContext with the specified values.static javax.swing.plaf.synth.SynthContextgetContext(javax.swing.plaf.synth.SynthContext context, int state)Returns a context with the given component state and all other fields same as input context.static javax.swing.plaf.synth.SynthContextgetContext(javax.swing.plaf.synth.SynthContext context, javax.swing.plaf.synth.SynthStyle style)static javax.swing.plaf.synth.SynthPaintergetPainter(javax.swing.plaf.synth.SynthContext context)Returns a SynthPainter from the context's style.static booleanshouldUpdateStyle(java.beans.PropertyChangeEvent event)Returns true if the Style should be updated in response to the specified PropertyChangeEvent.static voidupdate(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g)A convenience method that handles painting of the background.static voidupdate(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, java.awt.Rectangle bounds)A convenience method that handles painting of the background.
-
-
-
Method Detail
-
getContext
public static javax.swing.plaf.synth.SynthContext getContext(javax.swing.JComponent c, javax.swing.plaf.synth.Region region, javax.swing.plaf.synth.SynthStyle style, int state)Returns a SynthContext with the specified values.- Parameters:
component- 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:
java.lang.NullPointerException- if component, region of style is null.
-
getContext
public static javax.swing.plaf.synth.SynthContext getContext(javax.swing.plaf.synth.SynthContext context, javax.swing.plaf.synth.SynthStyle style)- Parameters:
context-style-- Returns:
-
getContext
public static javax.swing.plaf.synth.SynthContext getContext(javax.swing.plaf.synth.SynthContext context, int state)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
public static javax.swing.plaf.synth.SynthPainter getPainter(javax.swing.plaf.synth.SynthContext context)
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
public static boolean shouldUpdateStyle(java.beans.PropertyChangeEvent event)
Returns true if the Style should be updated in response to the specified PropertyChangeEvent. This forwards toshouldUpdateStyleOnAncestorChangedas necessary.
-
getComponentState
public static int getComponentState(javax.swing.JComponent c)
-
update
public static void update(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g)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
public static void update(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, java.awt.Rectangle bounds)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 nullthe- bounds to fill, may be null to indicate the complete size
-
-