Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / January 2004

Tip: Looking for answers? Try searching our database.

Which WakeUpCondition

Thread view: 
Andr? Meyer - 21 Jan 2004 20:11 GMT
Hi,

I've got a problem using a WakeupCriterion. My scenegraph contains a
set of MorphBehaviors. Now I'd like them to invoke their
processStimulus() method if the control class says "lets go". But
which WakeUpCriterion should I use? I thought of WakeupOnAWTEvent, but
somewhere I read this works only with events like "Key_Pressed" and
not with an Action_Event. The best would be a boolean trigger var that
can be set to start the behavior's movement.

Thanks for helping me,
André
Tony Burrows - 28 Jan 2004 12:10 GMT
> Hi,
>
[quoted text clipped - 8 lines]
> Thanks for helping me,
> André

The problem is that you can't create your own wakeup conditions!  I hit
that one.  What I did was create a subclass of Behaviour, which can post
wakeup events (postId(int) ) and then use WakeupOnBehaviorPost.  My
control class invoked a method on the subclass, which then woke up the
behaviour I wanted.

The nice thing about this was that I could then use any conditions I
liked, which would call the controller and which then posted the
appropriate ID, eg

class Controller extends Behavior {
...
void requestPost(int postIdToSend){
    postId(postIdToSend;
}

AFAIK, the WakeupOnAWTEvent works with any AWT event, though I haven't
tried it.

Tony


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.