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 newBorderOverlayBorderOverlay(int width, Color color, OverlayPaintMode paintMode, IOverlay decorator) Create a newBorderOverlaywith a decorator -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcreateBorderImage(Graphics g, int cornerRadius) Create the border fImage.private voidpaintBorder(Graphics g, int cornerRadius) voidpaintMouseOut(Graphics g, int cornerRadius) Called by paintOverlayMouseOut if we should paint it.voidpaintMouseOver(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 newBorderOverlaywith 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:AbstractOverlayCalled by paintOverlayMouseOver if we should paint it.- Specified by:
paintMouseOverin classAbstractOverlay- Parameters:
g- graphics to paint oncornerRadius- corner radius of the window
-
paintMouseOut
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
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
-