Extending Builders: Layout Builders

Eva Krejcirova eva.krejcirova at oracle.com
Tue Dec 18 01:43:23 PST 2012


Hi,

Once again starting with this topic: since the original thread got 
hijacked, so now I am not sure - should I continue with this effort at 
all and add these methods to builders, or are we going to totally 
rewrite the way constraints are handled?

Regards,
Eva

On 21.11.2012 11:03, Eva Krejcirova wrote:
> On 20.11.2012 15:41, Richard Bair wrote:
>>> *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)
>> Do we  use columnIndex, rowIndex elsewhere? Usually I've seen "row, 
>> col", but "x, y", so it could go either way, but we should be 
>> consistent with elsewhere in the platform.
> I took the names and order of the arguments from the corresponding 
> methods in GridPane, so that its builder is consistent with it. Having 
> the order different in GrindPane and GridPaneBuilder would be 
> extremely confusing, I think.
>
>>> *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)
>> Can these be primitive doubles instead?
> AnchorPane uses Doubles,  so I used them in Builder too, but I can 
> surely change them to primitives.
>
> Eva



More information about the openjfx-dev mailing list