-
Enhancement
-
Resolution: Withdrawn
-
P4
-
7u6
Layout builders should be enhanced by additional convenience methods,they are hard to use in current state (see RT-16569).
Similar convenience methods are present in their respective layout classes:
*GridPaneBuilder*
addColumn(int columnIndex, Node... children)
addRow(int rowIndex, Node... children)
add(Node child, int columnIndex, int rowIndex)
add(Node child, int columnIndex, int rowIndex, int colspan, int rowspan)
*RegionBuilder*
maxSize(double width, double height)
minSize(double width, double height)
prefSize(double width, double height)
These will be inherited by all layout builders.
A also propose to add following convenience methods which don't have direct counterpart in layout classes (the constraints can be specified only by static methods there)
Adding these would enable us to add child with constraint to layout without having to hold a reference to it. e.g
Hbox h = HBoxBuilder.create().add(CircleBuilder.create...build(), margin).build();
instead of
Circle circle = CircleBuilder.create...build();
Hbox h = HBoxBuilder.create().children(circle).build();
Hbox.setMargin (circle, margin);
The proposed methods are:
*AnchorPaneBuilder*
add(Node child, Double topAnchor, Double rightAnchor, Double bottomAnchor, Double leftAnchor)
*BorderPaneBuilder*
add(Node child, Pos alignment)
add(Node child, Insets margin)
add(Node child, Pos alignment, Insets margin)
*FlowPaneBuilder*
add(Node child, Insets margin)
*GridPaneBuilder*
add(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment)
add(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment, Priority hgrow, Priority vgrow)
add(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment, Priority hgrow, Priority vgrow, Insets margin)
*HBoxBuilder*
add(Node child, Priority hgrow)
add(Node child, Insets margin)
add(Node child, Priority hgrow, Insets margin)
*StackPaneBuilder*
add(Node child, Pos alignment)
add(Node child, Insets margin)
add(Node child, Pos alignment, Insets margin)
*TilePaneBuilder*
add(Node child, Pos alignment)
add(Node child, Insets margin)
add(Node child, Pos alignment, Insets margin)
*VBoxBuilder*
add(Node child, Priority vgrow)
add(Node child, Insets margin)
add(Node child, Priority vgrow, Insets margin)
Similar convenience methods are present in their respective layout classes:
*GridPaneBuilder*
addColumn(int columnIndex, Node... children)
addRow(int rowIndex, Node... children)
add(Node child, int columnIndex, int rowIndex)
add(Node child, int columnIndex, int rowIndex, int colspan, int rowspan)
*RegionBuilder*
maxSize(double width, double height)
minSize(double width, double height)
prefSize(double width, double height)
These will be inherited by all layout builders.
A also propose to add following convenience methods which don't have direct counterpart in layout classes (the constraints can be specified only by static methods there)
Adding these would enable us to add child with constraint to layout without having to hold a reference to it. e.g
Hbox h = HBoxBuilder.create().add(CircleBuilder.create...build(), margin).build();
instead of
Circle circle = CircleBuilder.create...build();
Hbox h = HBoxBuilder.create().children(circle).build();
Hbox.setMargin (circle, margin);
The proposed methods are:
*AnchorPaneBuilder*
add(Node child, Double topAnchor, Double rightAnchor, Double bottomAnchor, Double leftAnchor)
*BorderPaneBuilder*
add(Node child, Pos alignment)
add(Node child, Insets margin)
add(Node child, Pos alignment, Insets margin)
*FlowPaneBuilder*
add(Node child, Insets margin)
*GridPaneBuilder*
add(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment)
add(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment, Priority hgrow, Priority vgrow)
add(Node child, int columnIndex, int rowIndex, int columnspan, int rowspan, HPos halignment, VPos valignment, Priority hgrow, Priority vgrow, Insets margin)
*HBoxBuilder*
add(Node child, Priority hgrow)
add(Node child, Insets margin)
add(Node child, Priority hgrow, Insets margin)
*StackPaneBuilder*
add(Node child, Pos alignment)
add(Node child, Insets margin)
add(Node child, Pos alignment, Insets margin)
*TilePaneBuilder*
add(Node child, Pos alignment)
add(Node child, Insets margin)
add(Node child, Pos alignment, Insets margin)
*VBoxBuilder*
add(Node child, Priority vgrow)
add(Node child, Insets margin)
add(Node child, Priority vgrow, Insets margin)
- relates to
-
JDK-8101528 Problems creating scene graph with Builders
- Closed