Class TopShadowOverlayPainter
- java.lang.Object
-
- org.pushingpixels.radiance.theming.api.painter.overlay.TopShadowOverlayPainter
-
- All Implemented Interfaces:
RadianceOverlayPainter
,RadianceTrait
public final class TopShadowOverlayPainter extends java.lang.Object implements RadianceOverlayPainter
Overlay painter that paints a few pixel-high drop shadow at the top edge of the relevant decoration area. This class is part of officially supported API.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
DEFAULT_SHADOW_START_ALPHA
private static java.util.Map<java.lang.Integer,TopShadowOverlayPainter>
MAP
private static int
MIN_SHADOW_START_ALPHA
private int
startAlpha
-
Constructor Summary
Constructors Modifier Constructor Description private
TopShadowOverlayPainter()
Private constructor to enforce thatgetInstance(int)
is the only way an application can get an instance of this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDisplayName()
Returns the display name ofthis
trait.static TopShadowOverlayPainter
getInstance(int strength)
Returns an instance of top shadow overlay painter with the requested strength.void
paintOverlay(java.awt.Graphics2D graphics, java.awt.Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, int width, int height, RadianceSkin skin)
Paints the overlay.
-
-
-
Field Detail
-
MAP
private static final java.util.Map<java.lang.Integer,TopShadowOverlayPainter> MAP
-
DEFAULT_SHADOW_START_ALPHA
private static final int DEFAULT_SHADOW_START_ALPHA
- See Also:
- Constant Field Values
-
MIN_SHADOW_START_ALPHA
private static final int MIN_SHADOW_START_ALPHA
- See Also:
- Constant Field Values
-
startAlpha
private int startAlpha
-
-
Constructor Detail
-
TopShadowOverlayPainter
private TopShadowOverlayPainter()
Private constructor to enforce thatgetInstance(int)
is the only way an application can get an instance of this class.
-
-
Method Detail
-
getInstance
public static TopShadowOverlayPainter getInstance(int strength)
Returns an instance of top shadow overlay painter with the requested strength.- Parameters:
strength
- Drop shadow strength. Must be in [0..100] range.- Returns:
- Top shadow overlay painter with the requested strength.
-
paintOverlay
public void paintOverlay(java.awt.Graphics2D graphics, java.awt.Component comp, RadianceThemingSlices.DecorationAreaType decorationAreaType, int width, int height, RadianceSkin skin)
Description copied from interface:RadianceOverlayPainter
Paints the overlay.- Specified by:
paintOverlay
in interfaceRadianceOverlayPainter
- Parameters:
graphics
- Graphics context.comp
- Component.decorationAreaType
- Decoration area type. Must not benull
.width
- Width.height
- Height.skin
- Skin for painting the overlay.
-
getDisplayName
public java.lang.String getDisplayName()
Description copied from interface:RadianceTrait
Returns the display name ofthis
trait. This method is part of officially supported API.- Specified by:
getDisplayName
in interfaceRadianceTrait
- Returns:
- The display name of
this
trait.
-
-