Package ch.swingfx.twinkle.style.overlay
Class AbstractOverlay
- java.lang.Object
-
- ch.swingfx.twinkle.style.overlay.AbstractOverlay
-
- All Implemented Interfaces:
IOverlay
- Direct Known Subclasses:
BorderOverlay,GradientOverlay
public abstract class AbstractOverlay extends java.lang.Object implements IOverlay
Extend this class if you want to create your ownIOverlayimplementations.
It implements the logic forOverlayPaintModevalues.
-
-
Field Summary
Fields Modifier and Type Field Description private IOverlayfDecoratorprivate OverlayPaintModefPaintMode
-
Constructor Summary
Constructors Constructor Description AbstractOverlay(OverlayPaintMode paintMode, IOverlay decorator)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidpaintMouseOut(java.awt.Graphics g, int cornerRadius)Called by paintOverlayMouseOut if we should paint it.abstract voidpaintMouseOver(java.awt.Graphics g, int cornerRadius)Called by paintOverlayMouseOver if we should paint it.voidpaintOverlayMouseOut(java.awt.Graphics g, int cornerRadius)Invoked when we should paint the overlay when the mouse is outvoidpaintOverlayMouseOver(java.awt.Graphics g, int cornerRadius)Invoked when we should paint the overlay when the mouse is overvoidsetOverlayPaintMode(OverlayPaintMode paintMode)Set when the overlay is painted
-
-
-
Field Detail
-
fDecorator
private final IOverlay fDecorator
-
fPaintMode
private OverlayPaintMode fPaintMode
-
-
Constructor Detail
-
AbstractOverlay
public AbstractOverlay(OverlayPaintMode paintMode, IOverlay decorator)
-
-
Method Detail
-
paintOverlayMouseOver
public void paintOverlayMouseOver(java.awt.Graphics g, int cornerRadius)Description copied from interface:IOverlayInvoked when we should paint the overlay when the mouse is over- Specified by:
paintOverlayMouseOverin interfaceIOverlay- Parameters:
g-Graphicsto paint oncornerRadius- the corner radius of the window
-
paintOverlayMouseOut
public void paintOverlayMouseOut(java.awt.Graphics g, int cornerRadius)Description copied from interface:IOverlayInvoked when we should paint the overlay when the mouse is out- Specified by:
paintOverlayMouseOutin interfaceIOverlay- Parameters:
g-Graphicsto paint oncornerRadius- the corner radius of the window
-
setOverlayPaintMode
public void setOverlayPaintMode(OverlayPaintMode paintMode)
Description copied from interface:IOverlaySet when the overlay is painted- Specified by:
setOverlayPaintModein interfaceIOverlay- Parameters:
paintMode- paint mode to apply
-
paintMouseOver
public abstract void paintMouseOver(java.awt.Graphics g, int cornerRadius)Called by paintOverlayMouseOver if we should paint it.- Parameters:
g- graphics to paint oncornerRadius- corner radius of the window
-
paintMouseOut
public abstract void paintMouseOut(java.awt.Graphics g, int cornerRadius)Called by paintOverlayMouseOut if we should paint it.- Parameters:
g- graphics to paint oncornerRadius- corner radius of the window
-
-