Package ch.swingfx.twinkle.style
Class AbstractNotificationStyle
java.lang.Object
ch.swingfx.twinkle.style.AbstractNotificationStyle
- All Implemented Interfaces:
INotificationStyle
- Direct Known Subclasses:
DarkDefaultNotification
,LightDefaultNotification
Provides a base class for
INotificationStyle
implementations. It provides
default values for most styles except color values-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float
private IBackground
private ICloseButton
private Font
private Color
private IOverlay
private Font
private Color
private int
private ICreateNotificationWindow
private Insets
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
getAlpha()
Get the alpha that should be applied to a notification where the mouse is not overGet theIBackground
that should be applied to the notificationGet theICloseButton
that should be applied to the notificationGet a map of custom parametersGet the font for the messageGet the message font color of the notificationGet the notification window creatorGet theIOverlay
that should be applied to the notificationGet the font for the titleGet the title font color of the notificationint
getWidth()
The width of the notificationint
Get the radius of the window cornerGet the insets of the notification windowwithAlpha
(float alpha) Override the default alpha of the notificationwithBackground
(IBackground background) Override the defaultIBackground
withCloseButton
(ICloseButton closeButton) Override the defaultICloseButton
withCustomParams
(Map<String, Object> customParams) Override the custom parameterswithMessageFont
(Font messageFont) Override the default message fontwithMessageFontColor
(Color color) Override the default message font colorwithNotificationWindowCreator
(ICreateNotificationWindow windowCreator) Override the defaultICreateNotificationWindow
withOverlay
(IOverlay overlay) Override the defaultIOverlay
withTitleFont
(Font titleFont) Override the default title fontwithTitleFontColor
(Color color) Override the default title font colorwithWidth
(int width) Override the default widthwithWindowCornerRadius
(int cornerRadius) Override the default window corner radiuswithWindowInsets
(Insets windowInsets) Override the default window insets
-
Field Details
-
fTitleFont
-
fMessageFont
-
fTitleFontColor
-
fMessageFontColor
-
fWindowInsets
-
fWindowWidth
private int fWindowWidth -
fAlpha
private float fAlpha -
fCloseButton
-
fOverlay
-
fBackground
-
fWindowCornerRadius
private int fWindowCornerRadius -
fWindowCreator
-
fCustomParams
-
-
Constructor Details
-
AbstractNotificationStyle
public AbstractNotificationStyle()
-
-
Method Details
-
withWidth
Override the default width- Parameters:
width
- new width- Returns:
- this
AbstractNotificationStyle
-
withWindowCornerRadius
Override the default window corner radius- Parameters:
cornerRadius
- new corner radius- Returns:
- this
AbstractNotificationStyle
-
withWindowInsets
Override the default window insets- Parameters:
windowInsets
- new window insets- Returns:
- this
AbstractNotificationStyle
-
withTitleFont
Override the default title font- Parameters:
titleFont
- new title font- Returns:
- this
AbstractNotificationStyle
-
withMessageFont
Override the default message font- Parameters:
messageFont
- new message font- Returns:
- this
AbstractNotificationStyle
-
withAlpha
Override the default alpha of the notification- Parameters:
alpha
- new alpha- Returns:
- this
AbstractNotificationStyle
-
withBackground
Override the defaultIBackground
- Parameters:
background
- newIBackground
- Returns:
- this
AbstractNotificationStyle
-
withTitleFontColor
Override the default title font color- Parameters:
color
- new font color- Returns:
- this
AbstractNotificationStyle
-
withMessageFontColor
Override the default message font color- Parameters:
color
- new font color- Returns:
- this
AbstractNotificationStyle
-
withOverlay
Override the defaultIOverlay
- Parameters:
overlay
- newIOverlay
- Returns:
- this
AbstractNotificationStyle
-
withCloseButton
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
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
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
Description copied from interface:INotificationStyle
Get the font for the title- Specified by:
getTitleFont
in interfaceINotificationStyle
- Returns:
- the font for the title
-
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
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
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
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
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
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
Description copied from interface:INotificationStyle
Get the notification window creator- Specified by:
getNotificationWindowCreator
in interfaceINotificationStyle
- Returns:
- the notification window creator
-
getCustomParams
Description copied from interface:INotificationStyle
Get a map of custom parameters- Specified by:
getCustomParams
in interfaceINotificationStyle
- Returns:
- a map of custom parameters
-