Class ColorBackground
- java.lang.Object
-
- ch.swingfx.twinkle.style.background.ColorBackground
-
- All Implemented Interfaces:
IBackground
public class ColorBackground extends java.lang.Object implements IBackground
Paints a color as background
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Color
fColor
Color of the background
-
Constructor Summary
Constructors Constructor Description ColorBackground(java.awt.Color color)
Create a newColorBackground
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
paintBackground(java.awt.Graphics g, boolean isMouseOver, int cornerRadius)
Paint the backgroundvoid
setAlpha(float alpha)
Set the alpha of this component.
-
-
-
Constructor Detail
-
ColorBackground
public ColorBackground(java.awt.Color color)
Create a newColorBackground
- Parameters:
color
- color of this background
-
-
Method Detail
-
paintBackground
public void paintBackground(java.awt.Graphics g, boolean isMouseOver, int cornerRadius)
Description copied from interface:IBackground
Paint the background- Specified by:
paintBackground
in 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:IBackground
Set the alpha of this component. Usual you don't call this method. Instead useNotificationBuilder
.withAlpha(float)
Note this only works if theGraphicsConfiguration
supports per-pixel translucency.- Specified by:
setAlpha
in interfaceIBackground
- Parameters:
alpha
- value between 0.0f (completely transparent) and 1.0f (opaque)
-
-