Class GradientOverlay

java.lang.Object
ch.swingfx.twinkle.style.overlay.AbstractOverlay
ch.swingfx.twinkle.style.overlay.GradientOverlay
All Implemented Interfaces:
IOverlay

public class GradientOverlay extends AbstractOverlay
Paints a simple gradient from top to bottom
  • Field Details

    • fStartColor

      private final Color fStartColor
    • fEndColor

      private final Color fEndColor
  • Constructor Details

    • GradientOverlay

      public GradientOverlay(Color startColor, Color endColor, OverlayPaintMode paintMode)
      Create a gradient overlay
      Parameters:
      startColor - top color
      endColor - bottom color
      paintMode - paint mode of the overlay
    • GradientOverlay

      public GradientOverlay(Color startColor, Color endColor, OverlayPaintMode paintMode, IOverlay decorator)
      Create a gradient overlay with a decorator
      Parameters:
      startColor - top color
      endColor - bottom color
      paintMode - paint mode of the overlay
      decorator - Overlay we want to decorate
  • Method Details

    • paintGradient

      private void paintGradient(Graphics g, int cornerRadius)
    • paintMouseOver

      public void paintMouseOver(Graphics g, int cornerRadius)
      Description copied from class: AbstractOverlay
      Called by paintOverlayMouseOver if we should paint it.
      Specified by:
      paintMouseOver in class AbstractOverlay
      Parameters:
      g - graphics to paint on
      cornerRadius - corner radius of the window
    • paintMouseOut

      public void paintMouseOut(Graphics g, int cornerRadius)
      Description copied from class: AbstractOverlay
      Called by paintOverlayMouseOut if we should paint it.
      Specified by:
      paintMouseOut in class AbstractOverlay
      Parameters:
      g - graphics to paint on
      cornerRadius - corner radius of the window