Skip to main content

net/java/bd/tools/logger rendering with bookmenu?

4 replies [Last post]
ken2006
Offline
Joined: 2008-07-22
Points: 0

Hi all,

I'm doing a test integration of the logger tool, into the bookmenu example. When bookmenu first starts up, I do see the logger flash quickly by before the bookmenu content begins rendering, but I cannot "bring back" the logger screen focus with the VKs (tried assigning HRcEvent.VK_LEFT and HRcEvent.VK_1) (testing with PowerDVD in this case).

Is this because GRIN renders over the top of what the logger draws, and if so is there a practical way to have the logger pause the GRIN render thread, or otherwise have the logger post-draw over each frame GRIN is outputting?

For reference, I'm init'g the logger in MenuXlet.initXlet, after engine.initialize(this);:

XletLogger.setXletContainer(scene);
XletLogger.setToggleKey(HRcEvent.VK_1);
XletLogger.log("Starting the xlet...");
XletLogger.setVisible(true);

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chihiro_saito
Offline
Joined: 2006-11-08
Points: 0

Hi,

XletLogger assumes that it's in control of the HScene, which is the xlet's root container. So it's a problem if the xlet starts drawing on HScene directly. I ported this tool from another project which this model made sense, but for various hdcookbook work where an xlet needs to have access to HScene, we're ending up using LwText component in logger instead of XletLogger itself.

Anyhow, in MenuXlet.animationInitialize()'s engine.initContainer() call, you can try passing in a new Container that's added to HScene instead of passing in the hscene itself. By doing so, the Animation Engine should draw on that Container instead of drawing on hscene and overwriting logger. Also pass in the same Container to XletLogger.setContainer() instead of hscene. I haven't tried this myself and would be interested to know if you succeed!

On a minor note, if the player is profile 2, I like to write logs on a socket so that the log can be viewed on another machine and saved.

Thanks,
Chihiro

ken2006
Offline
Joined: 2008-07-22
Points: 0

Chihiro,

I'm a little unclear if your advise was to add a new (Component)LwText to the new Container (or possibly add to HScene), or, not use LwText but just use XletLogger. (to keep its methods, visible, key etc). I guess I see a few way this can be done but my awt + grin knowledge is limited.

I've tried the following and get no animation at all (could be a NPE for all I know.. I'm lost without a console).

1) Declaring a new Container field in MenuXlet:
public Container root;

2) animationInitialize():
root = new Container();
scene.add(root);
engine.initContainer(root, bounds);

3) initXlet():
...
engine.initialize(this);
XletLogger.setXletContainer(root);
XletLogger.setToggleKey(HRcEvent.VK_1);
XletLogger.log("Starting the xlet...");
XletLogger.setVisible(true);

Thank you,
ken

ken2006
Offline
Joined: 2008-07-22
Points: 0

I just needed to:

root.setVisible(true);

after the engine.initContainer(root, bounds); call.

Thank you Chihiro!!!

Ken

chihiro_saito
Offline
Joined: 2006-11-08
Points: 0

Cool, glad that it worked.

Best,
Chihiro