Class DecorationPainterUtils
- java.lang.Object
-
- org.pushingpixels.radiance.theming.internal.painter.DecorationPainterUtils
-
public class DecorationPainterUtils extends java.lang.ObjectContains utility methods related to decoration painters. This class is for internal use only.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDecorationPainterUtils.PopupOriginatorLink
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringDECORATION_AREA_TYPEClient property for marking a component with an instance ofRadianceThemingSlices.DecorationAreaTypeenum.static java.lang.StringPOPUP_ORIGINATOR_LINK
-
Constructor Summary
Constructors Constructor Description DecorationPainterUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearDecorationType(javax.swing.JComponent comp)Clears the client properties related to the decoration area type.static RadianceThemingSlices.DecorationAreaTypegetDecorationType(java.awt.Component comp)Returns the decoration area type of the specified component.static RadianceThemingSlices.DecorationAreaTypegetImmediateDecorationType(java.awt.Component comp)Returns the immediate decoration area type of the specified component.static voidpaintDecorationArea(java.awt.Graphics g, java.awt.Component c, java.awt.Shape outline, RadianceThemingSlices.DecorationAreaType decorationType, ContainerColorTokens tokens, boolean force)static voidpaintDecorationBackground(java.awt.Graphics g, java.awt.Component c, boolean force)Paints the decoration background on the specified component.private static voidpaintDecorationBackground(java.awt.Graphics g, java.awt.Component c, RadianceThemingSlices.DecorationAreaType decorationType, boolean force)Paints the decoration background on the specified component.static voidsetDecorationType(javax.swing.JComponent comp, RadianceThemingSlices.DecorationAreaType type)Sets the decoration type of the specified component.
-
-
-
Field Detail
-
DECORATION_AREA_TYPE
private static final java.lang.String DECORATION_AREA_TYPE
Client property for marking a component with an instance ofRadianceThemingSlices.DecorationAreaTypeenum.- See Also:
- Constant Field Values
-
POPUP_ORIGINATOR_LINK
public static final java.lang.String POPUP_ORIGINATOR_LINK
- See Also:
- Constant Field Values
-
-
Method Detail
-
setDecorationType
public static void setDecorationType(javax.swing.JComponent comp, RadianceThemingSlices.DecorationAreaType type)Sets the decoration type of the specified component.- Parameters:
comp- Component.type- Decoration type of the component and its children.
-
clearDecorationType
public static void clearDecorationType(javax.swing.JComponent comp)
Clears the client properties related to the decoration area type.- Parameters:
comp- Component.
-
getDecorationType
public static RadianceThemingSlices.DecorationAreaType getDecorationType(java.awt.Component comp)
Returns the decoration area type of the specified component. The component and its ancestor hierarchy are scanned for the registered decoration area type. IfsetDecorationType(JComponent, RadianceThemingSlices.DecorationAreaType)has been called on the specified component, the matching decoration type is returned. Otherwise, the component hierarchy is scanned to find the closest ancestor that was passed tosetDecorationType(JComponent, RadianceThemingSlices.DecorationAreaType)- and its decoration type is returned. If neither the component, nor any one of its parent components has been passed to the setter method,RadianceThemingSlices.DecorationAreaType.NONEis returned.- Parameters:
comp- Component.- Returns:
- Decoration area type of the component.
-
getImmediateDecorationType
public static RadianceThemingSlices.DecorationAreaType getImmediateDecorationType(java.awt.Component comp)
Returns the immediate decoration area type of the specified component. The component is checked for the registered decoration area type. IfsetDecorationType(JComponent, RadianceThemingSlices.DecorationAreaType)was not called on this component, this method returnsnull.- Parameters:
comp- Component.- Returns:
- Immediate decoration area type of the component.
-
paintDecorationBackground
public static void paintDecorationBackground(java.awt.Graphics g, java.awt.Component c, boolean force)Paints the decoration background on the specified component. The decoration background is not painted when theforceparameter isfalseand at least one of the following conditions holds:- The component is in a cell renderer.
- The component is not showing on the screen.
- The component is in the preview mode.
- Parameters:
g- Graphics context.c- Component.force- Iftrue, the painting of decoration background is enforced.
-
paintDecorationBackground
private static void paintDecorationBackground(java.awt.Graphics g, java.awt.Component c, RadianceThemingSlices.DecorationAreaType decorationType, boolean force)Paints the decoration background on the specified component. See comments onpaintDecorationBackground(Graphics, Component, boolean)for the cases when the decoration background painting is skipped.- Parameters:
g- Graphics context.c- Component.decorationType- Decoration area type of the component.force- Iftrue, the painting of decoration background is enforced. #seepaintDecorationBackground(Graphics, Component, boolean)
-
paintDecorationArea
public static void paintDecorationArea(java.awt.Graphics g, java.awt.Component c, java.awt.Shape outline, RadianceThemingSlices.DecorationAreaType decorationType, ContainerColorTokens tokens, boolean force)
-
-