jvx.project

## Class PjWorkshop

- java.lang.Object
- - jv.object.PsObject
  - - jvx.project.PjWorkshop

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf
  Direct Known Subclasses:
    PnCellOperator, PsExportInfo, PsModelInfo, PwBlocks, PwBoundary, PwCleanMesh, PwClip, PwEnergy, PwEvolve, PwExplode, PwGeodesic, PwGeodesicFlow, PwHistogram, PwHodge, PwIdentify, PwIntegralLine, PwIntegralLineSet, PwIntersectElementSet, PwIsoline, PwLIC, PwLocalButterfly, PwMarkWithSphere, PwMatching, PwModel, PwNoise, PwParameterLines, PwPlatonic, PwReeb, PwRefineElementSet, PwRefinePolygon, PwRotDiv, PwScalarField, PwSeeds, PwSimplify, PwSmooth, PwSnake, 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_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`

    - ### Fields inherited from interface jv.project.PjWorkshopIf

      `MODE_BUG, MODE_STANDARD, MODE_VALIDATE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PjWorkshop(java.lang.String aName)` Constructor with unique name.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `int` | `getMode()` Gets the mode in which this workshop runs.
    `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, that means only this workshop should be open.
    `boolean` | `isStandalone()` Check if current workshop is running standalone (default), that is, the workshop is not embedded inside another parent workshop.
    `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, that means only this workshop should be open.
    `void` | `setMode(int mode)` Sets the mode in which this workshop runs.
    `void` | `setStandalone(boolean flag)` Set flag if current workshop is running standalone (default), that is, the workshop is not embedded inside another parent workshop.
    `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 themselves as update listener of the geometry of this workshop. In order to prevent an update loop, this method safely 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 themselves.

    - #### 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 canceled.

      Subclasses frequently overwrite this method but are advised 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 advised 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`

    - #### isStandalone

          public boolean isStandalone()

      Check if current workshop is running standalone (default), that is, the workshop is not embedded inside another parent workshop.

      If workshop is standalone then update of geometry is triggered by geom#update() and setUpdateSender() technique. If workshop is not standalone but embedded inside a parent workshop, then this#update must be caught by parent workshop, and only the parent workshop is allowed to call geom#update.

      See Also:
        `setStandalone(boolean)`

    - #### setStandalone

          public void setStandalone(boolean flag)

      Set flag if current workshop is running standalone (default), that is, the workshop is not embedded inside another parent workshop.

      If workshop is standalone then update of geometry is triggered by geom#update() and setUpdateSender() technique. If workshop is not standalone but embedded inside a parent workshop, then this#update must be caught by parent workshop, and only the parent workshop is allowed to call geom#update.

      See Also:
        `isStandalone()`

    - #### getMode

          public int getMode()

      Gets the mode in which this workshop runs. Allows to select a debugging type mode.

      Most workshops do no use this method.

      Returns:
        either MODE_STANDARD for standard mode, or another mode.
      Since:
        JavaView 3.97.005
      See Also:
        `PjWorkshopIf.MODE_STANDARD`

    - #### setMode

          public void setMode(int mode)

      Sets the mode in which this workshop runs. Allows to select a debugging type mode.
      Specified by:
        `setMode` in interface `PjWorkshopIf`
      Parameters:
        `mode` - either MODE_STANDARD for standard mode, or MODE_BUG for debugging operations.
      Since:
        JavaView 3.97.005
      See Also:
        `PjWorkshopIf.MODE_STANDARD`

    - #### isModal

          public boolean isModal()

      Check if workshop runs modal, that means only this workshop should be open.
      Specified by:
        `isModal` in interface `PjWorkshopIf`
      See Also:
        `setModal(boolean)`

    - #### setModal

          public void setModal(boolean modal)

      Set flag if workshop runs modal, that means only this workshop should be open. 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.

"

The software JavaView? is copyright protected. All Rights Reserved.
"