JavaView® v2.12

jvx.geom
Class PnMinesweeper

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jv.project.PjProject
              |
              +--jvx.geom.PnCellOperator
                    |
                    +--jvx.geom.PnMinesweeper
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.awt.event.KeyListener, PsTimeListenerIf, PsUpdateIf, PvPickListenerIf, java.lang.Runnable, java.io.Serializable

public class PnMinesweeper
extends PnCellOperator
implements java.awt.event.KeyListener

Minesweeper game on arbitrary polyhedral surfaces.

Version:
02.05.01, 2.00 revised (ur) moved to jvx.geom, restore original colors.
16.05.00, 1.00 created (ur)
Author:
Ulrich Reitebuch
See Also:
Serialized Form

Fields inherited from class jvx.geom.PnCellOperator
CORONA, LIFE, MAJORITY, NEIGHBOUR
 
Fields inherited from class jv.object.PsObject
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, NUM_TAGS
 
Constructor Summary
PnMinesweeper(PgElementSet anElementSet)
          Constructor
 
Method Summary
static PsDialog getDialog(PgElementSet geom)
           
 void init()
          Initialization
 void keyPressed(java.awt.event.KeyEvent e)
          Store, if shift key is pressed.
 void keyReleased(java.awt.event.KeyEvent e)
          Store, if shift key is pressed.
 void keyTyped(java.awt.event.KeyEvent e)
          Just to fullfill KeyListener interface.
 void pickInitial(PvPickEvent pos)
          Pick elementsto mark or unmark to be a mined element or to be a not mined element.
 void restoreColors()
          Restore element colors and names to the state before playing.
 void run()
          Just to disable PnCellOperator.run().
 void setExplodeDisplay(PvDisplayIf disp)
          Store Display.
 void setMines(int noMine)
          Get random positions for mines.
 void start()
          Just to disable PnCellOperator.start().
 void stop()
          Just to disable PnCellOperator.stop().
 boolean update(java.lang.Object event)
          Update the class whenever a child has changed.
 
Methods inherited from class jvx.geom.PnCellOperator
cellOperator, clear, compute, evaluate, getColor, getDialog, getNumStates, getState, makeCoronaInfluence, makeInfluence, makeNeighbourInfluence, markElement, markElement, markGlider, releasePick, requestPick, ruleOfLife, ruleOfMajority, setColor, setColors, setCurrLoop, setElementTags, setInfluence, setNumLoops, setNumStates, setOutputType, setRule
 
Methods inherited from class jv.project.PjProject
addDisplay, addGeometry, addGeometry, dispose, dragDisplay, dragInitial, dragVertex, fitDisplays, getAnimation, getDisplay, getDisplays, getGeometry, getGeometry, getNumGeometries, getParameter, getViewer, hasAnimation, hasDisplay, isEnabledAutoFit, markVertices, pickDisplay, pickVertex, removeDisplay, removeGeometries, removeGeometry, selectDisplay, selectGeometry, setAnimation, setDisplay, setEnabledAutoFit, setParameter, setTime, setViewer, unmarkVertices
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, updatePanels
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jv.anim.PsTimeListenerIf
getName
 
Methods inherited from interface jv.project.PvPickListenerIf
getName
 
Methods inherited from interface jv.object.PsUpdateIf
getFather, getName, setParent
 

Constructor Detail

PnMinesweeper

public PnMinesweeper(PgElementSet anElementSet)
Constructor
Method Detail

init

public void init()
Initialization
Overrides:
init in class PnCellOperator

setExplodeDisplay

public void setExplodeDisplay(PvDisplayIf disp)
Store Display.

update

public boolean update(java.lang.Object event)
Update the class whenever a child has changed. Method is usually invoked from the children.
Overrides:
update in class PnCellOperator
Following copied from interface: jv.object.PsUpdateIf
Parameters:
event - carries a lot of information
Returns:
true if event has been handled, otherwise false
See Also:
PsObject, PsUpdateIf.getFather(), PsUpdateIf.setParent(PsUpdateIf)

setMines

public void setMines(int noMine)
Get random positions for mines.

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Store, if shift key is pressed.
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Store, if shift key is pressed.
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Just to fullfill KeyListener interface.
Specified by:
keyTyped in interface java.awt.event.KeyListener

pickInitial

public void pickInitial(PvPickEvent pos)
Pick elementsto mark or unmark to be a mined element or to be a not mined element.
Overrides:
pickInitial in class PnCellOperator
Following copied from class: jv.project.PjProject
Parameters:
pos - Pick event issued by the display
See Also:
PvPickListenerIf

getDialog

public static PsDialog getDialog(PgElementSet geom)

restoreColors

public void restoreColors()
Restore element colors and names to the state before playing.
Overrides:
restoreColors in class PnCellOperator

start

public void start()
Just to disable PnCellOperator.start().
Overrides:
start in class PnCellOperator
Following copied from class: jv.project.PjProject
See Also:
PvViewerIf.start(), #isEnabledAutoFit(boolean)

stop

public void stop()
Just to disable PnCellOperator.stop().
Overrides:
stop in class PnCellOperator
Following copied from class: jv.project.PjProject
See Also:
PvViewerIf.stop()

run

public void run()
Just to disable PnCellOperator.run().
Overrides:
run in class PnCellOperator

JavaView® v2.12

The software JavaView® is copyright protected. All Rights Reserved.