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 floatprivate IBackgroundprivate ICloseButtonprivate Fontprivate Colorprivate IOverlayprivate Fontprivate Colorprivate intprivate ICreateNotificationWindowprivate Insetsprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatgetAlpha()Get the alpha that should be applied to a notification where the mouse is not overGet theIBackgroundthat should be applied to the notificationGet theICloseButtonthat 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 theIOverlaythat should be applied to the notificationGet the font for the titleGet the title font color of the notificationintgetWidth()The width of the notificationintGet 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 defaultIBackgroundwithCloseButton(ICloseButton closeButton) Override the defaultICloseButtonwithCustomParams(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 defaultICreateNotificationWindowwithOverlay(IOverlay overlay) Override the defaultIOverlaywithTitleFont(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: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
Description copied from interface:INotificationStyleGet the insets of the notification window- Specified by:
getWindowInsetsin interfaceINotificationStyle- Returns:
- the insets of the notification window
-
getTitleFont
Description copied from interface:INotificationStyleGet the font for the title- Specified by:
getTitleFontin interfaceINotificationStyle- Returns:
- the font for the title
-
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
Description copied from interface:INotificationStyleGet theIBackgroundthat should be applied to the notification- Specified by:
getBackgroundin interfaceINotificationStyle- Returns:
- the
IBackgroundof the notification
-
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
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
Description copied from interface:INotificationStyleGet theIOverlaythat should be applied to the notification- Specified by:
getOverlayin interfaceINotificationStyle- Returns:
- The
IOverlayof the notification
-
getCloseButton
Description copied from interface:INotificationStyleGet theICloseButtonthat should be applied to the notification- Specified by:
getCloseButtonin interfaceINotificationStyle- Returns:
- The
ICloseButtonof the notification
-
getNotificationWindowCreator
Description copied from interface:INotificationStyleGet the notification window creator- Specified by:
getNotificationWindowCreatorin interfaceINotificationStyle- Returns:
- the notification window creator
-
getCustomParams
Description copied from interface:INotificationStyleGet a map of custom parameters- Specified by:
getCustomParamsin interfaceINotificationStyle- Returns:
- a map of custom parameters
-