> Events are projected through the scenegraph. If you click on a
> rectangle it will get the mouse event. If the rectangle doesn't have
> blocksMouse:true set then the event will also go to the nodes below
> it. This is essentially bubbling. You can then register event handlers
> for the events you actually care about on the nodes that receive
> them. What JavaFX doesn't have yet is a way to receive global events.
> For example, all right clicks in the app to implement a global context
> menu. Or low level keyboard events to the entire window, regardless of
> which component has the focus. The are RFEs filed for these use cases,
> so we should get them in a future release.
> If you click on a rectangle it will get the mouse event. If the rectangle
> doesn't have
> blocksMouse:true set then the event will also go to the nodes below
> it. This is essentially bubbling. You can then register event handlers
> for the events you actually care about on the nodes that receive
> them
blocksMouse is that the key thing to enable bubbling? When you say
down? Which direction
does the event travel? Or is that just some special thing for mouse
clicks. Consider declaring
the bubbling on the event itself, then it doesn't require components
declare that specially for
each event. For example,
new MouseEvent( 'someEvent', bubbling = true ); // this one travels
up the parent chain
new MouseEvent('someEvent', bubbling = false ); // this one only
dispatches listeners at this level.
Bear in mind that bubbling would solve your global event issues with
the entire window.
Bubbling does have performance considerations which might mean
keyboard events
can't bubble. I believe this is part of the reason Swing abandoned
bubbling because if
you blast a ton of events that bubble you get performance problems.
In Swing all events
bubbled, originally, and you couldn't change that. However, you
can solve that by selectively bubbling events as described above.
Keyboard events might
not bubble, but other less frequent ones do. I think that's how Flash
got around these issues
by allowing events to bubble or not by their own choice.
Projected through the scene graph? Does that mean bubbling only works
in the
context of the scenegraph? Just be aware that Event system can
utilize the scenegraph
and in Flash it does as well, but it can exist outside it. Bubbling
will work without
the graph, but you have to set that up for yourself. How delegation
would happen. I would
encourage you to consider how events could work independent from the
scenegraph.
Container layout seems a little flimsy. In that every component will
work differently.
I would like to see JavaFx have some simple mechanisms that work in
all containers.
Like the parent-relative layouts I described. Top, Left, Right, Bottom
all specify where a
child is relative to the parent's edges. Simple. Centering would also
be a good thing to
have. centerX, centerY where those are relative offsets form the
parent and child's center.
Just food for thought.
Charlie
On Sep 22, 7:45 pm, Joshua Marinacci <[email protected]> wrote:
>
> >> Simpler layout rules. Flex doesn't have LayoutManagers. Swing's
>
> > Layout sucks in JavaFX right now. JFXtra's offers some assistance
> > here with a Grid and MigLayout layout helpers, but its a priority I
> > believe for the team.
>
> Actually, the layout mechanism and API is great. We threw away layout
> managers and went to a container managed system. You also have the
> option for absolute positioning, and a few in-between cases. The
> reason why layout seems crappy right now is because we have so few
> built in containers. That's something we are actively working on.
> Expect more containers and components in future releases.
>
>
>
> >> Finally Flex data structures work with their UI toolkits out of the
> >> box. Why don't we have a ListModel that implements the List
> >> interface
> >> yet? Why do Swing models suck so hard that you are constantly
> >> reinventing them for every project? Flex got it right where
> >> ArrayCollection and ICollection just work. JavaFX must be better in
> >> this area.
>
> > There aren't enough complex controls in JavaFX to know how this is
> > going to be handled. Josh? :)
>
> Swing's concept of a model is really an adapter class between your
> real data model and the UI control. In JavaFX we have binding instead
> of an adapter class.
>
> > From what I've seen over the past 10 months of working with JavaFX is
> > that
>
> > 1. It was initially quite immature
> > 2. It's rapidly improving
> > 3. The guys at Sun seem to 'get' it, and are working their butts off
> > to make it work.
> > 4. Version 1.3 might be the tipping point for 'real' apps - both with
> > controls and performance
> > 5. Java 7 (JDK 1.7), Jigsaw (whatever you wanna call it) might be the
> > thing that gets it to the Flash level startup times. <- That
> > statement is a statement of pure faith and hope.
>
> We are doing a ton of work on startup performance. Some of that will
> come in JDK 7 and some will be in further Java 6 update releases. We
> are also working on our alternate graphics stack which is much faster
> and fully hardware accelerated. Lots more to come.
>
> - Josh
>
>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---