Extending Builders: Layout Builders
Tom Schindl
tom.schindl at bestsolution.at
Thu Nov 29 12:31:48 PST 2012
Am 29.11.12 20:32, schrieb Tom Eugelink:
> On 2012-11-29 20:25, Tom Schindl wrote:
>> Am 29.11.12 19:42, schrieb Tom Eugelink:
>> I think storing the constraint on the owner is not a good idea because
>> you don't have an API for e.g. bulk-operations. The
>> Layout#add(Node,Constraint) API should only be a convenience one for
>> developers.
>
> Can you give an example of such bulk operations?
>
> Tom
>
box.getChildren().set(nodes);
box.getChildren().addAll(nodes);
box.getChildren().addAll(10, nodes);
For single adds I think the add on the node is fine for convenience but
it hides a but what really happens (the add on the underlying list). I
know many people are used to this because this allows them to send
notifications in JavaBean world but this is not needed on JavaFX because
all and everything can be observed (property/list).
Given Richards comments:
a) performance is mportant
b) Node already has layout-attributes so why not adding one more
The only thing that storing of the constraint on the node we can't cover
is that it can have different constraints on different layout
containers. I don't know how common this is but I'd say a user has to
deal with this situation and reassign a layout data when he moves the
node from container a to container b.
Tom
--
B e s t S o l u t i o n . a t EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl geschäftsführer/CEO
------------------------------------------------------------------------
eduard-bodem-gasse 5-7/1 A-6020 innsbruck fax ++43 512 935833
http://www.BestSolution.at phone ++43 512 935834
More information about the openjfx-dev
mailing list