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
Paints a border around the notification
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBorderOverlay
(int width, Color color, OverlayPaintMode paintMode) Create a newBorderOverlay
BorderOverlay
(int width, Color color, OverlayPaintMode paintMode, IOverlay decorator) Create a newBorderOverlay
with a decorator -
Method Summary
Modifier and TypeMethodDescriptionprivate void
createBorderImage
(Graphics g, int cornerRadius) Create the border fImage.private void
paintBorder
(Graphics g, int cornerRadius) void
paintMouseOut
(Graphics g, int cornerRadius) Called by paintOverlayMouseOut if we should paint it.void
paintMouseOver
(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
-
Field Details
-
fImage
-
fColor
-
fWidth
private final int fWidth
-
-
Constructor Details
-
BorderOverlay
Create a newBorderOverlay
- Parameters:
width
- width of the bordercolor
- color of the borderpaintMode
- paint mode of the border
-
BorderOverlay
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 Details
-
paintMouseOver
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
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
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
-