----- Original Message -----
From: "Joao Manuel De Oliveira Francisco" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 11, 2001 8:21 AM
Subject: [JAVA3D] New kind of AWTEvent


> Hi everybody!!
> I think I'm getting close to finding a solution to the wakeup
condition
> problem I posted yesterday.
> I've tried to create a new kind of AWTEvent and wakeup on it,
but there
> seemd to be some kind of problem
> with the code.

What are the symptoms?

Do you propose to build a clock on the Container to trigger the
AWTEvent at time steps to match those of your simulation output
data table?

> Could someone please take a look at the code below and give
some hint.
>
>
> This is the new event class I created:
>
>
> public class TestEvent extends AWTEvent {
>   static int IDENTIFICATION=2000; // RESERVED_ID_MAX = 1999
>
>   public TestEvent(Object s) {
>
>     super(s,IDENTIFICATION);
>   }
> }
>
>
> This is the way I am trying to send the event:
> // I am using the container because it is the only class I
have found that
> dispatches
> // AWTEvents.
>
>     Container c = new Container();
>     c.dispatchEvent(new TestEvent(this)); // The this is used
as reference
> to the object
>                                           // that caused the
event
>
> This is how I am trying to catch the event:
>
> // Wake up condition
> final WakeupCondition w = new WakeupOnAWTEvent(2000);
>
> // Just writing a message when the event arrives
> public void processStimulus(Enumeration criteria){
>     System.out.println("The event arrived!!!");
>
>   }
>
> Thanks,
> Joao Francisco
>
> ***********************************************************
> *            JOAO MANUEL DE OLIVEIRA FRANCISCO            *
> *                                                         *
> *                [EMAIL PROTECTED]               *
> *              http://www.rnl.ist.utl.pt/~jmof            *
> *                                                         *
> *Licenciatura Engenharia Informatica e Computadores (LEIC)*
> *   Instituto Superior Tecnico (IST), Lisboa, Portugal.   *
> ***********************************************************
>
>
================================================================
===========
> To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body
> of the message "signoff JAVA3D-INTEREST".  For general help,
send email to
> [EMAIL PROTECTED] and include in the body of the message
"help".
>
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to