Documentation of 'jvx.project.PjWorkshop' Java class
PjWorkshop ("JavaView Reference Manual")
"JavaView? v5.03.003"
jvx.project

Class PjWorkshop

    • 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.
      • 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.
      • setViewer

        public void setViewer(PvViewerIf viewer)
        Set the viewer manager when this workshop was launched.
        Specified by:
        setViewer 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.

"JavaView? v5.03.003"

"

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

Ads help maintain this website.