Class ColorBackground

java.lang.Object
ch.swingfx.twinkle.style.background.ColorBackground
All Implemented Interfaces:
IBackground

public class ColorBackground extends Object implements IBackground
Paints a color as background
  • Field Details

    • fColor

      private Color fColor
      Color of the background
  • Constructor Details

    • ColorBackground

      public ColorBackground(Color color)
      Create a new ColorBackground
      Parameters:
      color - color of this background
  • Method Details

    • paintBackground

      public void paintBackground(Graphics g, boolean isMouseOver, int cornerRadius)
      Description copied from interface: IBackground
      Paint the background
      Specified by:
      paintBackground in interface IBackground
      Parameters:
      g - graphics to paint on
      isMouseOver - true if the mouse if over the notification
      cornerRadius - 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 use NotificationBuilder.withAlpha(float)
      Note this only works if the GraphicsConfiguration supports per-pixel translucency.
      Specified by:
      setAlpha in interface IBackground
      Parameters:
      alpha - value between 0.0f (completely transparent) and 1.0f (opaque)