Class CaptionConfiguration

java.lang.Object
net.yetihafen.javafx.customcaption.CaptionConfiguration
All Implemented Interfaces:
ShowInitializable

public class CaptionConfiguration extends Object implements ShowInitializable
  • Field Details

  • 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

      public CaptionConfiguration setIconHoverColor(javafx.scene.paint.Color iconHoverColor)
      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

      public CaptionConfiguration setButtonHoverColor(javafx.scene.paint.Color buttonHoverColor)
      set the background color of the buttons (except the close button)
      Parameters:
      buttonHoverColor - the color
    • setIconColor

      public CaptionConfiguration setIconColor(javafx.scene.paint.Color iconColor)
      Set the text/foreground color of the window controls
      Parameters:
      iconColor - the color
    • setCaptionHeight

      public CaptionConfiguration setCaptionHeight(int captionHeight)
      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

      public CaptionConfiguration useControls(boolean useControls)
      choose if you want to add you want to use these libraries controls or use your own

      Do 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

      public CaptionConfiguration setCaptionDragRegion(javafx.scene.Node captionDragRegion)
      Specify the Node defining the draggable area
      Parameters:
      captionDragRegion - the Node
    • setCaptionDragRegion

      public CaptionConfiguration setCaptionDragRegion(DragRegion captionDragRegion)
      Specify a DragRegion to define where the window should be draggable
      Parameters:
      captionDragRegion - the DragRegion
    • setCaptionDragRegion

      public CaptionConfiguration setCaptionDragRegion(javafx.scene.control.MenuBar menuBar)
      Specify a MenuBar to define where the window should be draggable while excluding the buttons in the MenuBar
      Parameters:
      menuBar - the MenuBar
    • showInit

      public void showInit()
      Description copied from interface: ShowInitializable
      this function is designed to be called after Stage.show() has been called to configure customizations should only be called once per stage
      Specified by:
      showInit in interface ShowInitializable