public class CustomStageBuilder extends Object
Constructor and Description |
---|
CustomStageBuilder() |
Modifier and Type | Method and Description |
---|---|
CustomStage |
build()
Produces the CustomStage object as for the definitions given by the user
|
CustomStageBuilder |
removeNavigationPane()
Deprecated.
this method does not need to be called from this builder class after v1.1.0
Removes the left navigation pane of the window
|
CustomStageBuilder |
setActionIcons(javafx.scene.image.Image close,
javafx.scene.image.Image minimize,
javafx.scene.image.Image maximize,
javafx.scene.image.Image restore)
Changes the default icons for the action buttons on Title-bar
|
CustomStageBuilder |
setButtonColor(String color)
Changes the color of the close, minimize and maximize/restore buttons
|
CustomStageBuilder |
setButtonHoverColor(String color)
Changes the color of the minimize and maximize/restore buttons on hover (close button's color won't change)
|
CustomStageBuilder |
setButtonHoverColor(String btnMinColor,
String btnMaxColor,
String btnCloseColor) |
CustomStageBuilder |
setDimensions(double minWidth,
double minHeight,
double maxWidth,
double maxHeight)
Sets the maximum and minimum resizing values for the window.
|
CustomStageBuilder |
setIcon(String path)
The icon for the window to be showed on taskbar
|
CustomStageBuilder |
setNavigationPane(NavigationType type,
javafx.scene.layout.Pane navigationPane)
Sets a static navigation pane (to the pointed location) attaching the pane given
|
CustomStageBuilder |
setNavigationPane(Style style,
NavigationType type,
javafx.scene.layout.Pane navigationPane)
Sets a static/dynamic navigation pane (to the pointed location) attaching the pane given
|
CustomStageBuilder |
setNavigationPane(Style style,
NavigationType type,
javafx.scene.layout.Pane navigationPane,
double verticalSpace,
double horizontalSpace,
boolean isSpaceDivided)
Sets the given navigationPane to the CustomStage as per its definitions (parameters).
|
CustomStageBuilder |
setStyleSheet(URL path)
Style the CustomStage as to the user given stylesheet
|
CustomStageBuilder |
setTitleColor(String color)
Changes the color of the color in title-bar
|
CustomStageBuilder |
setWindowColor(String color)
Changes the color of the window
|
CustomStageBuilder |
setWindowTitle(String title)
Sets the title of the title-bar
|
CustomStageBuilder |
setWindowTitle(String title,
HorizontalPos buttonPos,
HorizontalPos titlePos)
Sets the title of the title-bar and changes the position (on title-bar) of the ActionButtons and title
|
public static final Dimension DIMENSION
public CustomStageBuilder() throws IOException
IOException
public CustomStageBuilder setWindowTitle(String title)
title
- title for the windowpublic CustomStageBuilder setWindowTitle(String title, HorizontalPos buttonPos, HorizontalPos titlePos)
title
- title title for the windowbuttonPos
- position of the buttons (whether the buttons should be on the left/right side of the title-bar)
HorizontalPos.LEFT and HorizontalPos.RIGHT are allowed here since default is HorizontalPos.LEFT,
if HorizontalPos.CENTER given, it will be ignored and the default value (LEFT) will be taken.titlePos
- position of the title (of the window). The title can be placed on left/right/center of the window
as for the given HorizontalPos value.public CustomStageBuilder setIcon(String path)
path
- path of the imagepublic CustomStageBuilder setWindowColor(String color)
color
- name/hex/rgb/rgba value of the colorpublic CustomStageBuilder setTitleColor(String color)
color
- name/hex/rgb/rgba value of the colorpublic CustomStageBuilder setButtonColor(String color)
color
- name/hex/rgb/rgba value of the colorpublic CustomStageBuilder setButtonHoverColor(String color)
color
- name/hex/rgb/rgba value of the colorpublic CustomStageBuilder setButtonHoverColor(String btnMinColor, String btnMaxColor, String btnCloseColor)
btnMinColor
- color of close minimize button on hover statebtnMaxColor
- color of close maximize/restore button on hover statebtnCloseColor
- color of close button on hover statepublic CustomStageBuilder setActionIcons(javafx.scene.image.Image close, javafx.scene.image.Image minimize, javafx.scene.image.Image maximize, javafx.scene.image.Image restore)
close
- Icon for close buttonminimize
- Icon for minimize buttonmaximize
- Window maximize (maximize button) iconrestore
- Window restore (maximize button) iconpublic CustomStageBuilder setDimensions(double minWidth, double minHeight, double maxWidth, double maxHeight)
minWidth
- Minimum width of windowminHeight
- Minimum height of windowmaxWidth
- Maximum width of windowmaxHeight
- Maximum height of windowpublic CustomStageBuilder setStyleSheet(URL path)
path
- URL of the stylesheetpublic CustomStageBuilder removeNavigationPane()
public CustomStageBuilder setNavigationPane(NavigationType type, javafx.scene.layout.Pane navigationPane)
type
- where the navigationPane should be placed on the window (LEFT/RIGHT/TOP/BOTTOM)navigationPane
- root pane of the navigation (fxml file)public CustomStageBuilder setNavigationPane(Style style, NavigationType type, javafx.scene.layout.Pane navigationPane)
style
- whether the navigationPane is dynamic or statictype
- where the navigationPane should be placed on the window (LEFT/RIGHT/TOP/BOTTOM)navigationPane
- root pane of the navigation (fxml file)public CustomStageBuilder setNavigationPane(Style style, NavigationType type, javafx.scene.layout.Pane navigationPane, double verticalSpace, double horizontalSpace, boolean isSpaceDivided)
Sets the given navigationPane to the CustomStage as per its definitions (parameters). If the Style is Style.STATIC then the usual built-in static navigationPane would be generated and also, verticalSpace, horizontalSpace and isSpaceDivided values will be ignored.
If the Style is Style.STATIC then all the values are taken and will generate a dynamic navigationPane as for its given definitions.
style
- whether the navigationPane is a dynamic or statictype
- The location where the navigationPane should be placed (top/bottom/left/right) on the window.navigationPane
- The root pane which should be used as the navigationPaneverticalSpace
- This value states that, if the navigationPane is given as NavigationType.LEFT / NavigationType.RIGHT and
some space is required to be left without consuming the full height of the window (If the NavigationType
is set to be TOP/BOTTOM then this value is ignored). verticalSpace = 0 means the navigationPane will consume
the full height of the window.horizontalSpace
- This value states that, if the navigationPane is given as NavigationType.TOP / NavigationType.BOTTOM and
some space is required to be left without consuming the full width of the window (If the NavigationType
is set to be LEFT/RIGHT then this value is ignored). horizontalSpace = 0 means the navigationPane will consume
the full width of the window.isSpaceDivided
- States whether the given verticalSpace/horizontalSpace needs to be divided from top/bottom (for LEFT and RIGHT
NavigationType) or from left/right (for TOP and BOTTOM NavigationType). isSpaceDivided = false , states that
for LEFT/RIGHT NavigationType, the given verticalSpace will be allocated from the top only;
for TOP/BOTTOM NavigationType, the given horizontalSpace will only be allocated from left.public CustomStage build()
Copyright © 2018. All rights reserved.