Skip to main content

Dragging SGGroup and dynamically adding nodes

2 replies [Last post]
andy_till
Offline
Joined: 2008-01-19

Hi all

I've run into some limitations in the API or maybe I just don't know how to implement this. The first is moving all nodes on a mouseDragged event in an SGGroup. I want to be able to move all my nodes on the panel like the dragging in google earth, is this possible?

Also scene graph doesn't seem very happy with adding nodes dynamically. Once setScene( ) is called thats it until the next time. Isn't it possible to just add nodes and then draw them when necessary?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Hans Muller

scenario@javadesktop.org wrote:
> Hi all
>
> I've run into some limitations in the API or maybe I just don't know how to implement this. The first is moving all nodes on a mouseDragged event in an SGGroup. I want to be able to move all my nodes on the panel like the dragging in google earth, is this possible?
>
If all of the nodes you want to drag are descendants of the same
SGGroup, then you can move them around by changing the offsets of a
SGTransform node which is the group's parent.

> Also scene graph doesn't seem very happy with adding nodes dynamically. Once setScene( ) is called thats it until the next time. Isn't it possible to just add nodes and then draw them when necessary?
>

Adding nodes dynamically should work; if you have an example that fails,
please send it along.

Thanks,
- Hans

> Thanks
> [Message sent by forum member 'andy_till' (andy_till)]
>
> http://forums.java.net/jive/thread.jspa?messageID=255079
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

andy_till
Offline
Joined: 2008-01-19

Right on both counts, my mistake was looking for an addChild method in SGPanel. I now have a dynamic, draggable hello world :)