public class PnMinesweeper extends PnCellOperator implements java.awt.event.KeyListener
CORONA, LIFE, MAJORITY, NEIGHBOUR
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_TAGS
MODE_BUG, MODE_STANDARD, MODE_VALIDATE
Constructor and Description |
---|
PnMinesweeper()
Constructor
|
PnMinesweeper(PgElementSet geom)
Deprecated.
use constructor prj=new PwMinesweeper();prj.setGeometry(geom);prj.reset();
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Remove pick focus and update from minesweeper, reset elementSet's colors to
previous state.
|
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 fulfill KeyListener interface.
|
void |
pickInitial(PvPickEvent pos)
Pick elements to mark or unmark a mined element or to be a not mined element.
|
void |
reset()
Reset workshop and geometry to original state.
|
void |
restoreColors()
Restore element colors and names to the state before playing.
|
void |
run()
Explode the geometry if a mined element is hit.
|
void |
setDisplay(PvDisplayIf display)
Store currently active display.
|
void |
setExplodeDisplay(PvDisplayIf disp)
Deprecated.
use setDisplay(PvDisplayIf)
|
void |
setGeometry(PgElementSet geom)
Store the PgElementSet to play upon and backup some of its properties.
|
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.
|
cellOperator, clear, compute, dragDisplay, dragInitial, dragVertex, evaluate, getColor, getNumLoops, getNumStates, getState, makeCoronaInfluence, makeInfluence, makeNeighbourInfluence, markElement, markElement, markGlider, markVertices, pickDisplay, pickVertex, releasePick, requestPick, ruleOfLife, ruleOfMajority, selectGeometry, setColor, setColors, setCurrLoop, setElementTags, setInfluence, setInfluence, setNumLoops, setNumStates, setOutputType, setRule, setRule, unmarkVertices
cancel, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, openDialog, removeGeometry, setDisplays, setGeometry, setModal, setMode, setStandalone, setViewer
addInspector, 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, updatePanels
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
getFather, getName, setParent
public PnMinesweeper()
public PnMinesweeper(PgElementSet geom)
public void init()
init
in class PnCellOperator
public boolean update(java.lang.Object event)
update
in interface PsUpdateIf
update
in class PnCellOperator
event
- sender of this update.PsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
public void setGeometry(PgElementSet geom)
setGeometry
in class PnCellOperator
public void close()
close
in class PnCellOperator
public void reset()
reset
in class PnCellOperator
public void setExplodeDisplay(PvDisplayIf disp)
public void setDisplay(PvDisplayIf display)
setDisplay
in interface PjWorkshopIf
setDisplay
in class PjWorkshop
public void setMines(int noMine)
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
public void pickInitial(PvPickEvent pos)
This method fully overwrites the superclass method.
pickInitial
in interface PvPickListenerIf
pickInitial
in class PnCellOperator
pos
- Pick event issued by the displayPvPickListenerIf
public void run()
run
in interface java.lang.Runnable
run
in class PnCellOperator
public void restoreColors()
restoreColors
in class PnCellOperator
public void start()
start
in class PnCellOperator
public void stop()
stop
in class PnCellOperator
"