Updating ViewingComponent

Have jReality programming problems or questions? Post them here.
Post Reply
gorgm
Posts: 2
Joined: Mon 6. Sep 2010, 15:46

Updating ViewingComponent

Post by gorgm » Mon 6. Sep 2010, 16:03

hey,

i've a problem using JRViewer in my RichClient Application. I got so far extracting the viewingComponent and adding it to my View. During initializing my panel, i create a sceneGraphComponent without any children and set it as content for my viewer.

now i need to add children during runtime to the rootComponent. This works fine as well, but the viewer does not update itself. So i can't see the new components in my application.
I tried to repaint the viewingComponent to force an update, but this didn't work either and the viewer itself has no update() method.

setting a sceneGraphComponent which already has children as content before startup works fine. but this is not what i need, i need to be able to change the scenegraph during runtime and the view need to by synchronal with the scenegraph.

Well, sorry for possible lacks of explanation. Hope, someone can offer a suggestion.

Best regards,

gorgm

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: Updating ViewingComponent

Post by steffen » Mon 6. Sep 2010, 17:13

Hi, you need to call the render method on the Viewer. How did you create the panel?

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: Updating ViewingComponent

Post by steffen » Mon 6. Sep 2010, 17:21

Sorry, I just saw you are using JRViewer. So, here is how you obtain the viewer:

Code: Select all

JRViewer jrv = ...;
// configure jrv
panel = jrv.startupLocal();
Viewer v = jrv.getPlugin(View.class).getViewer();
Then you can call

Code: Select all

v.render()
whenever your scene has changed.

But it looks strange that the rendering isn't done automatically whenever you modify the scene. Can you give more details on your setup, what -D... parameters do you pass and how do you configure the JRViewer?

gorgm
Posts: 2
Joined: Mon 6. Sep 2010, 15:46

Re: Updating ViewingComponent

Post by gorgm » Mon 6. Sep 2010, 17:59

hey, thanks for the quick answer.

everything works fine. you are right, the viewer updates itself.
I just didn't thought of encompassing. So everything got displayed, but i couldn't see it, because i wasn't encompassed.

So hope this won't happen again.
thanks

gorgm

Post Reply