public class CustomStageController extends Object implements javafx.fxml.Initializable
Modifier and Type | Class and Description |
---|---|
static class |
CustomStageController.StageComponent |
Constructor and Description |
---|
CustomStageController() |
Modifier and Type | Method and Description |
---|---|
void |
changeScene(javafx.scene.layout.Pane pane)
Changes the current view of the Stage to the given view (pane)
|
void |
dynamicDrawerEvent(NavigationType type)
This method shall be called if a dynamic navigationPane is in use.
|
void |
initialize(URL location,
ResourceBundle resources) |
void |
removeNavigationPane()
Deprecated.
use removeNavigationPane(NavigationType type) method instead
Removes the left navigation pane of the window
|
void |
removeNavigationPane(NavigationType type)
Removes the pointed static navigationPane from the window (does not work for dynamic navigationPanes)
|
void |
setActionAdapter(ActionAdapter actionAdapter) |
void |
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
|
void |
setDynamicNavigation(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).
|
void |
setHoverColor(String btnMinColor,
String btnMaxColor,
String btnCloseColor)
Sets different colors for button on mouse hover state
|
void |
setNavigationPane(NavigationType type,
javafx.scene.layout.Pane navigationPane)
Sets a static navigation pane (right side of the window) attaching the pane given
|
void |
setStyle(CustomStageController.StageComponent component,
String color)
Changes the color of the given component of the window
|
void |
setStyleSheet(URL path)
Style the CustomStage as to the user given stylesheet
|
void |
setTitle(String title)
Sets the title of the title-bar
|
void |
setTitle(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 void setStyle(CustomStageController.StageComponent component, String color)
component
- the window component to be styledcolor
- name/hex/rgb/rgba value of the colorpublic void setHoverColor(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 void setTitle(String title)
title
- title for the windowpublic void setTitle(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 void setActionAdapter(ActionAdapter actionAdapter)
actionAdapter
- ActionAdapter object to control close,maximize/restore,minimize actionspublic void changeScene(javafx.scene.layout.Pane pane)
pane
- root pane of the loaded fxml viewpublic void setStyleSheet(URL path)
path
- URL of the stylesheetpublic void removeNavigationPane()
public void removeNavigationPane(NavigationType type)
type
- which navigationPane should be removed from the window (LEFT/RIGHT/TOP/BOTTOM)public void 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 void 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 void setDynamicNavigation(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).
type
- 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 void dynamicDrawerEvent(NavigationType type)
type
- the navigationPane which the event should be triggered forpublic void initialize(URL location, ResourceBundle resources)
initialize
in interface javafx.fxml.Initializable
Copyright © 2018. All rights reserved.