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

Class PjProject

    • Constructor Detail

      • PjProject

        public PjProject(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
        Version:
        06.07.00, 1.10 revised (kp) No longer call project#stop() but still stop animation.
      • dispose

        public void dispose()
        Disconnect all links to other classes and prepare for deletion. After this call the object cannot be reinvoked using init().
      • start

        public void start()
        Method is invoked during loading of a project in JavaView.

        If a project has an animation object, then the animation panel is shown when the project's this start() method is invoked during loading of the project. Use setAnimation(PsAnimation) to register an animation.

        If auto fit is enabled then scenery is scaled to fit in each display.

        See Also:
        PvViewerIf.start(), isEnabledAutoFit()
      • stop

        public void stop()
        Stop all animations and auto-rotation in display. Hide animation panel, remove itself as pick listener from displays. The object can be reinvoked using init() and start().
        See Also:
        PvViewerIf.stop()
      • setBackColor

        public void setBackColor(java.awt.Color backCol)
        Assigned background color of project inspector.
        Parameters:
        backCol - background color of inspector.
        Since:
        JavaView 3.65.007
        Version:
        22.12.04, 1.00 created (kp)
      • setBorderType

        public void setBorderType(int borderType)
        Set border type of project inspector. If borderType==PsPanel.BORDER_NONE drawing is disabled, otherwise the borderType is set and drawing is enabled.
        Parameters:
        borderType - type of border, for possible values see PsPanel.
        Since:
        JavaView 3.65.007
        Version:
        22.12.04, 1.00 created (kp)
      • isEnabledAutoFit

        public boolean isEnabledAutoFit()
        Determine flag which determines whether scenery is scaled to fit display when start() is called. On default, auto fit is enabled.
        See Also:
        setEnabledAutoFit(boolean)
      • setEnabledAutoFit

        public void setEnabledAutoFit(boolean flag)
        Set flag which determines whether scenery is scaled to fit display when start() is called. On default, auto fit is enabled.
        See Also:
        isEnabledAutoFit()
      • getViewer

        public PvViewerIf getViewer()
        Get viewer. Viewer manages the 3d-displays, control window, and list of projects. It is the central class in JavaView, and usually created at the beginning of an applet or application. This instance variable gives access to PvViewer, e.g. to show/hide dialogs and panels.
        See Also:
        PsViewerIf, PvViewer
      • setViewer

        public void setViewer(PvViewerIf viewer)
        Set viewer for direct access to central dialogs, windows, and projects of JavaView. Viewer manages the 3d-displays, control window, and list of projects. It is the central class in JavaView, and usually created at the beginning of an applet or application. This instance variable gives access to PvViewer, e.g. to show/hide dialogs and panels.
        See Also:
        getViewer(), PvViewerIf, PvViewer
      • getParameter

        public java.lang.String getParameter(java.lang.String parmLabel)
        Get individual project parameter, must be have been assigned using setParameterInfo(String [][]).
        Author:
        Konrad Polthier
        Version:
        19.08.99, 1.10 revised (kp) Argument converted to lowercase prior to comparison.
      • getParameterInfo

        public java.lang.String[][] getParameterInfo()
        Interface used by design tools to show properties of applet. This method returns a list of string arrays, each of length 4 rather than 3 as suggest by Java. The additional string at third position contains the value of the parameter.
        Since:
        JavaView v4.70.018
        See Also:
        PvViewer.getParameter(String)
        Version:
        15.12.16, 1.00 created (kp) Takes over the role of applet#getParameterInfo if run standalone without applet.
      • setParameterInfo

        public void setParameterInfo(java.lang.String[][] parm)
        Set the array of project parameters.
        Version:
        15.12.16, 1.10 revised (kp) Renamed to setParameterInfo(String [][]) from setParameter(String [][]).
      • pickDisplay

        public void pickDisplay(PvPickEvent pos)
        Get a location in the display with 2d display and 3d world coordinates. Point may be independent of any geometry. This method does nothing and must be overwritten.
        Specified by:
        pickDisplay in interface PvPickListenerIf
        Parameters:
        pos - Pick event issued by the display
        See Also:
        PvPickListenerIf
      • pickInitial

        public void pickInitial(PvPickEvent pos)
        Pick an arbitrary point on a geometry, point may lie inside an element. This method does nothing and must be overwritten.
        Specified by:
        pickInitial in interface PvPickListenerIf
        Parameters:
        pos - Pick event issued by the display
        See Also:
        PvPickListenerIf
      • pickVertex

        public void pickVertex(PgGeometryIf geom,
                               int index,
                               PdVector vertex)
        Get a picked vertex of a geometry. This method does nothing and must be overwritten.
        Specified by:
        pickVertex in interface PvPickListenerIf
        Parameters:
        geom - Picked geometry on which vertex lies
        index - Index of vertex in vertex array of geometry
        vertex - 3d coordinates of vertex position
        See Also:
        PvPickListenerIf
      • markVertices

        public void markVertices(PvPickEvent markBox)
        Mark a set of vertices of a geometry within a given bounding box.
        Specified by:
        markVertices in interface PvPickListenerIf
        Parameters:
        markBox - contains four coplanar points on the bounding prism, and direction of prism.
      • unmarkVertices

        public void unmarkVertices(PvPickEvent markBox)
        Unmark a set of vertices of a geometry within a given bounding box.
        Specified by:
        unmarkVertices in interface PvPickListenerIf
        Parameters:
        markBox - contains four coplanar points on the bounding prism, and direction of prism.
      • addGeometry

        public boolean addGeometry(PgGeometryIf aGeometry)
        Register new geometry in project and the selected display. The display is updated after this call. This method simply calls addGeometry(aGeometry, true).
        Parameters:
        aGeometry - geometry to be added to this project and the current display.
        Returns:
        false if geometry was null or already registered in project.
        Author:
        Konrad Polthier
        Version:
        07.06.99, 2.13 revised (kp) Always select new geometry to force adding of info panels.
        07.06.99, 2.12 revised (kp) Check for null argument.
      • addGeometry

        public boolean addGeometry(PgGeometryIf aGeometry,
                                   boolean bUpdateDisplay)
        Register new geometry in project and the selected display, but do not update the display if not requested. If this method is used then a call like m_display.update(m_display) must be issued sometime when all geometries have been registered.

        Even if the geometry was previously added to this project, this method re-registers in the display since it might have been deleted in the display.

        The update of the display is performed only if the argument geometry is not already registered in the display.

        Parameters:
        aGeometry - geometry to be added to this project and the current display.
        bUpdateDisplay - flag whether display shall be updated when geometry is added.
        Returns:
        false if geometry was null or already registered in project.
        Author:
        Konrad Polthier
        Version:
        18.05.01, 1.10 revised (kp) Always refresh registration in display.
        17.12.00, 1.00 created (kp)
      • removeGeometry

        public void removeGeometry(PgGeometryIf aGeometry)
        Remove previously registered geometry from project and the selected display.
        Author:
        Konrad Polthier
        Version:
        09.06.99, 2.13 revised (kp) If selected geometry removed, select new one.
        07.06.99, 2.12 revised (kp) Check for null argument.
        06.06.99, 2.11 revised (kp) Bug removed: set m_geometry==null if no further registered geometries.
      • selectGeometry

        public void selectGeometry(PgGeometryIf aGeometry)
        Select registered geometry in the project and in the selected display.
        Specified by:
        selectGeometry in interface PvPickListenerIf
        Parameters:
        aGeometry - Now selected geometry of display.
        Author:
        Konrad Polthier
        Version:
        07.06.99, 2.12 revised (kp) Check for null argument.
        06.06.99, 2.11 revised (kp)
      • setGeometry

        public boolean setGeometry(PgGeometryIf geomNew)
        Interface method used by subclassed project to initialize the project geometry from outside the project, for example, during initialization or loading of the project.

        This method of PjProject does nothing and must be overwritten in order to be useful. Not all projects support this method.

        Parameters:
        geomNew - main geometry of this project.
        Since:
        JavaView 3.57.003
        Version:
        26.09.04, 1.00 created (kp)
      • removeGeometries

        public void removeGeometries()
        Remove all registered geometries from project and registered displays.
        Author:
        Konrad Polthier
        Version:
        31.07.04, 2.30 revised (kp) Improved removal of geometries.
        22.09.01, 2.20 revised (kp) Wrong argument of disp.update corrected. Geometry removed from display iff display contains geometry.
        06.06.99, 2.11 revised (kp)
      • getNumGeometries

        public int getNumGeometries()
        Get number of registered geometries of project.
        See Also:
        addGeometry(PgGeometryIf)
      • getGeometry

        public PgGeometryIf getGeometry(int anInd)
        Get a registered geometry with given index. Geometries are ordered like a vector, i.e. geometries added later have larger index. Index may change if geometries are removed.
        See Also:
        addGeometry(PgGeometryIf)
      • getGeometry

        public PgGeometryIf getGeometry()
        Get currently selected geometry of project. Subclasses should return the major geometry offered to other module projects.
        See Also:
        selectGeometry(PgGeometryIf)
      • setAnimation

        public void setAnimation(PsAnimation anAnimation)
        Assign the animation object where this listener is registered. This method is invoked by the animation object during registration of this listener, and usually is not required to be called by a user. If this listener has an assigned animation object, then its animation panel may be shown to change the current time of this listener.

        If this project has an animation object assigned in its constructor or init() method, then the animation panel is shown when the project's start() method is invoked during loading of the project.

        Only one animation object may be assigned to this listener. Subsequent assignments will replace the previous assignment.

        Specified by:
        setAnimation in interface PsTimeListenerIf
        See Also:
        getAnimation(), hasAnimation()
      • setTime

        public boolean setTime(PsTimeEvent time)
        Empty method, must be overwritten by subclasses to update dynamic object.
        Specified by:
        setTime in interface PsTimeListenerIf
      • fitDisplays

        public void fitDisplays()
        Scale the current camera in all displays such that geometry fills the display.
      • setDisplay

        public void setDisplay(PvDisplayIf disp)
        Register display in this project, add all geometries of project to the display, and register this project as pick listener in the display. The selected geometry of project will become the selected geometry in the display.

        Note, the automatic registrations can be avoided using alternatively the method addDisplay(PvDisplayIf) be called.

        See Also:
        addDisplay(PvDisplayIf)
      • getDisplay

        public PvDisplayIf getDisplay()
        Get currently selected display. Geometries, which are added to a project, are automatically added to the currently selected display.
        See Also:
        selectDisplay(PvDisplayIf)
      • selectDisplay

        public boolean selectDisplay(PvDisplayIf disp)
        Select a display to become the default display to which geometries are added. The selected display should be the main display of a project, and usually does not change during a program run. The selected display of a project does not change when the window focus is changed interactively - these are two different concepts.

        For example, method is called from PvViewer when display exists and project is selected, or when default display is requested from PvViewer from somewhere else.

        See Also:
        setDisplay(PvDisplayIf)
      • addDisplay

        public boolean addDisplay(PvDisplayIf display)
        Register a new display, e.g. to be deleted when project is removed.

        Note: this project is not registered as pick listener in display neither are any geometries automatically registered in display. This registration must all be done by hand, or alternatively the method setDisplay(PvDisplayIf) be called.

        Returns:
        false if instance already registered.
        See Also:
        setDisplay(PvDisplayIf), getDisplays(), removeDisplay(PvDisplayIf)
      • getDisplays

        public java.util.Enumeration getDisplays()
        Get all registered displays as enumeration.
        Returns:
        Enumeration of registered displays, null if no displays found.
        See Also:
        addDisplay(PvDisplayIf)
      • removeDisplay

        public boolean removeDisplay(PvDisplayIf display)
        Remove a display from the list of registered displays. Geometries of this project, which are registered in the display, will remain registered in the display.
        Parameters:
        display - display to be removed
        Returns:
        false if display is not registered, or is null.
        See Also:
        addDisplay(PvDisplayIf), hasDisplay(PvDisplayIf)
        Version:
        28.11.02, 1.10 revised (kp) Selected display changed if necessary.
"JavaView? v5.03.003"

"

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

You see the box below because you did not login.