Node Annotation [was Re: Possible additions to JavaFX to facilitate forms and validations]

Mario Torre neugens.limasoftware at gmail.com
Tue Dec 6 08:56:44 PST 2011


Il giorno 06/dic/2011, alle ore 17:14, Richard Bair ha scritto:
> Hi Dan,
> 
> Probably we should split these two suggestions into different threads so we can keep track of tionthem better.
> 
>> *1. Node annotations*
> 
> A couple issues here to think about. First, how would the "annotation" be associated with the node? Since Nodes have no children (Parents do) it wouldn't be a child, in the scene graph sense, but it would be in how it is defined in paint order. That is, you want it to paint last. The picking code and such would need to be updated. Is the annotation outside the clip, if one exists on the node? Does it contribute to the bounds of the Node? If so we might have a contradiction to work through (the definition for boundsInLocal and boundsInParent would need massaging). Also I think for the use case you also will want annotations that can be beneath the Node.
> 
> Personally I'm not sure it makes sense to add this to every node. I imagine if there was some built in support on Control, plus some decorator pattern for other nodes, it will probably do the job without complicating the Node semantics. What do you think?


hi Richard, Daniel,

Is nice to see this kind of discussion :) and I think the idea of an annotation is quite interesting.

Speaking about the ideas, let's split the thread like you suggested, and let this be the Node Annotation thread :)

For the same reason outlined by Richard, I feel that an annotated Node would introduce an unnecessary (and optional) payload to each and every Node, cluttering the API, but the same addition to the Control could instead be quite elegant.

I wonder, though, if such thing cannot be simply done with a clever use of Groups, rather than introducing a specific API? After all, an annotation (in graphical terms) is nothing but a node/parent/control/group itself, in other words, this kind of functionality is implicit in the constructed scene graph hierarchy (you can annotate annotated groups, for example annotate an element with a preview of a html5 video both in form of annotated elements, annotate then again with a parental advisory sign or other disclaimers [1]), so the original proposal could be seen a way to make the process of creating such hierarchy smoother (rather than do this by hand all the time).

Cheers,
Mario

[1] Ok, such UI would be very terrible :) but you get the point


More information about the openjfx-dev mailing list