java.lang.Object
no.ntnu.principes.util.styles.StyleManager.NodeStyleManager
- Enclosing class:
StyleManager
Inner class for chained styling operations on a single node.
Provides a fluent API for applying multiple styling operations.
-
Constructor Summary
ConstructorsConstructorDescriptionNodeStyleManager(javafx.scene.Node node) Creates a style manager for a specific node. -
Method Summary
Modifier and TypeMethodDescriptionApplies CSS style classes to the node.grow()Sets the node to grow in both directions.growHorizontal(javafx.scene.layout.Priority priority) Sets the node to grow horizontally with the specified priority.growVertical(javafx.scene.layout.Priority priority) Sets the node to grow vertically with the specified priority.margin(double margin) Sets uniform margin on all sides of the node.margin(double horizontal, double vertical) Sets symmetric margin on the node.margin(double top, double right, double bottom, double left) Sets custom margin on each side of the node.margin(javafx.geometry.Insets insets) Sets margin on the node using an Insets object.padding(double padding) Sets uniform padding on all sides of the node.padding(double horizontal, double vertical) Sets symmetric padding on the node.padding(double top, double right, double bottom, double left) Sets custom padding on each side of the node.padding(javafx.geometry.Insets insets) Sets padding on the node using an Insets object.shrink()Sets the node to never grow in either direction.Sets the node to never grow horizontally.Sets the node to never grow vertically.Removes CSS style classes from the node.
-
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
Applies CSS style classes to the node.- Parameters:
styles- The style classes to apply- Returns:
- This manager for method chaining
-
unapply
Removes CSS style classes from the node.- Parameters:
styles- The style classes to remove- Returns:
- This manager for method chaining
-
growHorizontal
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
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
Sets the node to never grow horizontally.- Returns:
- This manager for method chaining
-
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
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
Sets custom padding on each side of the node.- Parameters:
top- The top padding valueright- The right padding valuebottom- The bottom padding valueleft- The left padding value- Returns:
- This manager for method chaining
-
padding
Sets padding on the node using an Insets object.- Parameters:
insets- The Insets object defining the padding- Returns:
- This manager for method chaining
-
padding
Sets symmetric padding on the node.- Parameters:
horizontal- The horizontal (left and right) padding valuevertical- The vertical (top and bottom) padding value- Returns:
- This manager for method chaining
-
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
Sets custom margin on each side of the node. Applies to both HBox and VBox containers.- Parameters:
top- The top margin valueright- The right margin valuebottom- The bottom margin valueleft- The left margin value- Returns:
- This manager for method chaining
-
margin
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
Sets symmetric margin on the node.- Parameters:
horizontal- The horizontal (left and right) margin valuevertical- The vertical (top and bottom) margin value- Returns:
- This manager for method chaining
-