JavaView© v3.95.000

jvx.project
Class PjWorkshop

java.lang.Object
  extended byjv.object.PsObject
      extended byjvx.project.PjWorkshop
All Implemented Interfaces:
java.lang.Cloneable, PjWorkshopIf, PsUpdateIf, java.io.Serializable
Direct Known Subclasses:
PjEnergy, PjEvolve, PnCellOperator, PsExportInfo, PsModelInfo, PwBlocks, PwBoundary, PwCleanMesh, PwClip, PwExplode, PwGeodesic, PwHodge, PwIntegralLines, PwIntersectElementSet, PwIsoline, PwLIC, PwLocalButterfly, PwMarkWithSphere, PwMatching, PwModel, PwNoise, PwParameterLines, PwPlatonic, PwReeb, PwRefineElementSet, PwRefinePolygon, PwRotDiv, PwScalarField, PwShooter, PwSimplify, PwSingleIntegralLine, PwSmooth, PwTexture, PwTopology, PwTransform, PwUnfold, PwVectorField

public abstract class PjWorkshop
extends PsObject
implements PjWorkshopIf

This superclass of workshops provides several frequently used methods such as setGeometry(), ok(), close(), reset() and cancel(). It also simplifies the integration of workshop info panels and dialogs.

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
PjWorkshop(java.lang.String aName)
          Constructor with unique name.
 
Method Summary
 void cancel()
          Cancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.
 void close()
          Close workshop and remove itself as listener from various classes.
 PvDisplayIf getDisplay()
          Get the active display when this workshop was launched.
 java.util.Vector getDisplays()
          Get the list of displays.
 PgGeometry getGeometry()
          Get the assigned geometry on which this workshop operates.
 PgGeometry getSavedGeometry()
          Get clone of originally assigned geometry.
 PvViewerIf getViewer()
          Get the viewer manager when this workshop was launched.
 void init()
          Initialize and reset project, stops the running animation if any.
 boolean isModal()
          Check if workshop runs modal.
 void ok()
          Accept current version of the geometry as new version.
 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 setDisplay(PvDisplayIf display)
          Set the active display when this workshop was launched.
 void setDisplays(java.util.Vector dispList)
          Assign the list of displays.
 void setGeometry(PgGeometry geom)
          Assign a geometry on which this workshop operates, and create a backup clone of the geometry.
 void setModal(boolean modal)
          Set flag if workshop runs modal.
 void setViewer(PvViewerIf viewer)
          Set the viewer manager when this workshop was launched.
 boolean update(java.lang.Object event)
          Updates the geometry if this workshop has changed, i.e. if the event is this or null.
 
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

PjWorkshop

public PjWorkshop(java.lang.String aName)
Constructor with unique name.

Method Detail

init

public void init()
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 PsObject

update

public boolean update(java.lang.Object event)
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 PsObject
Parameters:
event - sender of this update.
Returns:
true if update was correctly handled by superclass.
See Also:
PsObject.setParent(PsUpdateIf), PsObject.getFather(), PsObject.addUpdateListener(PsUpdateIf)

getSavedGeometry

public PgGeometry getSavedGeometry()
Get clone of originally assigned geometry. Subclasses may sometimes want to reset the current geometry by themself.


getGeometry

public PgGeometry getGeometry()
Get the assigned geometry on which this workshop operates.

Specified by:
getGeometry in interface PjWorkshopIf

setGeometry

public void setGeometry(PgGeometry geom)
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
Parameters:
geom - the workshop modifies this geometry.

removeGeometry

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


getViewer

public PvViewerIf getViewer()
Get the viewer manager when this workshop was launched.

Specified by:
getViewer in interface PjWorkshopIf

setViewer

public void setViewer(PvViewerIf viewer)
Set the viewer manager when this workshop was launched.

Specified by:
setViewer in interface PjWorkshopIf

getDisplay

public PvDisplayIf getDisplay()
Get the active display when this workshop was launched.

Specified by:
getDisplay in interface PjWorkshopIf

setDisplay

public void setDisplay(PvDisplayIf display)
Set the active display when this workshop was launched.

Specified by:
setDisplay in interface PjWorkshopIf

getDisplays

public java.util.Vector getDisplays()
Get the list of displays.

Specified by:
getDisplays in interface PjWorkshopIf

setDisplays

public void setDisplays(java.util.Vector dispList)
Assign the list of displays.

Specified by:
setDisplays in interface PjWorkshopIf

isModal

public boolean isModal()
Check if workshop runs modal.

Specified by:
isModal in interface PjWorkshopIf
See Also:
setModal(boolean)

setModal

public void setModal(boolean modal)
Set flag if workshop runs modal. If a workshop runs modal then it does not listen to changes of the registered geometries or displays. By default a workshop runs modal.

Specified by:
setModal in interface PjWorkshopIf
See Also:
isModal()

reset

public void reset()
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.


ok

public void ok()
Accept current version of the geometry as new version. Close workshop. The copy of the original geometry is ignored.

Implementation in this class calls close().


close

public void close()
Close workshop and remove itself as listener from various classes. The workshop will no longer be working after this call.

Subclasses may remove workshop from geometry as update listener, or remove any temporary geometries from display, if necessary.

Implementation in this class simply calls removeGeometry().


cancel

public void cancel()
Cancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.

If necessary, the duplicate of the original geometry is restored into the geometry. The update method of the geometry is called.


JavaView© v3.95.000

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