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

Interface PvViewerIf

  • All Superinterfaces:
    java.util.EventListener, java.awt.event.KeyListener, PsViewerIf
    All Known Implementing Classes:
    PvViewer


    public interface PvViewerIf
    extends PsViewerIf
    Interface for a viewer which manages the 3d-display, control window, and list of projects. PvViewer is a central class in JavaView and usually created at the beginning of an applet or application.

    Add one, or more, projects PjProject via method calls addProject((String, String, String [])), addProject(String, String, String, String []), or addProject(PjProject). Once a project has been registered this way, it may be selected by selectProject(String) to become the active project, i.e. its geometry is rendered in the display getDisplay(), and its panels may be made visible via the method showPanel(int).

    The 3d-display is be obtained from PvViewerIf by getDisplay() and can be included in a container, e.g. inside the applet or standalone frame.

    The control window may be slightly configured by showPanel(int).

    See Also:
    PvViewer, PsViewerIf
    Author:
    Konrad Polthier
    Version:
    08.04.00, 1.30 revised (kp) Methods related with frames of displays removed.
    02.04.00, 1.20 revised (kp) Added two methods to obtain applet and frame.
    12.06.99, 1.00 created (kp) Created the interface from the implementation jv.viewer.PvViewer.
    • Method Detail

      • getApplet

        java.applet.Applet getApplet()
        Get current applet. If running as application method returns applet inside frame.
      • getFrame

        java.awt.Frame getFrame()
        Get current frame if running as application.
      • getParameter

        java.lang.String getParameter(java.lang.String parmLabel)
        Get value of applet parameter. Calling this method avoids multiple getParameter(String) calls.

        The first call to getParameter() tries to read all parameters specified in m_applet.m_info from Html page. Reads parameters from the applet's HTML page. Format on Html page: <PARAM NAME="label" VALUE="some string">.

        Returns:
        value of string if string found, else null
        See Also:
        Applet.getParameterInfo(), Applet.getParameter(String)
      • getRecentGeometryFile

        java.lang.String getRecentGeometryFile()
        Deprecated. since JavaView 3.09.003, use PsJavaView.getFullFileName(int)
        Get the name including full path of the recently used geometry file. This information will be used as the default offer in some dialogs, for example, when exporting a geometry.
        Since:
        JavaView 2.43
      • setRecentGeometryFile

        void setRecentGeometryFile(java.lang.String model)
        Deprecated. since JavaView 3.09.003, use PsJavaView.setFullFileName(int, String)
        Set the name including full path of the recently used geometry file. This information will be used as the default offer in some dialogs, for example, when exporting a geometry.
        Since:
        JavaView 2.30
      • addProject

        boolean addProject(java.lang.String name,
                           java.lang.String className,
                           java.lang.String[] parmList)
        Registers the name and class of a project in the viewer in default category. Later the project must be selected by name to be instantiated and to become the active project in the environment. This method allows to pass a list of parameter strings to the project which may be parsed by the project, e.g. used to receive initial values from an Html page.
        Parameters:
        name - Unique name of project, used for identification and selection
        className - Class name of project, used for creation
        parmList - List of parameters, may be null.
        See Also:
        PsViewerIf.addProject(String, String, String, String []), hasProject(String), selectProject(String)
      • hasProject

        boolean hasProject(java.lang.String name)
        Check existence of a project instance with given name. If project is not found in project list, return false. Note, this method queries for instances of projects and not for project class names.
        See Also:
        hasProject(String), removeProject(String), selectProject(String)
      • removeProject

        boolean removeProject(java.lang.String aName)
        Deprecated. since JavaView 2.92.000, use PvViewer#removeProject(PjProject)
        Removes a registered project, project must be added again for further use.

        Project must be explicitly disposed using PjProject#dispose after calling the present method. Explicit disposal allows the individual project to clean-up its allocated resources.

        See Also:
        hasProject(String), selectProject(String)
      • selectProject

        boolean selectProject(java.lang.String aName)
        Selects a project to become the active project. Selection may be done via a direct call or interactively by choosing from the menu FILE-->LOAD. Each project must be added to the viewer before it becomes selectable.
        See Also:
        hasProject(String), removeProject(String)
      • getDisplay

        PvDisplayIf getDisplay()
        Make default display available outside, e.g. for inclusion in applet window. Just include the display inside the applet in a container.
        Returns:
        PvDisplayIf the default 3d-display
        See Also:
        getDisplays()
      • getDisplays

        PvDisplayIf[] getDisplays()
        Get array of registered displays.
        Returns:
        array of registered displays
        See Also:
        getDisplays()
      • newDisplay

        java.lang.String newDisplay()
        Create a new AWT display inside a new frame. Method is invoked from menus, name of display is automatically chosen. All geometries of currently selected display are added to new display. Display becomes the selected display in viewer. Note: Method is currently only used by PvDisplay, and method is included in this interface to separate PvDisplay from PvViewer.
        Returns:
        Automatically chosen name of new display
        See Also:
        newDisplay(String, boolean), newDisplay(String name, boolean bFrame, boolean bSelect)
      • newDisplay

        PvDisplayIf newDisplay(java.lang.String name)
        Deprecated. Use method newDisplay(String, boolean)
        Add new AWT display in a new frame.
        Parameters:
        name - Name of new display. If name is null, then default name is chosen.
        Returns:
        New display
        See Also:
        newDisplay(String, boolean)
      • newDisplay

        PvDisplayIf newDisplay(java.lang.String name,
                               boolean bFrame,
                               boolean bSelect)
        Create a new empty AWT display which is optionally placed inside a new frame. Optionally, this display becomes the selected display in this viewer.

        If a frame is allocated then the frame is not displayed and must be made visible in the application. The idea behind "not showing the frame" is as follows: if the frame is shown immediately then PvViewer must use a default window size and position. If the user would like to adjust this size, then he can do so only after the frame is already visible. Therefore, I do not show the frame in order to avoid instantaneous resizing.

        The display is added to the center of the frame. The frame may be obtained from the display via PvDisplayIf#getFrame().

        Parameters:
        name - Name of new display. If name is null, then default name is chosen.
        bFrame - If true then allocate a frame and add display to center.
        bSelect - If true then select this display as current display.
        Returns:
        New display
        See Also:
        newDisplay(), newDisplay(String, boolean), addDisplay(String, PvDisplayIf), PvDisplayIf.getFrame()
      • hasDisplay

        boolean hasDisplay(PvDisplayIf disp)
        Check for a registered display by display instance.
        Parameters:
        disp - display to be checked
        Returns:
        false if display is not registered.
        See Also:
        addDisplay(String, PvDisplayIf)
        Version:
        16.03.01, 1.50 revised (kp) Returned value change to boolean from String.
      • showDialog

        boolean showDialog(int dialog)
        Show dialogs as separate frames. Possible arguments jv.object.PsViewerIf.ABOUT etc.
        Possible arguments for dialogs are PsViewerIf.ABOUT, PsViewerIf.EXPORT_JVX etc, see static variables in PsViewerIf.
        Parameters:
        dialog - Integer identifier of dialog to be shown
        Returns:
        true if success, false if dialog class not found.
        See Also:
        getDialog(int), hideDialog(int)
      • showPanel

        boolean showPanel(int panel)
        Make panels visible. They appear either inside the control window or as separate frames, e.g. the control window appears as frame, and project, display, camera, and object panels as panels inside control frame. If panel has already been requested by a call to getPanel then a call to showPanel is void and returns false.
        Parameters:
        panel - Id of panel to be shown
        Returns:
        true if success, false if panel not found or used outside via method getPanel().
        See Also:
        getPanel(int)
      • setEnabledPanel

        boolean setEnabledPanel(int panel,
                                boolean cond)
        Enable or disable menu entry of panel.
        Parameters:
        panel - Id of panel to enable
        cond - If true, enables this panel's menu entry; if false, disables it.
        Returns:
        true if panel exists, otherwise false.
        See Also:
        showPanel(int)
        Version:
        25.07.03, 1.10 revised (kp) Renamed to setEnabledPanel() from enablePanel().
      • getPanel

        java.awt.Panel getPanel(int panel)
        Make panels available outside our environment, i.e. outside control panel and outside our direct influence. E.g. an applet may include a panel or it may create a separate frame for the panel.

        If a panel is requested via this method, then it will no longer be selectable via its menu entry in the control window neither by a call to method showPanel. Menu entries will be disabled but still visible.

        Parameters:
        panel - Id of requested panel
        Returns:
        Requested panel if it exists, otherwise null.
        See Also:
        showPanel(int)
        Version:
        10.10.03, 1.60 revised (kp) Return type changed back to Panel from PsPanel to prevent need for recompilation of old JARs.
        13.08.03, 1.50 revised (kp) Return type changed to PsPanel from Panel.
      • setGeometry

        void setGeometry(PgGeometryIf geom)
        Set current geometry whose inspector panels are display inside the control panel. Note: Method is currently only used by PvDisplay, and method is included in this interface to separate PvDisplay from PvViewer.
      • destroy

        void destroy()
        Called from an applet.destroy() method to perform clean-up when applet gets destroyed. Here we just close and dispose all control windows.
      • start

        void start()
        Start viewer, call start method of current project, and show control panel if requested.
        See Also:
        PjProject.start()
      • stop

        void stop()
        Stop viewer, call stop() method of current project, and close control panel if shown.
        See Also:
        PjProject.stop()
"JavaView? v5.03.003"

"

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

Ads help maintain this website.