Class BorderOverlay

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

public class BorderOverlay extends AbstractOverlay
Paints a border around the notification
  • Field Details

    • fImage

      private BufferedImage fImage
    • fColor

      private final Color fColor
    • fWidth

      private final int fWidth
  • Constructor Details

    • BorderOverlay

      public BorderOverlay(int width, Color color, OverlayPaintMode paintMode)
      Create a new BorderOverlay
      Parameters:
      width - width of the border
      color - color of the border
      paintMode - paint mode of the border
    • BorderOverlay

      public BorderOverlay(int width, Color color, OverlayPaintMode paintMode, IOverlay decorator)
      Create a new BorderOverlay with a decorator
      Parameters:
      width - width of the border
      color - color of the border
      paintMode - paint mode of the border
      decorator - Overlay we want to decorate
  • Method Details

    • 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
    • createBorderImage

      private void createBorderImage(Graphics g, int cornerRadius)
      Create the border fImage. Using BasicStroke and draw doesn't produce good looking result. Therefore we create a border fImage that looks good.
      Parameters:
      g - graphics
      cornerRadius - the corner radius of the window
    • paintBorder

      private void paintBorder(Graphics g, int cornerRadius)