com.hdcookbook.grinxlet
Class GrinXlet

java.lang.Object
  extended by com.hdcookbook.grinxlet.GrinXlet
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class GrinXlet
extends java.lang.Object
implements java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

This is a facade to the main controller in GrinView. It allows GrinView emulation of some of the features of the GrinXlet class found in xlets/grin_samples/GenericGame. This GrinView facade implements a subset of those methods, so any public methods added here must be present in the real xlet versions of GrinXlet.

In other words, the reason why a GrinView version of this class exists is so that a Director subclass can refer to it, and still work under GrinView.

If your project extends GameXlet, you'll probably want an se_src version of your extension for use with GrinView. This GrinView version of your extension should look like this:

    public class MyGameXlet extends GameXlet {

         public MyGameXlet() {
           }

         ...
    }
 


Constructor Summary
protected GrinXlet()
          This constructor is for a subclass of GrinXlet.
  GrinXlet(GenericMain grinView)
          This constructor is used by GrinView
 
Method Summary
 AnimationClient[] getAnimationClients()
          Get the list of animation clients
 AnimationEngine getAnimationEngine()
          Get the animation engine
static GrinXlet getInstance()
          Get the instance of this singleton.
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent arg0)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent arg0)
           
 void mouseEntered(java.awt.event.MouseEvent arg0)
           
 void mouseExited(java.awt.event.MouseEvent arg0)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent arg0)
           
 void mouseReleased(java.awt.event.MouseEvent arg0)
           
 Show popKeyInterest()
          Removes the show at the top of the key interest stack.
 void pushKeyInterest(Show show)
          Inserts a new Show at the top of the key interest stack.
 void resetAnimationClients(AnimationClient[] clients)
          Reset the list of animation clients
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrinXlet

public GrinXlet(GenericMain grinView)
This constructor is used by GrinView


GrinXlet

protected GrinXlet()
This constructor is for a subclass of GrinXlet.

Method Detail

getInstance

public static GrinXlet getInstance()
Get the instance of this singleton.


getAnimationClients

public AnimationClient[] getAnimationClients()
Get the list of animation clients


resetAnimationClients

public void resetAnimationClients(AnimationClient[] clients)
Reset the list of animation clients


getAnimationEngine

public AnimationEngine getAnimationEngine()
Get the animation engine


pushKeyInterest

public void pushKeyInterest(Show show)
Inserts a new Show at the top of the key interest stack. KeyEvents are delivered to the shows starting from the top of the key interest stack. If the show's currently active segment do not have any rc_handler that uses the key, then the the event is sent to the next show on the stack. MouseEvents are sent to all the shows in the key interest list.


popKeyInterest

public Show popKeyInterest()
Removes the show at the top of the key interest stack. KeyEvents are delivered to a show in the order starting from the top of the key interest stack. If the show's currently active segment do not have any rc_handler that uses the key, then the the event is sent to the next show on the stack. MouseEvents are sent to all the shows in the key interest list.


keyTyped

public void keyTyped(java.awt.event.KeyEvent arg0)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent arg0)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent arg0)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent arg0)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent arg0)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent arg0)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener