Class StyleManager.NodeStyleManager

java.lang.Object
no.ntnu.principes.util.styles.StyleManager.NodeStyleManager
Enclosing class:
StyleManager

public static class StyleManager.NodeStyleManager extends Object
Inner class for chained styling operations on a single node. Provides a fluent API for applying multiple styling operations.
  • Constructor Details

    • NodeStyleManager

      public NodeStyleManager(javafx.scene.Node node)
      Creates a style manager for a specific node.
      Parameters:
      node - The node to style
  • Method Details

    • apply

      public StyleManager.NodeStyleManager apply(String... styles)
      Applies CSS style classes to the node.
      Parameters:
      styles - The style classes to apply
      Returns:
      This manager for method chaining
    • unapply

      public StyleManager.NodeStyleManager unapply(String... styles)
      Removes CSS style classes from the node.
      Parameters:
      styles - The style classes to remove
      Returns:
      This manager for method chaining
    • growHorizontal

      public StyleManager.NodeStyleManager growHorizontal(javafx.scene.layout.Priority priority)
      Sets the node to grow horizontally with the specified priority. Clears any existing horizontal constraints first.
      Parameters:
      priority - The growth priority
      Returns:
      This manager for method chaining
    • growVertical

      public StyleManager.NodeStyleManager growVertical(javafx.scene.layout.Priority priority)
      Sets the node to grow vertically with the specified priority. Clears any existing vertical constraints first.
      Parameters:
      priority - The growth priority
      Returns:
      This manager for method chaining
    • shrinkHorizontal

      public StyleManager.NodeStyleManager shrinkHorizontal()
      Sets the node to never grow horizontally.
      Returns:
      This manager for method chaining
    • shrinkVertical

      public StyleManager.NodeStyleManager shrinkVertical()
      Sets the node to never grow vertically.
      Returns:
      This manager for method chaining
    • grow

      Sets the node to grow in both directions.
      Returns:
      This manager for method chaining
    • shrink

      Sets the node to never grow in either direction.
      Returns:
      This manager for method chaining
    • padding

      public StyleManager.NodeStyleManager padding(double padding)
      Sets uniform padding on all sides of the node.
      Parameters:
      padding - The padding value to apply to all sides
      Returns:
      This manager for method chaining
    • padding

      public StyleManager.NodeStyleManager padding(double top, double right, double bottom, double left)
      Sets custom padding on each side of the node.
      Parameters:
      top - The top padding value
      right - The right padding value
      bottom - The bottom padding value
      left - The left padding value
      Returns:
      This manager for method chaining
    • padding

      public StyleManager.NodeStyleManager padding(javafx.geometry.Insets insets)
      Sets padding on the node using an Insets object.
      Parameters:
      insets - The Insets object defining the padding
      Returns:
      This manager for method chaining
    • padding

      public StyleManager.NodeStyleManager padding(double horizontal, double vertical)
      Sets symmetric padding on the node.
      Parameters:
      horizontal - The horizontal (left and right) padding value
      vertical - The vertical (top and bottom) padding value
      Returns:
      This manager for method chaining
    • margin

      public StyleManager.NodeStyleManager margin(double margin)
      Sets uniform margin on all sides of the node. Applies to both HBox and VBox containers.
      Parameters:
      margin - The margin value to apply to all sides
      Returns:
      This manager for method chaining
    • margin

      public StyleManager.NodeStyleManager margin(double top, double right, double bottom, double left)
      Sets custom margin on each side of the node. Applies to both HBox and VBox containers.
      Parameters:
      top - The top margin value
      right - The right margin value
      bottom - The bottom margin value
      left - The left margin value
      Returns:
      This manager for method chaining
    • margin

      public StyleManager.NodeStyleManager margin(javafx.geometry.Insets insets)
      Sets margin on the node using an Insets object. Applies to both HBox and VBox containers.
      Parameters:
      insets - The Insets object defining the margin
      Returns:
      This manager for method chaining
    • margin

      public StyleManager.NodeStyleManager margin(double horizontal, double vertical)
      Sets symmetric margin on the node.
      Parameters:
      horizontal - The horizontal (left and right) margin value
      vertical - The vertical (top and bottom) margin value
      Returns:
      This manager for method chaining