JavaView© v3.95.000

jvx.geom
Class PwShooter

java.lang.Object
  extended byjv.object.PsObject
      extended byjvx.project.PjWorkshop
          extended byjvx.geom.PwShooter
All Implemented Interfaces:
java.lang.Cloneable, PjWorkshopIf, PsUpdateIf, java.lang.Runnable, java.io.Serializable

public class PwShooter
extends PjWorkshop
implements java.lang.Runnable

The beginning of a small game....

Since:
JavaView 2.36
See Also:
Serialized Form

Field Summary
 
Fields inherited from class jv.object.PsObject
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
 
Constructor Summary
PwShooter()
           
 
Method Summary
 void init()
          Initialize and reset project, stops the running animation if any.
 void removeGeometry()
          Remove the assigned geometry and its backup clone.
 void reset()
          Reset this workshop to its initial state from which computations can start.
 void run()
           
 void setDisplay(PvDisplayIf disp)
          Set the active display when this workshop was launched.
 void setGeometry(PgGeometry geom)
          Assign a geometry on which this workshop operates, and create a backup clone of the geometry.
 boolean update(java.lang.Object object)
          Updates the geometry if this workshop has changed, i.e. if the event is this or null.
 
Methods inherited from class jvx.project.PjWorkshop
cancel, close, getDisplay, getDisplays, getGeometry, getSavedGeometry, getViewer, isModal, ok, setDisplays, setModal, setViewer
 
Methods inherited from class jv.object.PsObject
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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jv.object.PsUpdateIf
getFather, getName, setParent
 

Constructor Detail

PwShooter

public PwShooter()
Method Detail

init

public void init()
Description copied from class: PjWorkshop
Initialize and reset project, stops the running animation if any. Does not reset any registered display nor geometry. They must be reset individually in each subclass.

Overrides:
init in class PjWorkshop

setGeometry

public void setGeometry(PgGeometry geom)
Description copied from class: PjWorkshop
Assign a geometry on which this workshop operates, and create a backup clone of the geometry. The backup geometry is restored if the workshop is cancelled.

Subclasses frequently overwrite this method but are adviced to call this method.

Specified by:
setGeometry in interface PjWorkshopIf
Overrides:
setGeometry in class PjWorkshop
Parameters:
geom - the workshop modifies this geometry.

reset

public void reset()
Description copied from class: PjWorkshop
Reset this workshop to its initial state from which computations can start. This method calls init() but may use information about the registered geometry to do some further initialization.

A subclass may also want to reset a geometry to some initial state useful for this workshop, although, not always is the initial state of the geometry equivalent to the original state of the geometry, for example, if material properties of the geometry must be set specifically for this workshop. Therefore, this superclass does not restore the original duplicate of the geometry.

The reset method often is different from the init() method of a workshop since often the workshop needs information about the registered geometry to get into a working initial state.

Overrides:
reset in class PjWorkshop

setDisplay

public void setDisplay(PvDisplayIf disp)
Description copied from class: PjWorkshop
Set the active display when this workshop was launched.

Specified by:
setDisplay in interface PjWorkshopIf
Overrides:
setDisplay in class PjWorkshop

removeGeometry

public void removeGeometry()
Description copied from class: PjWorkshop
Remove the assigned geometry and its backup clone. Subclasses frequently overwrite this method but are adviced to call this method.

Overrides:
removeGeometry in class PjWorkshop

update

public boolean update(java.lang.Object object)
Description copied from class: PjWorkshop
Updates the geometry if this workshop has changed, i.e. if the event is this or null. Also propagates update() to superclass with the original argument event.

Some subclasses may register themself as update listener of the geometry of this workshop. In order to prevent an update loop, this method savely uses isUpdateSender() when updating the geometry.

Specified by:
update in interface PsUpdateIf
Overrides:
update in class PjWorkshop
Parameters:
object - sender of this update.
Returns:
true if update was correctly handled by superclass.

run

public void run()
Specified by:
run in interface java.lang.Runnable

JavaView© v3.95.000

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