Class GhostPaintingUtils
java.lang.Object
org.pushingpixels.radiance.theming.internal.widget.animation.effects.GhostPaintingUtils
Utility class that implements the ghost effects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static LinkedHashMap
<String, BufferedImage> Cache of component ghost images.static float
Global decay factor.private static LinkedHashMap
<String, BufferedImage> Cache of icon ghost images.static float
Maximal starting opacity for icon ghosting.static float
Maximal starting opacity for press ghosting.static float
Minimal starting opacity for icon ghosting.static float
Minimal starting opacity for press ghosting. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static BufferedImage
getComponentGhostImage
(JComponent comp, Timeline ghostPressTimeline, double ghostScaleFactor) Returns a scaled ghost image of the specified component.private static BufferedImage
getIconGhostImage
(JComponent comp, Timeline ghostRolloverTimeline, Icon icon, double ghostScaleFactor) Returns a scaled ghost image of the specified icon.static void
paintGhostIcon
(Graphics2D graphics, Component b, Icon icon, Rectangle iconRectangle) Paints the ghost icon inside the bounds of the specified button.static void
paintGhostIcon
(Graphics2D graphics, AbstractButton b, Rectangle iconRectangle) Paints the ghost icon inside the bounds of the specified button.static void
paintGhostImages
(Component mainComponent, Graphics g) Paints ghost images on the specified component.
-
Field Details
-
MIN_ICON_GHOSTING_ALPHA
public static float MIN_ICON_GHOSTING_ALPHAMinimal starting opacity for icon ghosting. Change to a higher value for debugging / demoing purposes. -
MAX_ICON_GHOSTING_ALPHA
public static float MAX_ICON_GHOSTING_ALPHAMaximal starting opacity for icon ghosting. Change to a higher value for debugging / demoing purposes. -
MIN_PRESS_GHOSTING_ALPHA
public static float MIN_PRESS_GHOSTING_ALPHAMinimal starting opacity for press ghosting. Change to a higher value for debugging / demoing purposes. -
MAX_PRESS_GHOSTING_ALPHA
public static float MAX_PRESS_GHOSTING_ALPHAMaximal starting opacity for press ghosting. Change to a higher value for debugging / demoing purposes. -
DECAY_FACTOR
public static float DECAY_FACTORGlobal decay factor. -
componentGhostCache
Cache of component ghost images. Used to speed up the rendering of the ghost effects. -
iconGhostCache
Cache of icon ghost images. Used to speed up the rendering of the ghost effects.
-
-
Constructor Details
-
GhostPaintingUtils
public GhostPaintingUtils()
-
-
Method Details
-
getComponentGhostImage
private static BufferedImage getComponentGhostImage(JComponent comp, Timeline ghostPressTimeline, double ghostScaleFactor) Returns a scaled ghost image of the specified component.- Parameters:
comp
- Component.ghostScaleFactor
- Scale factor.- Returns:
- A scaled ghost image of the specified component.
-
getIconGhostImage
private static BufferedImage getIconGhostImage(JComponent comp, Timeline ghostRolloverTimeline, Icon icon, double ghostScaleFactor) Returns a scaled ghost image of the specified icon.- Parameters:
comp
- Component.icon
- Icon.ghostScaleFactor
- Scale factor.- Returns:
- A scaled ghost image of the specified icon.
-
paintGhostImages
Paints ghost images on the specified component.- Parameters:
mainComponent
- Component.g
- Graphics context.
-
paintGhostIcon
Paints the ghost icon inside the bounds of the specified button.- Parameters:
graphics
- Graphics context.b
- Button.iconRectangle
- Rectangle of the button icon.
-
paintGhostIcon
public static void paintGhostIcon(Graphics2D graphics, Component b, Icon icon, Rectangle iconRectangle) Paints the ghost icon inside the bounds of the specified button.- Parameters:
graphics
- Graphics context.b
- Button.icon
- Icon to paint.iconRectangle
- Rectangle of the button icon.
-