Class CaptionConfiguration
java.lang.Object
net.yetihafen.javafx.customcaption.CaptionConfiguration
- All Implemented Interfaces:
ShowInitializable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CaptionConfigurationThe default config that is used when no parameter is passed toCustomCaption.useForStage(Stage) -
Constructor Summary
ConstructorsConstructorDescriptionCaptionConfiguration(int captionHeight) CaptionConfiguration(int captionHeight, javafx.scene.paint.Color iconColor) CaptionConfiguration(int captionHeight, javafx.scene.paint.Color iconColor, javafx.scene.paint.Color controlBackgroundColor) -
Method Summary
Modifier and TypeMethodDescriptionsetButtonHoverColor(javafx.scene.paint.Color buttonHoverColor) set the background color of the buttons (except the close button)setCaptionDragRegion(javafx.scene.control.MenuBar menuBar) Specify aMenuBarto define where the window should be draggable while excluding the buttons in the MenuBarsetCaptionDragRegion(javafx.scene.Node captionDragRegion) Specify theNodedefining the draggable areasetCaptionDragRegion(DragRegion captionDragRegion) Specify aDragRegionto define where the window should be draggablesetCaptionHeight(int captionHeight) set the caption height this height will apply to the window controls and the draggable area of the windowsetCloseButtonHoverColor(javafx.scene.paint.Color closeButtonHoverColor) set the background color of the close button when hoveredsetControlBackgroundColor(javafx.scene.paint.Color controlBackgroundColor) set the background color of the controlssetIconColor(javafx.scene.paint.Color iconColor) Set the text/foreground color of the window controlssetIconHoverColor(javafx.scene.paint.Color iconHoverColor) Set the text/foreground color of the window controls when hoveredvoidshowInit()this function is designed to be called afterStage.show()has been called to configure customizations should only be called once per stageuseControls(boolean useControls) choose if you want to add you want to use these libraries controls or use your own
-
Field Details
-
DEFAULT_CONFIG
The default config that is used when no parameter is passed toCustomCaption.useForStage(Stage)
-
-
Constructor Details
-
CaptionConfiguration
public CaptionConfiguration() -
CaptionConfiguration
public CaptionConfiguration(int captionHeight) -
CaptionConfiguration
public CaptionConfiguration(int captionHeight, javafx.scene.paint.Color iconColor) -
CaptionConfiguration
public CaptionConfiguration(int captionHeight, javafx.scene.paint.Color iconColor, javafx.scene.paint.Color controlBackgroundColor)
-
-
Method Details
-
setIconHoverColor
Set the text/foreground color of the window controls when hovered- Parameters:
iconHoverColor- the color
-
setCloseButtonHoverColor
public CaptionConfiguration setCloseButtonHoverColor(javafx.scene.paint.Color closeButtonHoverColor) set the background color of the close button when hovered- Parameters:
closeButtonHoverColor- the color
-
setButtonHoverColor
set the background color of the buttons (except the close button)- Parameters:
buttonHoverColor- the color
-
setIconColor
Set the text/foreground color of the window controls- Parameters:
iconColor- the color
-
setCaptionHeight
set the caption height this height will apply to the window controls and the draggable area of the window- Parameters:
captionHeight- the height in px
-
setControlBackgroundColor
public CaptionConfiguration setControlBackgroundColor(javafx.scene.paint.Color controlBackgroundColor) set the background color of the controls- Parameters:
controlBackgroundColor- the color
-
useControls
choose if you want to add you want to use these libraries controls or use your ownDo note that
Scene.getRoot()will return **not** your specified root if this is set to true (default).- Parameters:
useControls- if the library controls should be drawn
-
setCaptionDragRegion
Specify theNodedefining the draggable area- Parameters:
captionDragRegion- theNode
-
setCaptionDragRegion
Specify aDragRegionto define where the window should be draggable- Parameters:
captionDragRegion- theDragRegion
-
setCaptionDragRegion
Specify aMenuBarto define where the window should be draggable while excluding the buttons in the MenuBar- Parameters:
menuBar- theMenuBar
-
showInit
public void showInit()Description copied from interface:ShowInitializablethis function is designed to be called afterStage.show()has been called to configure customizations should only be called once per stage- Specified by:
showInitin interfaceShowInitializable
-