## Class javaview

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - java.awt.Panel
      - - java.applet.Applet
        - - javaview

- All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, javax.accessibility.Accessible

      public class javaview
      extends java.applet.Applet
      implements java.lang.Runnable

  Applet runs javaview with possibility to load one or more geometry models for display. Many projects are pre-installed and may be invoked via menu FILE-->NEW PROJECT, applet parameters, and command line arguments.

  If Mathematica graphics is piped through stdin then javaview converts the input stream to a geometry object and displays it.

  JavaView may be started using pre-configured camera and display settings read from a file.

  See Also:
    `PvViewer`, Serialized Form
  Author:
    Konrad Polthier
  Version:
    31.03.20, 7.10 revised (kp) Assure display height when tool bar and monitor scale are active.
    23.04.17, 7.00 revised (kp) Z-height coloring and smooth lighting enabled as default; all javadoc errors removed.
    23.09.16, 6.10 revised (kp) Main method adjusted to hdpi handling.
    24.09.12, 6.00 revised (kp) Default model changed to torus from snail.
    05.01.07, 5.20 revised (kp) Allow multiple model files to be separated using ":".
    12.02.05, 5.10 revised (kp) Check for https connection too.
    24.07.04, 5.00 revised (kp) Loading of multiple geometry files at once implemented in application mode.
    09.01.04, 4.60 revised (kp) Adjust camera projection to dimension of geometry if no display options available.
    03.04.03, 4.50 revised (kp) New loader for initial launch image which works better with java+jar.
    02.04.03, 4.40 revised (kp) Immediately after launch of application check codebase parameter.
    03.03.03, 4.30 revised (kp) Show image during launch.
    11.06.02, 4.20 revised (kp) Ensure correct size of display area in a frame even when menu is included.
    15.02.02, 4.10 revised (kp) If background color is passed as command line or applet parameter, then assign it very early to applet and display as background color.
    25.01.02, 4.00 revised (kp) Keyframe animation made public.
    21.05.01, 3.60 revised (kp) In applet mode, do not prepend model name with codebase if protocol encountered.
    21.03.01, 3.50 revised (kp) Display options implemented.
    12.12.00, 3.10 revised (ur) Some changes in reading Mathematica from StdIn.
    17.11.00, 3.00 revised (kp) Registration of pick listeners implemented.
    29.09.00, 2.60 revised (kp) Replace default torus with snail.
    07.05.00, 2.50 revised (kp) Functionality of PaImportModel included.
    13.11.99, 2.01 revised (kp) Check if InputStream is ready.
    25.10.99, 2.00 revised (ur) Parsing of Mathematica graphics.
    24.10.99, 1.00 created (kp)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.awt.Component

      `java.awt.Component.BaselineResizeBehavior`

  - ### Field Summary

    - ### Fields inherited from class java.awt.Component

      `BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

    - ### Fields inherited from interface java.awt.image.ImageObserver

      `ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `javaview()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPickListener(PvPickListenerIf listener)` Add pick listener to receive pick events `PvPickEvent` to the default display.
    `void` | `destroy()` Does clean-up when applet is destroyed by the browser.
    `void` | `finalize()`
    `java.lang.String` | `getAppletInfo()` Interface of applet to inform about author, version, and copyright
    `java.awt.Dimension` | `getPreferredSize()` We need a preferred size such that the frame is able to estimate how many rows the menu bar will occupy.
    `java.awt.Rectangle` | `getSizeOfFrame()` Return a new allocated project instance.
    `PvViewer` | `getViewer()` Method added to have better access in J/Link.
    `void` | `init()` Initializes the applet and creates a thread that configures and initializes the viewer, loads system and user projects.
    `void` | `loadModel(java.lang.String fileName)` Load a model from one or more geometry files through JavaScript into a running JavaView applet.
    `static void` | `main(java.lang.String[] args)` Standalone application support.
    `void` | `paint(java.awt.Graphics g)` Print info while initializing applet and viewer, and draw background image.
    `boolean` | `removePickListener(PvPickListenerIf listener)` Remove a registered listener from list of registered listeners.
    `void` | `run()` Configure and initialize the viewer, load system and user projects.
    `void` | `startFromThread()` Start viewer, e.g. start animation if requested.
    `void` | `stop()` Stop viewer, e.g. stop animation if requested

    - ### Methods inherited from class java.applet.Applet

      `getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus, start`

    - ### Methods inherited from class java.awt.Panel

      `addNotify`

    - ### Methods inherited from class java.awt.Container

      `add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate`

    - ### Methods inherited from class java.awt.Component

      `action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### javaview

          public javaview()

  - ### Method Detail

    - #### getViewer

          public PvViewer getViewer()

      Method added to have better access in J/Link.
      Returns:
        current viewer object.

    - #### getAppletInfo

          public java.lang.String getAppletInfo()

      Interface of applet to inform about author, version, and copyright
      Overrides:
        `getAppletInfo` in class `java.applet.Applet`

    - #### getSizeOfFrame

          public java.awt.Rectangle getSizeOfFrame()

      Return a new allocated project instance.
      Returns:
        Standard medium sized JavaView display.

    - #### init

          public void init()

      Initializes the applet and creates a thread that configures and initializes the viewer, loads system and user projects.
      Overrides:
        `init` in class `java.applet.Applet`

    - #### run

          public void run()

      Configure and initialize the viewer, load system and user projects. If a geometry model is given as applet parameter or command line argument then geometry is loaded. Depending on other parameters a panel for browsing geometry files may be shown close to the display.

      This method may not be called before applet.init().

      Specified by:
        `run` in interface `java.lang.Runnable`
      Version:
        25.01.02, 3.00 revised (kp) Keyframe animation made public.
        08.10.01, 2.00 revised (kp) No longer set codebase taken from applet.

    - #### main

          public static void main(java.lang.String[] args)

      Standalone application support. The main() method acts as the applet's entry point when it is run as a standalone application. It is ignored if the applet is run from within an HTML page.
      Parameters:
        `args` - command line arguments
      Version:
        29.01.04, 2.30 revised (kp) Codebase setting moved to PvViewer since all application must check license.
        02.04.03, 2.20 revised (kp) Immediately after launch check codebase parameter.
        09.12.01, 2.15 revised (kp) Initial position specified again.
        18.03.01, 2.10 revised (kp) No automatic resize if displayFile available.

    - #### loadModel

          public void loadModel(java.lang.String fileName)

      Load a model from one or more geometry files through JavaScript into a running JavaView applet. All existing geometries in the display will be removed.

      Model argument may contain multiple filenames separated by ';'. All file names must by given relative to the model codebase.

      Method is intended for use from JavaScript. Therefore, the current codebase will be prepended to the given relative filename.

      Parameters:
        `fileName` - relative fileName.
      Since:
        JavaView v3.89.005
      Version:
        24.05.05, 1.00 created (kp)

    - #### getPreferredSize

          public java.awt.Dimension getPreferredSize()

      We need a preferred size such that the frame is able to estimate how many rows the menu bar will occupy.
      Overrides:
        `getPreferredSize` in class `java.awt.Container`

    - #### paint

          public void paint(java.awt.Graphics g)

      Print info while initializing applet and viewer, and draw background image.
      Overrides:
        `paint` in class `java.awt.Container`
      Version:
        22.07.03, 2.10 revised (kp) Ensure existence of m_drawString.

    - #### addPickListener

          public void addPickListener(PvPickListenerIf listener)

      Add pick listener to receive pick events `PvPickEvent` to the default display.
      Parameters:
        `listener` - will receive pick events of this applet.
      See Also:
        `removePickListener(PvPickListenerIf)`

    - #### removePickListener

          public boolean removePickListener(PvPickListenerIf listener)

      Remove a registered listener from list of registered listeners.
      Parameters:
        `listener` - previously registered listener.
      Returns:
        `false` if listener does not exists.
      See Also:
        `addPickListener(PvPickListenerIf)`

    - #### destroy

          public void destroy()

      Does clean-up when applet is destroyed by the browser. Here we just close and dispose all our control windows.
      Overrides:
        `destroy` in class `java.applet.Applet`

    - #### stop

          public void stop()

      Stop viewer, e.g. stop animation if requested
      Overrides:
        `stop` in class `java.applet.Applet`

    - #### finalize

          public void finalize()
                        throws java.lang.Throwable

      Overrides:
        `finalize` in class `java.lang.Object`
      Throws:
        `java.lang.Throwable`

    - #### startFromThread

          public void startFromThread()

      Start viewer, e.g. start animation if requested. Necessary, if initialization is done in a separate thread. In this case the original applet.start() has no effect.
      Version:
        20.05.05, 2.00 revised (kp) Batch processing implemented.

"

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