Package ch.swingfx.twinkle.style
Class AbstractNotificationStyle
- java.lang.Object
-
- ch.swingfx.twinkle.style.AbstractNotificationStyle
-
- All Implemented Interfaces:
INotificationStyle
- Direct Known Subclasses:
DarkDefaultNotification
,LightDefaultNotification
public abstract class AbstractNotificationStyle extends java.lang.Object implements INotificationStyle
Provides a base class forINotificationStyle
implementations. It provides default values for most styles except color values
-
-
Field Summary
Fields Modifier and Type Field Description private float
fAlpha
private IBackground
fBackground
private ICloseButton
fCloseButton
private java.util.Map<java.lang.String,java.lang.Object>
fCustomParams
private java.awt.Font
fMessageFont
private java.awt.Color
fMessageFontColor
private IOverlay
fOverlay
private java.awt.Font
fTitleFont
private java.awt.Color
fTitleFontColor
private int
fWindowCornerRadius
private ICreateNotificationWindow
fWindowCreator
private java.awt.Insets
fWindowInsets
private int
fWindowWidth
-
Constructor Summary
Constructors Constructor Description AbstractNotificationStyle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getAlpha()
Get the alpha that should be applied to a notification where the mouse is not overIBackground
getBackground()
Get theIBackground
that should be applied to the notificationICloseButton
getCloseButton()
Get theICloseButton
that should be applied to the notificationjava.util.Map<java.lang.String,java.lang.Object>
getCustomParams()
Get a map of custom parametersjava.awt.Font
getMessageFont()
Get the font for the messagejava.awt.Color
getMessageFontColor()
Get the message font color of the notificationICreateNotificationWindow
getNotificationWindowCreator()
Get the notification window creatorIOverlay
getOverlay()
Get theIOverlay
that should be applied to the notificationjava.awt.Font
getTitleFont()
Get the font for the titlejava.awt.Color
getTitleFontColor()
Get the title font color of the notificationint
getWidth()
The width of the notificationint
getWindowCornerRadius()
Get the radius of the window cornerjava.awt.Insets
getWindowInsets()
Get the insets of the notification windowAbstractNotificationStyle
withAlpha(float alpha)
Override the default alpha of the notificationAbstractNotificationStyle
withBackground(IBackground background)
Override the defaultIBackground
AbstractNotificationStyle
withCloseButton(ICloseButton closeButton)
Override the defaultICloseButton
AbstractNotificationStyle
withCustomParams(java.util.Map<java.lang.String,java.lang.Object> customParams)
Override the custom parametersAbstractNotificationStyle
withMessageFont(java.awt.Font messageFont)
Override the default message fontAbstractNotificationStyle
withMessageFontColor(java.awt.Color color)
Override the default message font colorAbstractNotificationStyle
withNotificationWindowCreator(ICreateNotificationWindow windowCreator)
Override the defaultICreateNotificationWindow
AbstractNotificationStyle
withOverlay(IOverlay overlay)
Override the defaultIOverlay
AbstractNotificationStyle
withTitleFont(java.awt.Font titleFont)
Override the default title fontAbstractNotificationStyle
withTitleFontColor(java.awt.Color color)
Override the default title font colorAbstractNotificationStyle
withWidth(int width)
Override the default widthAbstractNotificationStyle
withWindowCornerRadius(int cornerRadius)
Override the default window corner radiusAbstractNotificationStyle
withWindowInsets(java.awt.Insets windowInsets)
Override the default window insets
-
-
-
Field Detail
-
fTitleFont
private java.awt.Font fTitleFont
-
fMessageFont
private java.awt.Font fMessageFont
-
fTitleFontColor
private java.awt.Color fTitleFontColor
-
fMessageFontColor
private java.awt.Color fMessageFontColor
-
fWindowInsets
private java.awt.Insets fWindowInsets
-
fWindowWidth
private int fWindowWidth
-
fAlpha
private float fAlpha
-
fCloseButton
private ICloseButton fCloseButton
-
fOverlay
private IOverlay fOverlay
-
fBackground
private IBackground fBackground
-
fWindowCornerRadius
private int fWindowCornerRadius
-
fWindowCreator
private ICreateNotificationWindow fWindowCreator
-
fCustomParams
private java.util.Map<java.lang.String,java.lang.Object> fCustomParams
-
-
Method Detail
-
withWidth
public AbstractNotificationStyle withWidth(int width)
Override the default width- Parameters:
width
- new width- Returns:
- this
AbstractNotificationStyle
-
withWindowCornerRadius
public AbstractNotificationStyle withWindowCornerRadius(int cornerRadius)
Override the default window corner radius- Parameters:
cornerRadius
- new corner radius- Returns:
- this
AbstractNotificationStyle
-
withWindowInsets
public AbstractNotificationStyle withWindowInsets(java.awt.Insets windowInsets)
Override the default window insets- Parameters:
windowInsets
- new window insets- Returns:
- this
AbstractNotificationStyle
-
withTitleFont
public AbstractNotificationStyle withTitleFont(java.awt.Font titleFont)
Override the default title font- Parameters:
titleFont
- new title font- Returns:
- this
AbstractNotificationStyle
-
withMessageFont
public AbstractNotificationStyle withMessageFont(java.awt.Font messageFont)
Override the default message font- Parameters:
messageFont
- new message font- Returns:
- this
AbstractNotificationStyle
-
withAlpha
public AbstractNotificationStyle withAlpha(float alpha)
Override the default alpha of the notification- Parameters:
alpha
- new alpha- Returns:
- this
AbstractNotificationStyle
-
withBackground
public AbstractNotificationStyle withBackground(IBackground background)
Override the defaultIBackground
- Parameters:
background
- newIBackground
- Returns:
- this
AbstractNotificationStyle
-
withTitleFontColor
public AbstractNotificationStyle withTitleFontColor(java.awt.Color color)
Override the default title font color- Parameters:
color
- new font color- Returns:
- this
AbstractNotificationStyle
-
withMessageFontColor
public AbstractNotificationStyle withMessageFontColor(java.awt.Color color)
Override the default message font color- Parameters:
color
- new font color- Returns:
- this
AbstractNotificationStyle
-
withOverlay
public AbstractNotificationStyle withOverlay(IOverlay overlay)
Override the defaultIOverlay
- Parameters:
overlay
- newIOverlay
- Returns:
- this
AbstractNotificationStyle
-
withCloseButton
public AbstractNotificationStyle withCloseButton(ICloseButton closeButton)
Override the defaultICloseButton
- Parameters:
closeButton
- newICloseButton
- Returns:
- this
AbstractNotificationStyle
-
withNotificationWindowCreator
public AbstractNotificationStyle withNotificationWindowCreator(ICreateNotificationWindow windowCreator)
Override the defaultICreateNotificationWindow
- Parameters:
windowCreator
- newICreateNotificationWindow
- Returns:
- this
AbstractNotificationStyle
-
withCustomParams
public AbstractNotificationStyle withCustomParams(java.util.Map<java.lang.String,java.lang.Object> customParams)
Override the custom parameters- Parameters:
customParams
- new custom parameters- Returns:
- this
AbstractNotificationStyle
-
getWidth
public int getWidth()
Description copied from interface:INotificationStyle
The width of the notification- Specified by:
getWidth
in interfaceINotificationStyle
- Returns:
- The width of the notification
-
getWindowCornerRadius
public int getWindowCornerRadius()
Description copied from interface:INotificationStyle
Get the radius of the window corner- Specified by:
getWindowCornerRadius
in interfaceINotificationStyle
- Returns:
- the radius of the window corner
-
getWindowInsets
public java.awt.Insets getWindowInsets()
Description copied from interface:INotificationStyle
Get the insets of the notification window- Specified by:
getWindowInsets
in interfaceINotificationStyle
- Returns:
- the insets of the notification window
-
getTitleFont
public java.awt.Font getTitleFont()
Description copied from interface:INotificationStyle
Get the font for the title- Specified by:
getTitleFont
in interfaceINotificationStyle
- Returns:
- the font for the title
-
getMessageFont
public java.awt.Font getMessageFont()
Description copied from interface:INotificationStyle
Get the font for the message- Specified by:
getMessageFont
in interfaceINotificationStyle
- Returns:
- the font for the message
-
getAlpha
public float getAlpha()
Description copied from interface:INotificationStyle
Get the alpha that should be applied to a notification where the mouse is not over- Specified by:
getAlpha
in interfaceINotificationStyle
- Returns:
- the alpha of the notification window
-
getBackground
public IBackground getBackground()
Description copied from interface:INotificationStyle
Get theIBackground
that should be applied to the notification- Specified by:
getBackground
in interfaceINotificationStyle
- Returns:
- the
IBackground
of the notification
-
getTitleFontColor
public java.awt.Color getTitleFontColor()
Description copied from interface:INotificationStyle
Get the title font color of the notification- Specified by:
getTitleFontColor
in interfaceINotificationStyle
- Returns:
- the font color of the notification
-
getMessageFontColor
public java.awt.Color getMessageFontColor()
Description copied from interface:INotificationStyle
Get the message font color of the notification- Specified by:
getMessageFontColor
in interfaceINotificationStyle
- Returns:
- the message font color of the notification
-
getOverlay
public IOverlay getOverlay()
Description copied from interface:INotificationStyle
Get theIOverlay
that should be applied to the notification- Specified by:
getOverlay
in interfaceINotificationStyle
- Returns:
- The
IOverlay
of the notification
-
getCloseButton
public ICloseButton getCloseButton()
Description copied from interface:INotificationStyle
Get theICloseButton
that should be applied to the notification- Specified by:
getCloseButton
in interfaceINotificationStyle
- Returns:
- The
ICloseButton
of the notification
-
getNotificationWindowCreator
public ICreateNotificationWindow getNotificationWindowCreator()
Description copied from interface:INotificationStyle
Get the notification window creator- Specified by:
getNotificationWindowCreator
in interfaceINotificationStyle
- Returns:
- the notification window creator
-
getCustomParams
public java.util.Map<java.lang.String,java.lang.Object> getCustomParams()
Description copied from interface:INotificationStyle
Get a map of custom parameters- Specified by:
getCustomParams
in interfaceINotificationStyle
- Returns:
- a map of custom parameters
-
-