public class PwSnake extends PjWorkshop implements java.awt.event.KeyListener, java.lang.Runnable
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGSMODE_BUG, MODE_STANDARD, MODE_VALIDATE| Constructor and Description | 
|---|
| PwSnake()Constructor | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close()Remove key listener from display, reset elementSet
 to state before starting the game, and destroy dialog window. | 
| void | init()Resets all properties to default values. | 
| void | keyPressed(java.awt.event.KeyEvent e)Store, if "Right" or "Left" key is pressed. | 
| void | keyReleased(java.awt.event.KeyEvent e)Store, if "Right" or "Left" key is pressed. | 
| void | keyTyped(java.awt.event.KeyEvent e)Just to fullfill KeyListener interface. | 
| void | pause()Pauses the game. | 
| void | reset()Reset workshop and geometry to original state. | 
| void | resume()Resumes a paused game. | 
| void | run()Run the snake until it dies. | 
| void | setDisplay(PvDisplayIf display)Store currently active display. | 
| void | setGeometry(PgGeometry geom)Assign a geometry on which this workshop operates, | 
| void | start()Start snake game in separate thread. | 
| void | stop()Stop snake game in separate thread. | 
| boolean | update(java.lang.Object event)Update the class whenever a child has changed. | 
cancel, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, openDialog, removeGeometry, setDisplays, setModal, setMode, setStandalone, setVieweraddInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanelsequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFather, getName, setParentpublic void init()
init in class PjWorkshoppublic void setGeometry(PgGeometry geom)
setGeometry in interface PjWorkshopIfsetGeometry in class PjWorkshopgeom - the workshop modifies this geometry.public void reset()
reset in class PjWorkshoppublic boolean update(java.lang.Object event)
update in interface PsUpdateIfupdate in class PjWorkshopevent - sender of this update.PsObject.setParent(PsUpdateIf), 
PsObject.getFather(), 
PsObject.addUpdateListener(PsUpdateIf)public void setDisplay(PvDisplayIf display)
setDisplay in interface PjWorkshopIfsetDisplay in class PjWorkshoppublic void close()
close in class PjWorkshoppublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerpublic void start()
public void stop()
public void pause()
public void resume()
public void run()
run in interface java.lang.Runnable"