Class GhostPaintingUtils
- java.lang.Object
-
- org.pushingpixels.lafwidget.animation.effects.GhostPaintingUtils
-
public class GhostPaintingUtils extends Object
Utility class that implements the ghost effects.
-
-
Field Summary
Fields Modifier and Type Field Description static floatDECAY_FACTORGlobal decay factor.static floatMAX_ICON_GHOSTING_ALPHAMaximal starting opacity for icon ghosting.static floatMAX_PRESS_GHOSTING_ALPHAMaximal starting opacity for press ghosting.static floatMIN_ICON_GHOSTING_ALPHAMinimal starting opacity for icon ghosting.static floatMIN_PRESS_GHOSTING_ALPHAMinimal starting opacity for press ghosting.
-
Constructor Summary
Constructors Constructor Description GhostPaintingUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static BufferedImagegetComponentGhostImage(JComponent comp, org.pushingpixels.trident.Timeline ghostPressTimeline, double scaleFactor)Returns a scaled ghost image of the specified component.protected static BufferedImagegetIconGhostImage(JComponent comp, org.pushingpixels.trident.Timeline ghostRolloverTimeline, Icon icon, double scaleFactor)Returns a scaled ghost image of the specified icon.static voidpaintGhostIcon(Graphics2D graphics, Component b, Icon icon, Rectangle iconRectangle)Paints the ghost icon inside the bounds of the specified button.static voidpaintGhostIcon(Graphics2D graphics, AbstractButton b, Rectangle iconRectangle)Paints the ghost icon inside the bounds of the specified button.static voidpaintGhostIcon(Graphics2D graphics, AbstractButton b, Icon icon)Paints the ghost icon inside the bounds of the specified button.static voidpaintGhostImages(Component mainComponent, Graphics g)Paints ghost images on the specified component.
-
-
-
Field Detail
-
MIN_ICON_GHOSTING_ALPHA
public static float MIN_ICON_GHOSTING_ALPHA
Minimal starting opacity for icon ghosting. Change to a higher value for debugging / demoing purposes.
-
MAX_ICON_GHOSTING_ALPHA
public static float MAX_ICON_GHOSTING_ALPHA
Maximal starting opacity for icon ghosting. Change to a higher value for debugging / demoing purposes.
-
MIN_PRESS_GHOSTING_ALPHA
public static float MIN_PRESS_GHOSTING_ALPHA
Minimal starting opacity for press ghosting. Change to a higher value for debugging / demoing purposes.
-
MAX_PRESS_GHOSTING_ALPHA
public static float MAX_PRESS_GHOSTING_ALPHA
Maximal starting opacity for press ghosting. Change to a higher value for debugging / demoing purposes.
-
DECAY_FACTOR
public static float DECAY_FACTOR
Global decay factor.
-
-
Method Detail
-
getComponentGhostImage
protected static BufferedImage getComponentGhostImage(JComponent comp, org.pushingpixels.trident.Timeline ghostPressTimeline, double scaleFactor)
Returns a scaled ghost image of the specified component.- Parameters:
comp- Component.scaleFactor- Scale factor.- Returns:
- A scaled ghost image of the specified component.
-
getIconGhostImage
protected static BufferedImage getIconGhostImage(JComponent comp, org.pushingpixels.trident.Timeline ghostRolloverTimeline, Icon icon, double scaleFactor)
Returns a scaled ghost image of the specified icon.- Parameters:
comp- Component.icon- Icon.scaleFactor- Scale factor.- Returns:
- A scaled ghost image of the specified icon.
-
paintGhostImages
public static void paintGhostImages(Component mainComponent, Graphics g)
Paints ghost images on the specified component.- Parameters:
mainComponent- Component.g- Graphics context.
-
paintGhostIcon
public static void paintGhostIcon(Graphics2D graphics, AbstractButton b, Icon icon)
Paints the ghost icon inside the bounds of the specified button.- Parameters:
graphics- Graphics context.b- Button.icon- Icon to paint.
-
paintGhostIcon
public static void paintGhostIcon(Graphics2D graphics, AbstractButton b, Rectangle iconRectangle)
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.
-
-