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 ownIOverlay
implementations.
It implements the logic forOverlayPaintMode
values.
-
-
Field Summary
Fields Modifier and Type Field Description private IOverlay
fDecorator
private OverlayPaintMode
fPaintMode
-
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 void
paintMouseOut(java.awt.Graphics g, int cornerRadius)
Called by paintOverlayMouseOut if we should paint it.abstract void
paintMouseOver(java.awt.Graphics g, int cornerRadius)
Called by paintOverlayMouseOver if we should paint it.void
paintOverlayMouseOut(java.awt.Graphics g, int cornerRadius)
Invoked when we should paint the overlay when the mouse is outvoid
paintOverlayMouseOver(java.awt.Graphics g, int cornerRadius)
Invoked when we should paint the overlay when the mouse is overvoid
setOverlayPaintMode(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:IOverlay
Invoked when we should paint the overlay when the mouse is over- Specified by:
paintOverlayMouseOver
in interfaceIOverlay
- Parameters:
g
-Graphics
to paint oncornerRadius
- the corner radius of the window
-
paintOverlayMouseOut
public void paintOverlayMouseOut(java.awt.Graphics g, int cornerRadius)
Description copied from interface:IOverlay
Invoked when we should paint the overlay when the mouse is out- Specified by:
paintOverlayMouseOut
in interfaceIOverlay
- Parameters:
g
-Graphics
to paint oncornerRadius
- the corner radius of the window
-
setOverlayPaintMode
public void setOverlayPaintMode(OverlayPaintMode paintMode)
Description copied from interface:IOverlay
Set when the overlay is painted- Specified by:
setOverlayPaintMode
in 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
-
-