Package ch.swingfx.twinkle.style.overlay
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
-
-
Constructor Summary
Constructors Constructor Description BorderOverlay(int width, java.awt.Color color, OverlayPaintMode paintMode)Create a newBorderOverlayBorderOverlay(int width, java.awt.Color color, OverlayPaintMode paintMode, IOverlay decorator)Create a newBorderOverlaywith a decorator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcreateBorderImage(java.awt.Graphics g, int cornerRadius)Create the border fImage.private voidpaintBorder(java.awt.Graphics g, int cornerRadius)voidpaintMouseOut(java.awt.Graphics g, int cornerRadius)Called by paintOverlayMouseOut if we should paint it.voidpaintMouseOver(java.awt.Graphics g, int cornerRadius)Called by paintOverlayMouseOver if we should paint it.-
Methods inherited from class ch.swingfx.twinkle.style.overlay.AbstractOverlay
paintOverlayMouseOut, paintOverlayMouseOver, setOverlayPaintMode
-
-
-
-
Constructor Detail
-
BorderOverlay
public BorderOverlay(int width, java.awt.Color color, OverlayPaintMode paintMode)Create a newBorderOverlay- Parameters:
width- width of the bordercolor- color of the borderpaintMode- paint mode of the border
-
BorderOverlay
public BorderOverlay(int width, java.awt.Color color, OverlayPaintMode paintMode, IOverlay decorator)Create a newBorderOverlaywith a decorator- Parameters:
width- width of the bordercolor- color of the borderpaintMode- paint mode of the borderdecorator- Overlay we want to decorate
-
-
Method Detail
-
paintMouseOver
public void paintMouseOver(java.awt.Graphics g, int cornerRadius)Description copied from class:AbstractOverlayCalled by paintOverlayMouseOver if we should paint it.- Specified by:
paintMouseOverin classAbstractOverlay- Parameters:
g- graphics to paint oncornerRadius- corner radius of the window
-
paintMouseOut
public void paintMouseOut(java.awt.Graphics g, int cornerRadius)Description copied from class:AbstractOverlayCalled by paintOverlayMouseOut if we should paint it.- Specified by:
paintMouseOutin classAbstractOverlay- Parameters:
g- graphics to paint oncornerRadius- corner radius of the window
-
createBorderImage
private void createBorderImage(java.awt.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- graphicscornerRadius- the corner radius of the window
-
paintBorder
private void paintBorder(java.awt.Graphics g, int cornerRadius)
-
-