Extending Builders: Layout Builders

Dr. Michael Paus mp at jugs.org
Wed Nov 21 01:36:57 PST 2012


I would not want to change the transforms either. When you deal with 
matrices
you simply expect something like M[row][column] where the row comes first
and then the column and it would be very confusing if methods which deal
with matrices would use a different ordering of the parameters.

Why we have to use a reversed order when we deal with a GridPane for 
example is beyond me
but this is probably unchangeable now, so we will have to live with that 
schism. Just make
the builders consistent with their classes.

Michael

Am 21.11.2012 09:47, schrieb Pavel Safrata:
>
> On 21.11.2012 9:35, Dr. Michael Paus wrote:
>> Am 21.11.2012 09:19, schrieb Pavel Safrata:
>>> 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.
>>>>
>>>>
>>>
>>> In transforms we address matrix elements by "row, column".
>>>
>>> Pavel
>> It is probably too late to be really consistent. For example in
>> GridPane you have
>>
>>     add(Node child, int columnIndex, int rowIndex)
>>
>> whereas for the transforms you have "row, column" as Pavel has
>> pointed out.
>
> This is embarrassing. The transforms have not been released yet (the
> matrix features were added to 8.0), so we probably still can change
> the order. But users specifically requested this order as the usual one.
>
> Pavel
>
>>
>> The only thing you can and should do is to make at least the builders
>> consistent with the
>> class they build.
>>
>> Michael
>>
>


-- 
--------------------------------------------------------------------------------------
Dr. Michael Paus, Chairman of the Java User Group Stuttgart e.V. (JUGS).
For more information visit www.jugs.de.


More information about the openjfx-dev mailing list