Class GradientBackground
- java.lang.Object
-
- ch.swingfx.twinkle.style.background.GradientBackground
-
- All Implemented Interfaces:
IBackground
public class GradientBackground extends java.lang.Object implements IBackground
Paint a top to bottom gradient.
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.ColorfEndColorprivate java.awt.ColorfStartColor
-
Constructor Summary
Constructors Constructor Description GradientBackground(java.awt.Color startColor, java.awt.Color endColor)Create a gradient background
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpaintBackground(java.awt.Graphics g, boolean isMouseOver, int cornerRadius)Paint the backgroundvoidsetAlpha(float alpha)Set the alpha of this component.
-
-
-
Method Detail
-
paintBackground
public void paintBackground(java.awt.Graphics g, boolean isMouseOver, int cornerRadius)Description copied from interface:IBackgroundPaint the background- Specified by:
paintBackgroundin interfaceIBackground- Parameters:
g- graphics to paint onisMouseOver- true if the mouse if over the notificationcornerRadius- corner radius of the window
-
setAlpha
public void setAlpha(float alpha)
Description copied from interface:IBackgroundSet the alpha of this component. Usual you don't call this method. Instead useNotificationBuilder.withAlpha(float)
Note this only works if theGraphicsConfigurationsupports per-pixel translucency.- Specified by:
setAlphain interfaceIBackground- Parameters:
alpha- value between 0.0f (completely transparent) and 1.0f (opaque)
-
-