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 forINotificationStyleimplementations. It provides default values for most styles except color values
-
-
Field Summary
Fields Modifier and Type Field Description private floatfAlphaprivate IBackgroundfBackgroundprivate ICloseButtonfCloseButtonprivate java.util.Map<java.lang.String,java.lang.Object>fCustomParamsprivate java.awt.FontfMessageFontprivate java.awt.ColorfMessageFontColorprivate IOverlayfOverlayprivate java.awt.FontfTitleFontprivate java.awt.ColorfTitleFontColorprivate intfWindowCornerRadiusprivate ICreateNotificationWindowfWindowCreatorprivate java.awt.InsetsfWindowInsetsprivate intfWindowWidth
-
Constructor Summary
Constructors Constructor Description AbstractNotificationStyle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetAlpha()Get the alpha that should be applied to a notification where the mouse is not overIBackgroundgetBackground()Get theIBackgroundthat should be applied to the notificationICloseButtongetCloseButton()Get theICloseButtonthat should be applied to the notificationjava.util.Map<java.lang.String,java.lang.Object>getCustomParams()Get a map of custom parametersjava.awt.FontgetMessageFont()Get the font for the messagejava.awt.ColorgetMessageFontColor()Get the message font color of the notificationICreateNotificationWindowgetNotificationWindowCreator()Get the notification window creatorIOverlaygetOverlay()Get theIOverlaythat should be applied to the notificationjava.awt.FontgetTitleFont()Get the font for the titlejava.awt.ColorgetTitleFontColor()Get the title font color of the notificationintgetWidth()The width of the notificationintgetWindowCornerRadius()Get the radius of the window cornerjava.awt.InsetsgetWindowInsets()Get the insets of the notification windowAbstractNotificationStylewithAlpha(float alpha)Override the default alpha of the notificationAbstractNotificationStylewithBackground(IBackground background)Override the defaultIBackgroundAbstractNotificationStylewithCloseButton(ICloseButton closeButton)Override the defaultICloseButtonAbstractNotificationStylewithCustomParams(java.util.Map<java.lang.String,java.lang.Object> customParams)Override the custom parametersAbstractNotificationStylewithMessageFont(java.awt.Font messageFont)Override the default message fontAbstractNotificationStylewithMessageFontColor(java.awt.Color color)Override the default message font colorAbstractNotificationStylewithNotificationWindowCreator(ICreateNotificationWindow windowCreator)Override the defaultICreateNotificationWindowAbstractNotificationStylewithOverlay(IOverlay overlay)Override the defaultIOverlayAbstractNotificationStylewithTitleFont(java.awt.Font titleFont)Override the default title fontAbstractNotificationStylewithTitleFontColor(java.awt.Color color)Override the default title font colorAbstractNotificationStylewithWidth(int width)Override the default widthAbstractNotificationStylewithWindowCornerRadius(int cornerRadius)Override the default window corner radiusAbstractNotificationStylewithWindowInsets(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:INotificationStyleThe width of the notification- Specified by:
getWidthin interfaceINotificationStyle- Returns:
- The width of the notification
-
getWindowCornerRadius
public int getWindowCornerRadius()
Description copied from interface:INotificationStyleGet the radius of the window corner- Specified by:
getWindowCornerRadiusin interfaceINotificationStyle- Returns:
- the radius of the window corner
-
getWindowInsets
public java.awt.Insets getWindowInsets()
Description copied from interface:INotificationStyleGet the insets of the notification window- Specified by:
getWindowInsetsin interfaceINotificationStyle- Returns:
- the insets of the notification window
-
getTitleFont
public java.awt.Font getTitleFont()
Description copied from interface:INotificationStyleGet the font for the title- Specified by:
getTitleFontin interfaceINotificationStyle- Returns:
- the font for the title
-
getMessageFont
public java.awt.Font getMessageFont()
Description copied from interface:INotificationStyleGet the font for the message- Specified by:
getMessageFontin interfaceINotificationStyle- Returns:
- the font for the message
-
getAlpha
public float getAlpha()
Description copied from interface:INotificationStyleGet the alpha that should be applied to a notification where the mouse is not over- Specified by:
getAlphain interfaceINotificationStyle- Returns:
- the alpha of the notification window
-
getBackground
public IBackground getBackground()
Description copied from interface:INotificationStyleGet theIBackgroundthat should be applied to the notification- Specified by:
getBackgroundin interfaceINotificationStyle- Returns:
- the
IBackgroundof the notification
-
getTitleFontColor
public java.awt.Color getTitleFontColor()
Description copied from interface:INotificationStyleGet the title font color of the notification- Specified by:
getTitleFontColorin interfaceINotificationStyle- Returns:
- the font color of the notification
-
getMessageFontColor
public java.awt.Color getMessageFontColor()
Description copied from interface:INotificationStyleGet the message font color of the notification- Specified by:
getMessageFontColorin interfaceINotificationStyle- Returns:
- the message font color of the notification
-
getOverlay
public IOverlay getOverlay()
Description copied from interface:INotificationStyleGet theIOverlaythat should be applied to the notification- Specified by:
getOverlayin interfaceINotificationStyle- Returns:
- The
IOverlayof the notification
-
getCloseButton
public ICloseButton getCloseButton()
Description copied from interface:INotificationStyleGet theICloseButtonthat should be applied to the notification- Specified by:
getCloseButtonin interfaceINotificationStyle- Returns:
- The
ICloseButtonof the notification
-
getNotificationWindowCreator
public ICreateNotificationWindow getNotificationWindowCreator()
Description copied from interface:INotificationStyleGet the notification window creator- Specified by:
getNotificationWindowCreatorin interfaceINotificationStyle- Returns:
- the notification window creator
-
getCustomParams
public java.util.Map<java.lang.String,java.lang.Object> getCustomParams()
Description copied from interface:INotificationStyleGet a map of custom parameters- Specified by:
getCustomParamsin interfaceINotificationStyle- Returns:
- a map of custom parameters
-
-