Thread: Help in code

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    3
    Rep Power
    0

    Help in code


    Can anyone explain me what the following code means. Thanks

    public class camera extends Behavior
    {
    WakeupCriterion[ ] keyOrFrame =
    { new WakeupOnAWTEvent( KeyEvent.KEY_PRESSED ) ,
    new WakeupOnElapsedFrames( 0 ) } ;
    WakeupCondition stimulation = new WakeupOr( keyOrFrame ) ;

    public camera( )
    {

    }
    public void initialize( )
    {
    wakeupOn( stimulation ) ;
    }

    public void processStimulus( Enumeration criteria )
    {
    WakeupCriterion wakeup ;
    AWTEvent [ ] event = null ;


    while ( criteria.hasMoreElements( ) )
    {
    wakeup = (WakeupCriterion)criteria.nextElement( ) ;
    if ( wakeup instanceof WakeupOnAWTEvent )
    {
    event = ( (WakeupOnAWTEvent)wakeup ).getAWTEvent( ) ;
    if ( event != null )
    {
    for ( int i = 0 ; i < event.length ; i++ )
    {

    activateResponseToKey( (KeyEvent)event[ i ] ) ;
    }
    }
    }
    }
    wakeupOn( stimulation ) ;
    }
    }
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2003
    Posts
    778
    Rep Power
    12
    note without knowing what Behaviour is
    A lean and mean secure FTP applet with GUI. Just 150 kb in size
    http://www.radinks.com/sftp

IMN logo majestic logo threadwatch logo seochat tools logo