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 newBorderOverlay
BorderOverlay(int width, java.awt.Color color, OverlayPaintMode paintMode, IOverlay decorator)
Create a newBorderOverlay
with a decorator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
createBorderImage(java.awt.Graphics g, int cornerRadius)
Create the border fImage.private void
paintBorder(java.awt.Graphics g, int cornerRadius)
void
paintMouseOut(java.awt.Graphics g, int cornerRadius)
Called by paintOverlayMouseOut if we should paint it.void
paintMouseOver(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 newBorderOverlay
with 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:AbstractOverlay
Called by paintOverlayMouseOver if we should paint it.- Specified by:
paintMouseOver
in 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:AbstractOverlay
Called by paintOverlayMouseOut if we should paint it.- Specified by:
paintMouseOut
in 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)
-
-