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

Class PvDisplay

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible, PsUpdateIf, PvDisplayIf


    public final class PvDisplay
    extends java.awt.Canvas
    implements PvDisplayIf, java.lang.Runnable, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.io.Serializable
    Display of JavaView for viewing and interaction with 3d geometries. The display is subclass of an AWT canvas and fulfills the interface PvDisplayIf. It may be included inside any Java container with any layout manager.

    A display may be obtained by three different ways:

    1. Simple applets may directly create a display, add a geometry, and call the instance methods of the display to configure it.
    2. A slightly advanced applet should obtain the default display from the central PvViewer instance using PvViewer#getDisplay(). This mechanism avoids any need to connect the geometry of the current project or viewer to the display.
    3. In some cases an applet or project may need additional displays.
    Simple applets may directly create a display and call its instance methods.

    Each class fulfilling the interface PvDisplayIf can serve as a display in JavaView.

    If the display is not added to an AWT container yet then external rendering does not work since this display has no Graphics yet.

    See Also:
    Serialized Form
    Author:
    Konrad Polthier
    Version:
    22.09.15, 8.90 revised (kp) Display of foreground image.
    23.11.14, 8.81 revised (kp) Special checks to assure a clean jvLite setup.
    23.11.14, 8.80 revised (kp) URL handling improved.
    25.09.14, 8.70 revised (kp) Separate modeCamera added different from display m_mode, to allow camera to keep its mode.
    31.08.14, 8.60 revised (kp) Garbage collector is called when last geometry is deleted.
    09.02.14, 8.50 revised (kp) Scene graph added in first beta version.
    24.09.12, 8.00 revised (kp) Enabled z-buffer as default.
    17.07.12, 7.32 revised (ur) Enable pop-up menu on right click for Mac OS.
    03.04.11, 7.31 revised (kp) Modus FIT now scales background image if it is smaller than canvas.
    02.04.11, 7.30 revised (kp) Switching of major modes using alt-key implemented.
    26.12.10, 7.22 revised (kp) Undo of intermediate removal of interface declarations by fk, since JAX produced error.
    26.12.10, 7.21 revised (kp) Declaration of variable move before first usage in key handling method, since 1.1-compile error.
    22.04.10, 7.20 revised (ur) Special key handling for linux.
    06.02.08, 7.00 revised (kp) Implementation of openGl rendering canvas.
    24.03.07, 6.40 revised (kp) Centering with x-pick now correctly keeps same distance to geometry.
    24.03.07, 6.30 revised (kp) Fast zBuffer enabled with shift-v.
    14.10.06, 6.20 revised (kp) Right-mouse scale added; by default picking now applies to selected and background.
    04.09.06, 6.10 revised (kp) New methods get/setPickType added to select sets of pickable geometries.
    11.06.06, 6.00 revised (kp) Middle mouse now translates, right mouse popup improved, editable title.
    02.08.04, 5.90 revised (kp) Default background image changed.
    09.06.04, 5.80 revised (kp) In antiAlias mode, draw text after downsampling.
    04.08.03, 5.70 revised (kp) Fly mode implemented.
    19.03.03, 5.60 revised (kp) Scene title handling added.
    02.03.03, 5.50 revised (kp) New method checkIfZBufferIsRequired() now performs check for automatic z-buffer.
    16.01.03, 5.40 revised (kp) Scale-rect now uses a rectangle with aspect ratio of display.
    06.01.03, 5.30 revised (ep) Method getPickEvent now adds this as source of event.
    17.12.02, 5.20 revised (ep) Added get/setFrameLabel() methods.
    09.12.02, 5.10 revised (kp) Methods for PvGeometryListenerIf added.
    08.12.02, 5.00 revised (kp) Selected display may be marked with red border.
    07.12.02, 4.90 revised (kp) Perspectivity implemented.
    19.11.02, 4.80 revised (ep) Workaround for TAB-problem under java 1.4+.
    17.11.02, 4.70 revised (kp) Implement showing of all four cameras.
    21.07.02, 4.60 revised (kp) Avoid useless repaints in some key events; update specials in modelCamera mode.
    13.07.02, 4.50 revised (kp) Rendering into external image implemented.
    10.05.02, 4.40 revised (kp) Lighting continued.
    07.02.02, 4.20 revised (ep) Moved popup menu triggers to java1.1 event handling methods.
    16.11.00, 4.10 revised (kp) Reflection of geometries added.
    29.09.00, 4.00 revised (kp) Many set/get methods renamed to show/isShowing.
    10.08.00, 3.40 revised (kp) Two methods for get/setting filename of background image removed.
    18.07.00, 3.30 revised (kp) Mode MODE_DISPLAY_PICK now returns display pick events and no geometries.
    10.07.00, 3.20 revised (kp) Flag determining backface drawing moved to element set.
    06.05.00, 3.15 revised (kp) Number of methods to access PvPickListener reduced.
    01.05.00, 3.10 revised (sk) Internationalization added.
    27.04.00, 2.60 revised (kp) Default applet size is take on first call of resizeImage().
    27.03.00, 2.50 revised (ep) Return type of getCamera() changed to PvCameraIf.
    01.01.00, 2.40 revised (kp) Selecting geometries by picking somewhere, not just at vertices.
    27.12.99, 2.30 revised (kp) Local transformation matrices incorporated in picking.
    30.11.99, 2.20 revised (kp) Size if display modifiable.
    20.11.99, 2.10 revised (kp) Aura along edges.
    08.07.99, 2.04 revised (kp) Synchronization added again by synchronizing m_scene in all four methods
    since there happened some flickering when auto-rotate and animation panel was enabled.
    07.07.99, 2.03 revised (kp) Synchronization removed from update(Object), paintGeom(g), paint(g) and update(g).
    since there was still a problem with deadlocks on a 2-processor linux machine.
    01.07.99, 2.03 revised (kp) Only one camera added during construction, other added on request.
    21.06.99, 2.02 revised (kp) Clipping activated.
    18.04.99, 2.01 revised (kp) Automatic animation disabled as default because stopping the thread does not work on MAC.
    00.00.97, 1.00 created (kp)
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.BaselineResizeBehavior
    • Constructor Summary

      Constructors 
      Constructor and Description
      PvDisplay()
      Constructor of display without viewer as parent.
      PvDisplay(java.applet.Applet applet, java.awt.Frame frame)
      Constructor of display inside applet, or inside frame if applet is null.
      PvDisplay(PvViewerIf viewer)
      Constructor of display with given argument viewer as parent.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      void actionPerformed(java.awt.event.ActionEvent event)
      Perform action events, currently used for popup menu events only.
      int addCamera(java.lang.String aName, PvCamera aCamera)
      Add new camera and make it accessible under the given name.
      void addCameraListener(PvCameraListenerIf listener)
      Add camera listener to receive camera events PvCameraEvent.
      boolean addGeometry(PgGeometryIf aGeom)
      Add geometry to display.
      void addGeometryListener(PvGeometryListenerIf listener)
      Add geometry listener to receive geometry events.
      void addKeyListener(java.awt.event.KeyListener listener)
      Add key listener to receive key events from display canvas.
      boolean addLight(PvLightIf light)
      Add a light to the current scene.
      void addOverlay(PvDisplayOverlayIf overlay)
      Enable and disable color bar drawing.
      void addPickListener(PvPickListenerIf listener)
      Add pick listener to receive pick events PvPickEvent.
      void addPopupItem(int menuID)
      Add a menu item to the right-mouse popup menu.
      void burn()
      Burn the current status as texture on each surface.
      void center()
      Center geometry in window, do no scaling
      void clearPopupMenu()
      Removes all added menu items from right-mouse popup menu, except some standard JavaView items such as "exit".
      void configure(PvDisplayIf disp)
      Configure an empty given display with all settings and geometries of this display.
      boolean containsGeometry(PgGeometryIf aGeom)
      Check whether geometry is registered in display.
      void createDefaultHighlight()
      Create default lights with highlight of JavaView.
      void createDefaultLights()
      Create default lights of JavaView.
      void enableClip(boolean aFlag)
      Deprecated. 
      boolean fit()
      Center and scale camera such that geometry fits exactly into window.
      boolean fit(PvCamera camera)
      Center and scale camera such that geometry fits exactly into window.
      PvGeometry[] getAllGeometryContainers()
      Get array with all geometry containers including registered and special geometries.
      int getAmbientProjection()
      Get projection mode of ambient space used in model camera.
      int getAmbientSpace()
      Get ambient space used in model transformations.
      PgAxes getAxes()
      Get axes geometry with individual rulers for each coordinate axis.
      PsPanel getAxisPanel()
      Get info panel of axes object to control all rulers uniformly.
      PsPanel getAxisPanel(int ind)
      Get info panel of individual ruler.
      java.awt.Color getBackgroundColor()
      Get color of background of display.
      java.awt.Image getBackgroundImage()
      Make background image of display available to outside world.
      java.lang.String getBackgroundImageFile()
      Get filename of background image of display canvas.
      int getBackgroundImageFit()
      Get the mode determining how a background image is scaled w.r.t. the display canvas.
      java.awt.Color getBndBoxColor()
      Get color of bounding box.
      double getBndBoxSize()
      Get thickness of edges of bounding box.
      PdVector[] getBoundingBox()
      Compute bounding box of all items in the scene, or return null if no items available.
      PdVector getBoxRatio()
      Get individual scaling factors of coordinate axes.
      PvCameraIf getCamera()
      Get current camera object.
      PvCameraIf getCamera(int type)
      Get a camera object by type.
      PsPanel getCameraPanel()
      Get info panel of current camera.
      PvCameraIf[] getCameras()
      Get current camera object.
      java.awt.Canvas getCanvas()
      Get canvas of this display.
      double[] getClipBounds(int ind)
      Get minimum and maximum in one dimension of the clipping box.
      int getClipBoundsType()
      Get index of axis which is selected when scene clip bounds is active of becomes active.
      double getFarClip()
      Get far clip distance of current camera.
      PsUpdateIf getFather()
      Get father of display.
      java.awt.Color getForegroundColor()
      Get foreground color.
      java.awt.Image getForegroundImage()
      Get foreground image of display canvas.
      java.lang.String getForegroundImageFile()
      Get filename of foreground image of display canvas.
      int getForegroundImageFit()
      Get the mode determining how a foreground image is scaled w.r.t. the display canvas.
      java.awt.Frame getFrame()
      Get reference to container frame of display, e.g. to allow display to hide/show frame.
      java.lang.String getFrameLabel(int index)
      Get one of the labels of the coordinate frame.
      PgGeometryIf[] getGeometries()
      Get array with registered geometries.
      PvGeometry getGeometryContainer(PgGeometryIf geom)
      Get container of registered or special geometry.
      PdVector getGridIncrements(int gridOrient)
      Get spacing between grid lines in both coordinate directions.
      int getGridOrientation()
      Get orientation of grid which determines the plane in which the grid lies.
      java.awt.Image getImage()
      Make image of display available to outside world.
      int getImageFitMode()
      Deprecated. 
      use getBackgroundImageFit()
      PsPanel getInfoPanel()
      Get info panel of display.
      PvLightIf getLight()
      Get current light object.
      int getLightingModel()
      Get currently active lighting model.
      PsPanel getLightPanel()
      Get info panel of lights.
      PvLightIf[] getLights()
      Get registered lights as array.
      int getMajorMode()
      Get the current interaction mode.
      java.awt.Dimension getMinimumSize()
      Assure correct horizontal size of all project panels.
      java.lang.String getName()
      Get name of this display.
      double getNearClip()
      Get near clip distance of current camera.
      int getNumGeometries()
      Get number of all registered geometry in display.
      int getNumLights()
      Get number of light objects.
      PvPickEvent getPickEvent(int x, int y)
      Find intersection of ray through pick locus on visible geometries and background.
      PvPickEvent getPickEvent(int x, int y, int pickType)
      Find intersection of ray through pick locus on visible geometries and background.
      int getPickType()
      Get pick type which determines the class of pickable geometries in pick and initialPick mode.
      java.awt.Point getPosition(int xPos, int yPos)
      Get upper left corner of frame, or null if no parent frame available.
      java.awt.Dimension getPreferredSize()
      Assure correct horizontal size of all project panels.
      java.lang.String getSceneTitle()
      Get title of scene.
      java.lang.String[] getSearchPaths()
      Get image search paths.
      PgGeometryIf getSelectedGeometry()
      Get currently selected geometry.
      PvLightIf getSelectedLight()
      Select light from the list of registered lights in this scene.
      java.awt.Dimension getSize()
      Get height of drawing canvas.
      int getTransformationMode()
      Check whether transformation of current model is active, i.e. of model matrix.
      PdMatrix getTransMatrix(int type)
      Get 4*4 transformation matrix or components from current camera and display.
      PvViewerIf getViewer()
      Get the viewer manager of display, which manages multiple displays and is key listener.
      PgGeometryIf[] getVisibleGeometries()
      Get array with registered and visible geometries.
      boolean hasAxes()
      Check existence of axes geometry.
      boolean hasCamera(int type)
      Determine whether a camera object of given type is registered in display.
      boolean hasCameraListener(PvCameraListenerIf listener)
      Check for a registered listener.
      boolean hasGeometryListener(PvGeometryListenerIf listener)
      Check for a registered geometry listener.
      boolean hasLight(PvLightIf light)
      Determine whether a light is registered in display.
      boolean hasPaintTag(long flags)
      Check whether either of the bits in parameter has been set.
      boolean hasPickListener(PvPickListenerIf listener)
      Check for a registered listener.
      boolean incrementAutoRotation()
      Do a single increment of auto-rotation animation.
      void init()
      Initialize this display.
      boolean isClip()
      Deprecated. 
      boolean isEnabled3DLook()
      Check whether thick vertices and edges are drawn as 3d shapes in z-buffer mode.
      boolean isEnabledAdaptiveSize()
      Check whether adaptive thickness of vertices and edges is enabled.
      boolean isEnabledAnimation()
      Check whether auto-rotation is enabled.
      boolean isEnabledAntiAlias()
      Check if antialiased drawing is enabled.
      boolean isEnabledBoxRatio()
      Check whether individual scaling factors of coordinate axes is enabled.
      boolean isEnabledClearScreen()
      Check whether screen is cleared after each repaint.
      boolean isEnabledClip()
      Check whether clipping with front and back plane is enabled.
      boolean isEnabledClipAutoBounds()
      Check whether automatic recalculation of clip range is enabled when clipRange is switched on.
      boolean isEnabledClipBounds()
      Check whether clipping with scene in direction of coordinate axis is enabled.
      boolean isEnabledDirectSelect()
      Check whether selecting is enabled during mouse pick.
      boolean isEnabledDoubleBuffer()
      Check if double buffered drawing is enabled.
      boolean isEnabledExternalRendering()
      Check if rendering into an external image is enabled.
      static boolean isEnabledFastClipping()
      Check whether fast clipping of geometry items is enabled.
      static boolean isEnabledFastZBuffer()
      Check whether fast z-buffered is disabled during drawing.
      boolean isEnabledFillDisplay()
      Check if scaling of scene to fill display is enabled.
      boolean isEnabledInspection()
      Check whether display and selected geometry can be inspected in control window.
      boolean isEnabledIntegerPick()
      Check whether picking is constrained to an integer grid.
      boolean isEnabledLocalTransform()
      Get flag whether local coordinate system is used in camera transformations.
      boolean isEnabledPainters()
      Check whether painter's algorithm during drawing is enabled.
      boolean isEnabledRepaint()
      Determine whether painting is enabled.
      boolean isEnabledTags()
      Determine whether tag mode is enabled to move marked elements.
      boolean isEnabledUpdate()
      Determine whether update mechanism is enabled.
      boolean isEnabledZBuffer()
      Check whether z-buffered drawing is enabled.
      boolean isShowingAllViews()
      Check drawing of copyright information in the display window.
      boolean isShowingAxes()
      Check whether axes of active geometry is currently showing.
      boolean isShowingBackgroundImage()
      Check drawing of background image of display window.
      boolean isShowingBackImage()
      Deprecated. 
      use isShowingBackgroundImage()
      boolean isShowingBndBox()
      Check whether bounding box of active geometry is currently showing.
      boolean isShowingCamera()
      Check whether active camera of this display is visible.
      boolean isShowingCopyright()
      Check drawing of copyright information in the display window.
      boolean isShowingDepthcue()
      True if depthcue is enabled.
      boolean isShowingEdgeAura()
      Check flag of drawing of edges by one or both elements adjacent to an edge.
      boolean isShowingEdgesOnce()
      Check flag of drawing of edges by one or both elements adjacent to an edge.
      boolean isShowingForegroundImage()
      Check drawing of foreground image of display window.
      boolean isShowingFrame()
      Check whether coordinate frame is currently showing.
      boolean isShowingGrid()
      Check whether grid is currently showing.
      boolean isShowingInterest()
      Check whether interest of active camera is visible.
      boolean isShowingMagnet()
      Check whether cursor attached to vertices if nearby.
      boolean isShowingOverlays()
      True if color bar is enabled.
      boolean isShowingScenegraph()
      True if scenegraph is enabled.
      boolean isShowingTitle()
      Check drawing of title north in the display window.
      boolean isShowingVisible()
      True if visible geometries are shown by the display.
      void keyPressed(java.awt.event.KeyEvent event) 
      void keyReleased(java.awt.event.KeyEvent event) 
      void keyTyped(java.awt.event.KeyEvent event) 
      void mouseClicked(java.awt.event.MouseEvent event)
      Shows popup menu if event is a popup trigger.
      void mouseDragged(java.awt.event.MouseEvent event) 
      void mouseEntered(java.awt.event.MouseEvent event)
      This display requests the focus when the mouse enters the canvas unless request of focus is disabled by external calls.
      void mouseExited(java.awt.event.MouseEvent event)
      Sets a flag that mouse is outside.
      void mouseMoved(java.awt.event.MouseEvent event)
      Updates mouse position and invokes temporary information like magnet and info.
      void mousePressed(java.awt.event.MouseEvent event)
      Do not react on popup events or other than left mouse clicks.
      void mouseReleased(java.awt.event.MouseEvent event)
      Handle mouse key release events.
      void paint(java.awt.Graphics g)
      Main method to initiate the drawing of a scene.
      void recomputeAxes()
      Recalculate length of axes depending on bounding box of scene or current geometry depending on current transformation mode.
      void releasePickFocus()
      Release pick focus, i.e. to be the unique listener who receives pick events.
      boolean removeCamera(int type)
      Remove camera from list of registered cameras.
      boolean removeCameraListener(PvCameraListenerIf listener)
      Remove a registered listener from list of registered listeners.
      void removeGeometries()
      Remove all geometries from list of registered geometries.
      boolean removeGeometry(PgGeometryIf aGeom)
      Remove geometry from list of registered geometries.
      boolean removeGeometryListener(PvGeometryListenerIf listener)
      Remove a registered geometry listener from list of registered listeners.
      void removeKeyListener(java.awt.event.KeyListener listener)
      Remove key listener to receive key events from display canvas.
      boolean removeLight(PvLightIf light)
      Remove light from list of registered lights in this scene.
      void removeLights()
      Remove all lights from list of registered lights in this scene.
      void removeOverlay(PvDisplayOverlayIf canvas)
      Remove color bar canvas.
      boolean removePickListener(PvPickListenerIf listener)
      Remove a registered listener from list of registered listeners.
      void render()
      Initiate the rendering process when using this display as a batch renderer.
      void repaint()
      For debug only.
      void requestPickFocus(PvPickListenerIf listener)
      Request pick focus, i.e. to be the unique listener who receives pick events.
      void reset()
      Reset this display to state determined by m_sceneDefaults.
      void resetInitials()
      Reset this display to state determined by m_sceneInitials.
      void resetTransformModel()
      Reset ambient and model matrix of current model and modelCamera.
      boolean resizeImage()
      Resize the target screen image if user has changed the canvas size.
      void run()
      Do the animation by incrementing the transformation matrix with the last action.
      void saveCameraDefaults()
      Save settings of current camera as default.
      void saveDefaults()
      ALPHA: Save current status of display as default state to which display returns when project and user settings need to be reset.
      void saveInitials()
      Save current status of display as initial state to which display returns when project and user settings need to be reset.
      boolean selectCamera(int type)
      Select current camera used in display by type.
      boolean selectGeometry(PgGeometryIf aGeom)
      Select geometry to be active and receive pick events.
      boolean selectLight(PvLightIf light)
      Select light from the list of registered lights in this scene.
      void setAmbientProjection(int mode)
      Set projection mode of ambient space used in model camera.
      void setAmbientSpace(int mode)
      Set ambient space used in model transformations.
      void setAutoCenter(boolean flag)
      Set flag which determines whether camera will automatically center on geometry.
      void setAutoRotation(PdVector axis, double angle)
      Set axis and angle for auto-rotation.
      void setAxes(PgAxes axes)
      Register axes geometry in this display.
      void setBackgroundColor(java.awt.Color color)
      Set color of background of display.
      void setBackgroundImage(java.awt.Image anImage)
      Set background image of display canvas.
      void setBackgroundImage(java.lang.String fileName)
      Deprecated. 
      use setBackgroundImageFile(String)
      void setBackgroundImageFile(java.lang.String fileName)
      Set filename of background image of display canvas.
      void setBackgroundImageFit(int mode)
      Set the mode determining how a background image is scaled w.r.t. the display canvas.
      void setBndBoxColor(java.awt.Color color)
      Set color of bounding box.
      void setBndBoxSize(double size)
      Set thickness of edges of bounding box.
      void setBoxRatio(PdVector ratio)
      Set individual scaling factors of coordinate axes.
      void setClipBounds(int ind, double[] range)
      Set minimum and maximum in one dimension of the clipping box.
      void setClipBoundsType(int type)
      Set index of axis which is selected when scene clip bounds is active of becomes active.
      static void setDefaultSize(java.awt.Dimension size)
      Set default dimension of drawing canvas from outside.
      void setDrawingOrder(int order, PgGeometryIf aGeom)
      Choose z-order of geometry when drawn in display.
      void setEnabled3DLook(boolean flag)
      Enable drawing of thick vertices and edges as 3d shapes in z-buffer mode.
      void setEnabledAdaptiveSize(boolean flag)
      Enabled adaptive thickness of vertices and edges.
      void setEnabledAnimation(boolean flag)
      Enable and disable auto-rotation of scene, start and stop auto-rotation thread, which continuously repaints the display.
      void setEnabledAntiAlias(boolean flag)
      Enable antialiased drawing.
      void setEnabledBoxRatio(boolean flag)
      Enable and disable individual scaling factors of coordinate axes.
      void setEnabledClearScreen(boolean aFlag)
      Enable clearing of screen after each repaint.
      void setEnabledClip(boolean flag)
      Enable and disable clipping with front and back plane in camera viewing direction.
      void setEnabledClipAutoBounds(boolean flag)
      Enable automatic recalculation of clip range when clipRange is switched on.
      void setEnabledClipBounds(boolean flag)
      Enable and disable clipping of scene along coordinate axes.
      void setEnabledDirectSelect(boolean flag)
      Enable and disable clipping with front and back plane.
      void setEnabledDoubleBuffer(boolean flag)
      Enable double buffered drawing.
      void setEnabledExternalRendering(boolean flag)
      Enable rendering into an external image.
      static void setEnabledFastClipping(boolean aFlag)
      Enable and disable fast clipping of geometry items during rendering.
      static void setEnabledFastZBuffer(boolean aFlag)
      Enable and disable fast z-buffered drawing of scene.
      void setEnabledFillDisplay(boolean flag)
      Determine if scaling of scene to fill display is enabled.
      void setEnabledInspection(boolean flag)
      Enable whether display and selected geometry can be inspected in control window.
      void setEnabledIntegerPick(boolean flag)
      Restrict picking to an integer grid.
      void setEnabledLocalTransform(boolean flag)
      Set flag whether local coordinate system is used in camera transformations.
      void setEnabledPainters(boolean flag)
      Enable and disable painter's algorithm during drawing, i.e. a z-sort of drawing items.
      void setEnabledRepaint(boolean flag)
      Set flag which determines whether painting is enabled.
      void setEnabledTags(boolean flag)
      Enable and disable tag mode to move marked elements.
      void setEnabledUpdate(boolean flag)
      Set flag which determines whether update mechanism is enabled.
      void setEnabledZBuffer(boolean flag)
      Enable and disable z-buffered drawing of scene.
      void setExternalRenderSize(int width, int height)
      Set dimension of the external render image.
      void setFarClip(double dist)
      Set far clip distance of current camera, works even if clipping is disabled.
      void setForegroundColor(java.awt.Color color)
      Set foreground color of display.
      void setForegroundImage(java.awt.Image image)
      Set foreground image of display canvas.
      void setForegroundImageFile(java.lang.String fileName)
      Load an image from file and set it as foreground image of display canvas.
      void setForegroundImageFit(int mode)
      Set the mode determining how a background image is scaled w.r.t. the display canvas.
      void setFrame(java.awt.Frame frame)
      Set reference to container frame of display, e.g. to allow display to hide/show frame.
      void setFrameLabel(int index, java.lang.String label)
      Sets one of the labels of the coordinate frame.
      void setGridIncrements(int gridOrient, PdVector gridIncrements)
      Set spacing between grid lines in both coordinate directions.
      void setGridOrientation(int gridOrient)
      Set orientation of grid which determines the plane in which the grid lies.
      void setImageFitMode(int mode)
      Deprecated. 
      use setBackgroundImageFit(int)
      void setLightingModel(int model)
      Set current lighting model, and thereby enable or disable usage of light.
      void setMajorMode(int mode)
      Switch between interaction modes like rotating or scaling, usually done interactively.
      void setName(java.lang.String aName)
      Set name of this display.
      void setNearClip(double dist)
      Set near clip distance of current camera, works even if clipping is disabled.
      void setPaintTag(long flags, boolean val)
      Set all bits which are set in parameter.
      void setParent(PsUpdateIf father)
      Set father of display which receives update events when current class has changed.
      void setPickType(int type)
      Set pick type which determines the class of pickable geometries in pick and initialPick mode.
      void setPosition(int xPos, int yPos)
      Set position of upper left corner of frame from outside.
      void setPreferredSize(java.awt.Dimension size)
      Set default dimension of drawing canvas from outside.
      void setSceneTitle(java.lang.String title)
      Set title of scene.
      void setSearchPaths(java.lang.String[] searchPath)
      Set image search paths.
      void setSizeWithinFrame(int width, int height)
      Set dimension of display which is included in a parent frame.
      void setTransformationMode(int mode)
      Enable transformation of modeling matrix M of single geometry rather than transforming the whole scene by modifying project P and view V matrices.
      void setTransMatrix(int type, PdMatrix mat)
      Set transformation matrices PV, P, V and their inverses in current camera and display.
      void setViewer(PvViewerIf viewer)
      Set the viewer manager of display, which manages multiple displays and is key listener.
      void showAllViews(boolean flag)
      Enable and disable drawing of copyright information in the display window.
      void showAxes(boolean aFlag)
      Set visibility of axes active geometry, and create axes if not available.
      void showBackgroundImage(boolean aFlag)
      Enable and disable drawing of background image of display window.
      void showBackImage(boolean aFlag)
      Deprecated. 
      use showBackgroundImage(boolean)
      void showBndBox(boolean aFlag)
      Set visibility of bounding box of active geometry, and create bounding box if not available.
      void showCamera(boolean aFlag)
      Set visibility of active camera in this display, and create camera geometry if not available.
      void showCopyright(boolean aFlag)
      Enable and disable drawing of copyright information in the display window.
      void showDepthcue(boolean aFlag)
      Enable and disable depthcue drawing.
      void showEdgeAura(boolean aFlag)
      Enable and disable drawing of edges by one or both elements adjacent to an edge.
      void showEdgesOnce(boolean aFlag)
      Enable and disable drawing of edges by one or both elements adjacent to an edge.
      void showForegroundImage(boolean aFlag)
      Enable and disable drawing of foreground image of display window.
      void showFrame(boolean aFlag)
      Set visibility of coordinate frame is shown, and create frame if not available.
      void showGrid(boolean flag)
      Set visibility of grid, and create grid if not available.
      void showInterest(boolean aFlag)
      Set visibility of interest of active camera, and create interest geometry if not available.
      void showMagnet(boolean aFlag)
      Attach cursor to vertices if nearby.
      void showScenegraph(boolean aFlag)
      Enable and disable scenegraph drawing.
      void showTitle(boolean aFlag)
      Enable and disable drawing of title north in the display window.
      void showVisible(boolean aFlag)
      Enable and disable showing of visible geometries.
      void start()
      Start animation by creating a new thread
      void stop()
      Stop animation by stopping the thread.
      void update(java.awt.Graphics g)
      Override Component.update(g) to initiate redrawing of geometries.
      boolean update(java.lang.Object event)
      Handle update events sent to display by JavaView.
      • Methods inherited from class java.awt.Canvas

        addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • RENDER_AWT

        public static final int RENDER_AWT
        AWT type of render engine.
        See Also:
        Constant Field Values
      • RENDER_PS

        public static final int RENDER_PS
        PostScript type of render engine, not interactive but for PS output.
        See Also:
        Constant Field Values
      • RENDER_GL2

        public static final int RENDER_GL2
        GL type of render engine.
        See Also:
        Constant Field Values
      • RENDER_LWJGL

        public static final int RENDER_LWJGL
        GL type of render engine.
        See Also:
        Constant Field Values
      • m_renderType

        public static int m_renderType
        Determines render engine and choice of display canvas.
      • m_defBackgroundImageFile

        public java.lang.String m_defBackgroundImageFile
        Default background image for display.
      • m_backgroundImageFile

        public java.lang.String m_backgroundImageFile
        Background image for display.
      • m_defForegroundImageFile

        public java.lang.String m_defForegroundImageFile
        Default foreground image for display.
      • m_foregroundImageFile

        public java.lang.String m_foregroundImageFile
        Background image for display.
      • PAINT_FOCUS

        public static final long PAINT_FOCUS
        Enable showing of a red outline of display has focus enabled.
        See Also:
        Constant Field Values
      • m_bInsecureKeyRelease

        public boolean m_bInsecureKeyRelease
        A flag checking if a keyReleased event still has to be checked. If the timer method called and the flag is still "false", the keyReleased event is considered "real".
    • Constructor Detail

      • PvDisplay

        public PvDisplay()
        Constructor of display without viewer as parent. Allows display to act as bean.
      • PvDisplay

        public PvDisplay(PvViewerIf viewer)
        Constructor of display with given argument viewer as parent.
        Parameters:
        viewer - parent of display to handle certain events like export.
      • PvDisplay

        public PvDisplay(java.applet.Applet applet,
                         java.awt.Frame frame)
        Constructor of display inside applet, or inside frame if applet is null. Frame is used to allow modification of size of display if no viewer available.
        Parameters:
        applet - which is container of display
        frame - which contains applet, or is container of display
    • Method Detail

      • init

        public void init()
        Initialize this display.
        Specified by:
        init in interface PvDisplayIf
        Version:
        17.11.02, 2.00 revised (kp) Original init() method split into init() and init(int).
        11.11.01, 1.20 revised (kp) Default values for z-buffer changed.
        02.12.00, 1.10 revised (kp) Clear special geometries.
      • reset

        public void reset()
        Reset this display to state determined by m_sceneDefaults.
        Version:
        17.11.02, 1.00 created (kp)
      • resetInitials

        public void resetInitials()
        Reset this display to state determined by m_sceneInitials.
        Since:
        JavaView 4.70.010
        Version:
        26.10.16, 1.00 created (kp)
      • saveInitials

        public void saveInitials()
        Save current status of display as initial state to which display returns when project and user settings need to be reset. Typically, after a main program sets up the initial configuration of a display, this status might be saved as ground truth of this running session, e.g. end of PvViewer.start().
        Specified by:
        saveInitials in interface PvDisplayIf
        Since:
        JavaView 4.70.010
        Version:
        26.10.16, 1.00 created (kp)
      • saveDefaults

        public void saveDefaults()
        ALPHA: Save current status of display as default state to which display returns when project and user settings need to be reset.
        Specified by:
        saveDefaults in interface PvDisplayIf
        Since:
        JavaView 4.70.010
        Version:
        26.10.16, 1.00 created (kp)
      • getName

        public java.lang.String getName()
        Get name of this display.
        Specified by:
        getName in interface PsUpdateIf
        Specified by:
        getName in interface PvDisplayIf
        Overrides:
        getName in class java.awt.Component
      • setName

        public void setName(java.lang.String aName)
        Set name of this display.
        Specified by:
        setName in interface PvDisplayIf
        Overrides:
        setName in class java.awt.Component
      • getSceneTitle

        public java.lang.String getSceneTitle()
        Get title of scene.
        Specified by:
        getSceneTitle in interface PvDisplayIf
      • setSceneTitle

        public void setSceneTitle(java.lang.String title)
        Set title of scene.
        Specified by:
        setSceneTitle in interface PvDisplayIf
      • getCanvas

        public java.awt.Canvas getCanvas()
        Get canvas of this display. Before GL implementation the display was the canvas, now we return a special instance variable. For some time, display still derives from canvas and will in fact be returned.
        Specified by:
        getCanvas in interface PvDisplayIf
        Since:
        JavaView 3.99.010
        Version:
        03.02.08, 1.00 created (kp)
      • getFrame

        public java.awt.Frame getFrame()
        Get reference to container frame of display, e.g. to allow display to hide/show frame.
        Specified by:
        getFrame in interface PvDisplayIf
      • setFrame

        public void setFrame(java.awt.Frame frame)
        Set reference to container frame of display, e.g. to allow display to hide/show frame.
        Specified by:
        setFrame in interface PvDisplayIf
      • getViewer

        public PvViewerIf getViewer()
        Get the viewer manager of display, which manages multiple displays and is key listener.
        Specified by:
        getViewer in interface PvDisplayIf
        Since:
        JavaView 2.30
        Version:
        25.07.02, 1.00 created (kp)
      • setViewer

        public void setViewer(PvViewerIf viewer)
        Set the viewer manager of display, which manages multiple displays and is key listener.
        Specified by:
        setViewer in interface PvDisplayIf
        Since:
        JavaView 2.30
        Version:
        25.07.02, 1.00 created (kp)
      • isShowingOverlays

        public boolean isShowingOverlays()
        True if color bar is enabled.
        Since:
        JavaView 4.32.002
        Version:
        06.03.15, 1.00 created (kp)
      • addOverlay

        public void addOverlay(PvDisplayOverlayIf overlay)
        Enable and disable color bar drawing.
        Since:
        JavaView 4.32.002
        Version:
        06.03.15, 1.00 created (kp)
      • removeOverlay

        public void removeOverlay(PvDisplayOverlayIf canvas)
        Remove color bar canvas.
        Since:
        JavaView 4.41.002
        Version:
        10.03.15, 1.00 created (kp)
      • isShowingScenegraph

        public boolean isShowingScenegraph()
        True if scenegraph is enabled.
        Specified by:
        isShowingScenegraph in interface PvDisplayIf
        Since:
        JavaView 4.08.002
        Version:
        11.02.14, 1.00 created (kp)
      • showScenegraph

        public void showScenegraph(boolean aFlag)
        Enable and disable scenegraph drawing.
        Specified by:
        showScenegraph in interface PvDisplayIf
        Since:
        JavaView 4.08.002
        Version:
        11.02.14, 1.00 created (kp)
      • isShowingVisible

        public boolean isShowingVisible()
        True if visible geometries are shown by the display.
        Specified by:
        isShowingVisible in interface PvDisplayIf
        Since:
        JavaView 4.81.004
        Version:
        12.05.17, 1.00 created (kp)
      • showVisible

        public void showVisible(boolean aFlag)
        Enable and disable showing of visible geometries. Allows to temporarily hide the current set of visible geometries by hiding the internal geometry containers.
        Specified by:
        showVisible in interface PvDisplayIf
        Since:
        JavaView 4.81.004
        Version:
        12.05.17, 1.00 created (kp)
      • addKeyListener

        public void addKeyListener(java.awt.event.KeyListener listener)
        Add key listener to receive key events from display canvas.
        Specified by:
        addKeyListener in interface PvDisplayIf
        Overrides:
        addKeyListener in class java.awt.Component
        Parameters:
        listener - which is added
        See Also:
        removeKeyListener(KeyListener)
      • removeKeyListener

        public void removeKeyListener(java.awt.event.KeyListener listener)
        Remove key listener to receive key events from display canvas.
        Specified by:
        removeKeyListener in interface PvDisplayIf
        Overrides:
        removeKeyListener in class java.awt.Component
        Parameters:
        listener - which is added
        See Also:
        addKeyListener(KeyListener)
      • requestPickFocus

        public void requestPickFocus(PvPickListenerIf listener)
        Request pick focus, i.e. to be the unique listener who receives pick events. The focus should only be requested temporarily, and must be released after use.
        Specified by:
        requestPickFocus in interface PvDisplayIf
        Parameters:
        listener - which will receives pick events
        See Also:
        releasePickFocus()
      • releasePickFocus

        public void releasePickFocus()
        Release pick focus, i.e. to be the unique listener who receives pick events. The focus should only be requested temporarily, and must be released after use.
        Specified by:
        releasePickFocus in interface PvDisplayIf
        See Also:
        requestPickFocus(PvPickListenerIf)
      • addGeometry

        public boolean addGeometry(PgGeometryIf aGeom)
        Add geometry to display. Display may show several geometries among one of them is the currently active geometry. The active geometry is the target for picking.

        After the first geometry is added, the display performs a fit() operation to center and scale the camera such that the geometry is completely visible in the display.

        The first geometry added to a display automatically becomes the active geometry. After having added several geometries the active geometry may be selected with selectGeometry().

        Note, default drawing order is PvGeometryIf#DRAW_ORDER_STANDARD which means, that z-depth of geometry elements are orderer in comparison with all other geometries. Except, if drawing order is PvGeometryIf#DRAW_ORDER_FRONT or PvGeometryIf.DRAW_ORDER_BACK then no comparison is done during display. Use method #setDrawingOrder(int, jv.project.PgGeometryIf) to modify the drawing order of a geometry after it has been added to the display.

        Specified by:
        addGeometry in interface PvDisplayIf
        Version:
        05.02.03, 1.40 revised (kp) Inform listener only of geometry is not a special geometry.
        17.11.02, 1.30 revised (kp) In all-camera-view update other displays too.
        14.07.00, 1.20 revised (kp) If geometry already registered, just return.
        10.07.00, 1.10 revised (kp) Default drawing order is DRAW_ORDER_STANDARD.
      • removeGeometries

        public void removeGeometries()
        Remove all geometries from list of registered geometries. The current geometry is null after this call.

        This method does not remove any special geometry like bounding box, axis frame etc. The special geometries must be removed individually using methods like showBndBox(false).

        Specified by:
        removeGeometries in interface PvDisplayIf
        Version:
        25.03.01, 2.10 revised (kp) No longer remove special geometries.
      • removeGeometry

        public boolean removeGeometry(PgGeometryIf aGeom)
        Remove geometry from list of registered geometries. The current geometry changes if it was the removed geometry.

        If the currently active geometry is removed, then the first geometry becomes active.

        Specified by:
        removeGeometry in interface PvDisplayIf
        Parameters:
        aGeom - geometry to be removed
        Returns:
        true geometry was successfully removed
        Version:
        17.11.02, 1.30 revised (kp) In all-camera-view update other displays too.
        27.07.00, 1.10 revised (kp) Now do selectGeometry() instead of setCurrentGeom.
      • selectGeometry

        public boolean selectGeometry(PgGeometryIf aGeom)
        Select geometry to be active and receive pick events.
        Specified by:
        selectGeometry in interface PvDisplayIf
        Parameters:
        aGeom - geometry to be selected
        Returns:
        true geometry was successfully selected
      • getAllGeometryContainers

        public PvGeometry[] getAllGeometryContainers()
        Get array with all geometry containers including registered and special geometries. Method is used internally by this class.
      • getGeometryContainer

        public PvGeometry getGeometryContainer(PgGeometryIf geom)
        Get container of registered or special geometry.
        Parameters:
        geom - registered or special geometry
        Returns:
        Container class or null.
        Version:
        02.05.14, 1.00 created (kp)
      • getNumGeometries

        public int getNumGeometries()
        Get number of all registered geometry in display. Method does not return any special geometries like bounding box, coordinate frames etc.
        Specified by:
        getNumGeometries in interface PvDisplayIf
      • getGeometries

        public PgGeometryIf[] getGeometries()
        Get array with registered geometries. The currently active geometry can be obtained using getSelectedGeometry. Method does not return any special geometries like bounding box which are for internal use only.
        Specified by:
        getGeometries in interface PvDisplayIf
        Returns:
        array with registered geometries
        Version:
        25.01.02, 1.50 revised (kp) Select geometry is no longer on first position.
      • getVisibleGeometries

        public PgGeometryIf[] getVisibleGeometries()
        Get array with registered and visible geometries. Method does not return any special geometries like bounding box which are for internal use only.
        Specified by:
        getVisibleGeometries in interface PvDisplayIf
        Returns:
        array with visible geometries
        Since:
        JavaView 2.68.000
        Version:
        19.04.03, 1.00 created (kp)
      • center

        public void center()
        Center geometry in window, do no scaling
        Specified by:
        center in interface PvDisplayIf
      • getBoundingBox

        public PdVector[] getBoundingBox()
        Compute bounding box of all items in the scene, or return null if no items available. All items are multiplied with their modelling matrix before bounding box calculation.
        Since:
        JavaView 4.11.006
        Version:
        20.04.14, 1.00 created (kp)
      • saveCameraDefaults

        public void saveCameraDefaults()
        Save settings of current camera as default. Default values can be reactivated with the reset button or key.
        Since:
        JavaView 2.47
        Version:
        30.11.02, 1.00 created (kp)
      • fit

        public boolean fit()
        Center and scale camera such that geometry fits exactly into window. If display was not laid out yet or no geometry available then fit() does nothing and returns false.
        Specified by:
        fit in interface PvDisplayIf
        Returns:
        true if fitting was successful.
        Version:
        14.12.04, 1.20 revised (kp) If empty scene, then set camera distance to 10.
        28.11.02, 1.10 revised (kp) Return value added.
      • fit

        public boolean fit(PvCamera camera)
        Center and scale camera such that geometry fits exactly into window. If display was not laid out yet or no geometry available then fit() does nothing and returns false. The fitting will be written to the given camera object.
        Parameters:
        camera - Output parameter for writing the camera after fitting.
        Returns:
        true if fitting was successful.
        Version:
        03.02.08, 1.30 revised (mn) Added parameter camera.
        14.12.04, 1.20 revised (kp) If empty scene, then set camera distance to 10.
        28.11.02, 1.10 revised (kp) Return value added.
      • getBackgroundColor

        public java.awt.Color getBackgroundColor()
        Get color of background of display. If background image is set, then color is visible in transparent regions of the image.
        Specified by:
        getBackgroundColor in interface PvDisplayIf
      • setBackgroundColor

        public void setBackgroundColor(java.awt.Color color)
        Set color of background of display. If background image is set, then color is visible in transparent regions of the image.
        Specified by:
        setBackgroundColor in interface PvDisplayIf
      • getForegroundColor

        public java.awt.Color getForegroundColor()
        Get foreground color. Currently neither defined nor used.
        Specified by:
        getForegroundColor in interface PvDisplayIf
      • setForegroundColor

        public void setForegroundColor(java.awt.Color color)
        Set foreground color of display. Currently neither defined nor used.
        Specified by:
        setForegroundColor in interface PvDisplayIf
      • isEnabledInspection

        public boolean isEnabledInspection()
        Check whether display and selected geometry can be inspected in control window.
        Specified by:
        isEnabledInspection in interface PvDisplayIf
        Since:
        JavaView 3.96.022
        Version:
        18.06.06, 1.00 created (kp)
      • setEnabledInspection

        public void setEnabledInspection(boolean flag)
        Enable whether display and selected geometry can be inspected in control window.
        Specified by:
        setEnabledInspection in interface PvDisplayIf
        Since:
        JavaView 3.96.022
        Version:
        18.06.06, 1.00 created (kp)
      • isEnabledAnimation

        public boolean isEnabledAnimation()
        Check whether auto-rotation is enabled.
        Specified by:
        isEnabledAnimation in interface PvDisplayIf
      • setEnabledAnimation

        public void setEnabledAnimation(boolean flag)
        Enable and disable auto-rotation of scene, start and stop auto-rotation thread, which continuously repaints the display.
        Specified by:
        setEnabledAnimation in interface PvDisplayIf
      • getAmbientSpace

        public int getAmbientSpace()
        Get ambient space used in model transformations.
      • setAmbientSpace

        public void setAmbientSpace(int mode)
        Set ambient space used in model transformations.
      • getAmbientProjection

        public int getAmbientProjection()
        Get projection mode of ambient space used in model camera.
      • setAmbientProjection

        public void setAmbientProjection(int mode)
        Set projection mode of ambient space used in model camera.
      • isEnabledLocalTransform

        public boolean isEnabledLocalTransform()
        Get flag whether local coordinate system is used in camera transformations.
        Specified by:
        isEnabledLocalTransform in interface PvDisplayIf
      • setEnabledLocalTransform

        public void setEnabledLocalTransform(boolean flag)
        Set flag whether local coordinate system is used in camera transformations.
        Specified by:
        setEnabledLocalTransform in interface PvDisplayIf
      • getTransformationMode

        public int getTransformationMode()
        Check whether transformation of current model is active, i.e. of model matrix. Otherwise, whole scene is transformed, i.e. project and view matrix.
        Specified by:
        getTransformationMode in interface PvDisplayIf
      • setTransformationMode

        public void setTransformationMode(int mode)
        Enable transformation of modeling matrix M of single geometry rather than transforming the whole scene by modifying project P and view V matrices.
        Specified by:
        setTransformationMode in interface PvDisplayIf
      • resetTransformModel

        public void resetTransformModel()
        Reset ambient and model matrix of current model and modelCamera.
      • getSearchPaths

        public java.lang.String[] getSearchPaths()
        Get image search paths.
        Returns:
        array of search paths
        Since:
        JavaView 3.61.003
        Version:
        27.10.04, 1.00 created (kp)
      • setSearchPaths

        public void setSearchPaths(java.lang.String[] searchPath)
        Set image search paths.
        Parameters:
        searchPath - array of search paths
        Since:
        JavaView 3.61.003
        Version:
        27.10.04, 1.00 created (kp)
      • isEnabledFillDisplay

        public boolean isEnabledFillDisplay()
        Check if scaling of scene to fill display is enabled.
        Specified by:
        isEnabledFillDisplay in interface PvDisplayIf
        Since:
        JavaView v3.94.003.
        Version:
        28.09.05, 1.00 created (kp)
      • setEnabledFillDisplay

        public void setEnabledFillDisplay(boolean flag)
        Determine if scaling of scene to fill display is enabled.
        Specified by:
        setEnabledFillDisplay in interface PvDisplayIf
        Since:
        JavaView v3.94.003.
        Version:
        28.09.05, 1.00 created (kp)
      • getImageFitMode

        public int getImageFitMode()
        Deprecated. use getBackgroundImageFit()
        Get the mode determining how a background image is scaled w.r.t. the display canvas.
        Specified by:
        getImageFitMode in interface PvDisplayIf
      • setImageFitMode

        public void setImageFitMode(int mode)
        Deprecated. use setBackgroundImageFit(int)
        Set the mode determining how a background image is scaled w.r.t. the display canvas.
        Specified by:
        setImageFitMode in interface PvDisplayIf
      • getBackgroundImageFit

        public int getBackgroundImageFit()
        Get the mode determining how a background image is scaled w.r.t. the display canvas.
        Specified by:
        getBackgroundImageFit in interface PvDisplayIf
        Since:
        JavaView 2.36
      • setBackgroundImageFit

        public void setBackgroundImageFit(int mode)
        Set the mode determining how a background image is scaled w.r.t. the display canvas.
        Specified by:
        setBackgroundImageFit in interface PvDisplayIf
        Since:
        JavaView 2.36
      • getForegroundImageFit

        public int getForegroundImageFit()
        Get the mode determining how a foreground image is scaled w.r.t. the display canvas.
        Specified by:
        getForegroundImageFit in interface PvDisplayIf
        Since:
        JavaView 2.36
      • setForegroundImageFit

        public void setForegroundImageFit(int mode)
        Set the mode determining how a background image is scaled w.r.t. the display canvas.
        Specified by:
        setForegroundImageFit in interface PvDisplayIf
        Since:
        JavaView 2.36
      • isShowingBackImage

        public boolean isShowingBackImage()
        Deprecated. use isShowingBackgroundImage()
        Check drawing of background image of display window.
        Specified by:
        isShowingBackImage in interface PvDisplayIf
      • isShowingBackgroundImage

        public boolean isShowingBackgroundImage()
        Check drawing of background image of display window.
        Specified by:
        isShowingBackgroundImage in interface PvDisplayIf
        Since:
        JavaView 2.31
      • showBackImage

        public void showBackImage(boolean aFlag)
        Deprecated. use showBackgroundImage(boolean)
        Enable and disable drawing of background image of display window.
      • showBackgroundImage

        public void showBackgroundImage(boolean aFlag)
        Enable and disable drawing of background image of display window. Image is loaded from file if file name exists and showing of image is enabled.
        Specified by:
        showBackgroundImage in interface PvDisplayIf
        Since:
        JavaView 2.31
        Version:
        28.11.02, 1.10 revised (kp) If true then also load image if not done yet.
      • isShowingForegroundImage

        public boolean isShowingForegroundImage()
        Check drawing of foreground image of display window.
        Specified by:
        isShowingForegroundImage in interface PvDisplayIf
        Since:
        JavaView 2.31
      • showForegroundImage

        public void showForegroundImage(boolean aFlag)
        Enable and disable drawing of foreground image of display window. Image is loaded from file if file name exists and showing of image is enabled.
        Specified by:
        showForegroundImage in interface PvDisplayIf
        Since:
        JavaView 2.31
      • isShowingCopyright

        public boolean isShowingCopyright()
        Check drawing of copyright information in the display window.
        Specified by:
        isShowingCopyright in interface PvDisplayIf
      • showCopyright

        public void showCopyright(boolean aFlag)
        Enable and disable drawing of copyright information in the display window.
        Specified by:
        showCopyright in interface PvDisplayIf
      • isShowingTitle

        public boolean isShowingTitle()
        Check drawing of title north in the display window.
        Specified by:
        isShowingTitle in interface PvDisplayIf
        Since:
        JavaView 2.49.004
      • showTitle

        public void showTitle(boolean aFlag)
        Enable and disable drawing of title north in the display window.
        Specified by:
        showTitle in interface PvDisplayIf
        Since:
        JavaView 2.49.004
      • isShowingDepthcue

        public boolean isShowingDepthcue()
        True if depthcue is enabled. No depthcue for non-perspective projections. Depthcue is always switched off for non-perspective projections since they usually show planar geometries where depthcue makes not too much sense.
        Specified by:
        isShowingDepthcue in interface PvDisplayIf
      • showDepthcue

        public void showDepthcue(boolean aFlag)
        Enable and disable depthcue drawing.
        Specified by:
        showDepthcue in interface PvDisplayIf
      • getLightingModel

        public int getLightingModel()
        Get currently active lighting model.
        Specified by:
        getLightingModel in interface PvDisplayIf
        Returns:
        lighting model as determined by PvLightIf.MODEL_LIGHT etc.
      • setLightingModel

        public void setLightingModel(int model)
        Set current lighting model, and thereby enable or disable usage of light. If lighting model is PvLightIf.MODEL_SURFACE then the surface color is used and explicit lighting is disabled. Lighting model must be set after the lights are known to the display.
        Specified by:
        setLightingModel in interface PvDisplayIf
        Parameters:
        model - lighting model as determined by PvLightIf.MODEL_LIGHT etc.
        Version:
        07.08.08, 1.20 revised (kp) Bug removed which was related to undeleted special geometries (lights).
      • isShowingEdgesOnce

        public boolean isShowingEdgesOnce()
        Check flag of drawing of edges by one or both elements adjacent to an edge.
        Specified by:
        isShowingEdgesOnce in interface PvDisplayIf
      • showEdgesOnce

        public void showEdgesOnce(boolean aFlag)
        Enable and disable drawing of edges by one or both elements adjacent to an edge.
        Specified by:
        showEdgesOnce in interface PvDisplayIf
      • isShowingEdgeAura

        public boolean isShowingEdgeAura()
        Check flag of drawing of edges by one or both elements adjacent to an edge.
        Specified by:
        isShowingEdgeAura in interface PvDisplayIf
      • showEdgeAura

        public void showEdgeAura(boolean aFlag)
        Enable and disable drawing of edges by one or both elements adjacent to an edge.
        Specified by:
        showEdgeAura in interface PvDisplayIf
      • isShowingGrid

        public boolean isShowingGrid()
        Check whether grid is currently showing.
        Specified by:
        isShowingGrid in interface PvDisplayIf
      • showGrid

        public void showGrid(boolean flag)
        Set visibility of grid, and create grid if not available.
        Specified by:
        showGrid in interface PvDisplayIf
      • getGridIncrements

        public PdVector getGridIncrements(int gridOrient)
        Get spacing between grid lines in both coordinate directions.
        Specified by:
        getGridIncrements in interface PvDisplayIf
        Returns:
        Increments determine the spacing for both gridlines.
        Since:
        JavaView 3.96.014
        Version:
        06.06.06, 1.00 created (kp)
      • setGridIncrements

        public void setGridIncrements(int gridOrient,
                                      PdVector gridIncrements)
        Set spacing between grid lines in both coordinate directions. Must invoke #compute() after orientation has changed.
        Specified by:
        setGridIncrements in interface PvDisplayIf
        Parameters:
        gridOrient - Determines the xy, yz, or xz plane, see PvDisplayIf#GRID_XY.
        gridIncrements - Determine the spacing for both gridlines.
        Since:
        JavaView 3.96.014
        Version:
        06.06.06, 1.00 created (kp)
      • getGridOrientation

        public int getGridOrientation()
        Get orientation of grid which determines the plane in which the grid lies.
        Returns:
        Orientation identified as PvGrid#GRID_XY etc.
        Since:
        JavaView 3.96.014
        Version:
        06.06.06, 1.00 created (kp)
      • setGridOrientation

        public void setGridOrientation(int gridOrient)
        Set orientation of grid which determines the plane in which the grid lies. Orientation is identified using PvGrid#GRID_XY etc. Must invoke #compute() after orientation has changed.
        Parameters:
        gridOrient - Orientation identified as PvGrid#GRID_XY etc.
        Since:
        JavaView 3.96.014
        Version:
        06.06.06, 1.00 created (kp)
      • getFrameLabel

        public java.lang.String getFrameLabel(int index)
        Get one of the labels of the coordinate frame.
        Parameters:
        index - 0 for x-Axis, 1 for y-Axis and so on
        Since:
        JavaView 2.48.005
        See Also:
        showFrame(boolean)
      • setFrameLabel

        public void setFrameLabel(int index,
                                  java.lang.String label)
        Sets one of the labels of the coordinate frame.
        Parameters:
        index - 0 for x-Axis, 1 for y-Axis and so on
        Since:
        JavaView 2.48.005
        See Also:
        showFrame(boolean)
      • isShowingFrame

        public boolean isShowingFrame()
        Check whether coordinate frame is currently showing.
        Specified by:
        isShowingFrame in interface PvDisplayIf
      • showFrame

        public void showFrame(boolean aFlag)
        Set visibility of coordinate frame is shown, and create frame if not available.
        Specified by:
        showFrame in interface PvDisplayIf
      • isShowingBndBox

        public boolean isShowingBndBox()
        Check whether bounding box of active geometry is currently showing.
        Specified by:
        isShowingBndBox in interface PvDisplayIf
      • showBndBox

        public void showBndBox(boolean aFlag)
        Set visibility of bounding box of active geometry, and create bounding box if not available.
        Specified by:
        showBndBox in interface PvDisplayIf
      • getBndBoxColor

        public java.awt.Color getBndBoxColor()
        Get color of bounding box.
        Specified by:
        getBndBoxColor in interface PvDisplayIf
        Returns:
        color of bounding box
        Since:
        JavaView 2.49.005
        Version:
        18.01.03, 1.00 created (kp)
      • setBndBoxColor

        public void setBndBoxColor(java.awt.Color color)
        Set color of bounding box.
        Specified by:
        setBndBoxColor in interface PvDisplayIf
        Parameters:
        color - color of bounding box
        Since:
        JavaView 2.49.005
        Version:
        18.01.03, 1.00 created (kp)
      • getBndBoxSize

        public double getBndBoxSize()
        Get thickness of edges of bounding box.
        Specified by:
        getBndBoxSize in interface PvDisplayIf
        Returns:
        thickness of edges bounding box
        Since:
        JavaView 2.49.005
        Version:
        18.01.03, 1.00 created (kp)
      • setBndBoxSize

        public void setBndBoxSize(double size)
        Set thickness of edges of bounding box.
        Specified by:
        setBndBoxSize in interface PvDisplayIf
        Parameters:
        size - thickness of edges bounding box
        Since:
        JavaView 2.49.005
        Version:
        18.01.03, 1.00 created (kp)
      • isShowingInterest

        public boolean isShowingInterest()
        Check whether interest of active camera is visible.
      • showInterest

        public void showInterest(boolean aFlag)
        Set visibility of interest of active camera, and create interest geometry if not available.

        BETA: Currently only used in fly mode.

      • isShowingCamera

        public boolean isShowingCamera()
        Check whether active camera of this display is visible.
      • showCamera

        public void showCamera(boolean aFlag)
        Set visibility of active camera in this display, and create camera geometry if not available.
      • isEnabledClearScreen

        public boolean isEnabledClearScreen()
        Check whether screen is cleared after each repaint.
      • setEnabledClearScreen

        public void setEnabledClearScreen(boolean aFlag)
        Enable clearing of screen after each repaint.
      • addLight

        public boolean addLight(PvLightIf light)
        Add a light to the current scene. Light is internally registered using a unique name in an additional hashtable m_light.
        Specified by:
        addLight in interface PvDisplayIf
        Parameters:
        light - new light added to scene
        Version:
        07.08.08, 1.20 revised (kp) Bug removed which was related to undeleted special geometries (lights).
        21.04.04, 1.10 revised (kp) Light are now special geometries.
      • getNumLights

        public int getNumLights()
        Get number of light objects.
        Specified by:
        getNumLights in interface PvDisplayIf
        Returns:
        number of light objects
      • getLight

        public PvLightIf getLight()
        Get current light object.
        Specified by:
        getLight in interface PvDisplayIf
        Returns:
        current light object
      • getLights

        public PvLightIf[] getLights()
        Get registered lights as array.
        Specified by:
        getLights in interface PvDisplayIf
        Returns:
        array of registered lights
      • hasLight

        public boolean hasLight(PvLightIf light)
        Determine whether a light is registered in display.
        Specified by:
        hasLight in interface PvDisplayIf
        Parameters:
        light - a light object
        Returns:
        true if light is registered.
      • removeLights

        public void removeLights()
        Remove all lights from list of registered lights in this scene.
        Specified by:
        removeLights in interface PvDisplayIf
      • removeLight

        public boolean removeLight(PvLightIf light)
        Remove light from list of registered lights in this scene.
        Specified by:
        removeLight in interface PvDisplayIf
        Parameters:
        light - a registered light object to be removed
        Returns:
        true if light was found and successfully removed.
        Version:
        13.06.05, 1.10 revised (kp) Bug corrected which prevented deletion of light from special geometries.
      • getSelectedLight

        public PvLightIf getSelectedLight()
        Select light from the list of registered lights in this scene.
        Specified by:
        getSelectedLight in interface PvDisplayIf
        Returns:
        light object if it was found and successfully selected, else null.
      • hasAxes

        public boolean hasAxes()
        Check existence of axes geometry.
      • recomputeAxes

        public void recomputeAxes()
        Recalculate length of axes depending on bounding box of scene or current geometry depending on current transformation mode.
      • getAxes

        public PgAxes getAxes()
        Get axes geometry with individual rulers for each coordinate axis. If axes were never visible and never assigned from outside then no axes exist and null is returned.

        Before v2.00 of this method, axes were created if they did not exist.

        Version:
        21.03.04, 2.00 revised (kp) No longer creates axes but return null if no axes exist.
      • setAxes

        public void setAxes(PgAxes axes)
        Register axes geometry in this display. By default, the axes is not visible. Switching off the visibility.
      • isShowingAxes

        public boolean isShowingAxes()
        Check whether axes of active geometry is currently showing.
        Specified by:
        isShowingAxes in interface PvDisplayIf
      • showAxes

        public void showAxes(boolean aFlag)
        Set visibility of axes active geometry, and create axes if not available. If visibility is set to false, then axes are removed from the display but not deleted.
        Specified by:
        showAxes in interface PvDisplayIf
      • getPickType

        public int getPickType()
        Get pick type which determines the class of pickable geometries in pick and initialPick mode.

        A set of geometry classes may be determined using or'ed combinations of other PICK_yyy types.

        Since:
        JavaView 3.96.037
        See Also:
        PvDisplayIf.PICK_ALL
        Version:
        04.09.06, 1.00 created (kp)
      • setPickType

        public void setPickType(int type)
        Set pick type which determines the class of pickable geometries in pick and initialPick mode.

        A set of geometry classes may be determined using or'ed combinations of other PICK_yyy types.

        Since:
        JavaView 3.96.037
        See Also:
        PvDisplayIf.PICK_ALL
        Version:
        04.09.06, 1.00 created (kp)
      • isEnabledIntegerPick

        public boolean isEnabledIntegerPick()
        Check whether picking is constrained to an integer grid.
        Specified by:
        isEnabledIntegerPick in interface PvDisplayIf
        Since:
        JavaView 3.63.002
      • setEnabledIntegerPick

        public void setEnabledIntegerPick(boolean flag)
        Restrict picking to an integer grid.
        Specified by:
        setEnabledIntegerPick in interface PvDisplayIf
        Since:
        JavaView 3.63.002
      • isShowingMagnet

        public boolean isShowingMagnet()
        Check whether cursor attached to vertices if nearby.
        Specified by:
        isShowingMagnet in interface PvDisplayIf
      • showMagnet

        public void showMagnet(boolean aFlag)
        Attach cursor to vertices if nearby.
        Specified by:
        showMagnet in interface PvDisplayIf
      • isEnabledDirectSelect

        public boolean isEnabledDirectSelect()
        Check whether selecting is enabled during mouse pick.
        Specified by:
        isEnabledDirectSelect in interface PvDisplayIf
      • setEnabledDirectSelect

        public void setEnabledDirectSelect(boolean flag)
        Enable and disable clipping with front and back plane.
        Specified by:
        setEnabledDirectSelect in interface PvDisplayIf
      • isEnabledFastClipping

        public static boolean isEnabledFastClipping()
        Check whether fast clipping of geometry items is enabled.
        Version:
        01.06.07, 1.00 created (kp)
      • setEnabledFastClipping

        public static void setEnabledFastClipping(boolean aFlag)
        Enable and disable fast clipping of geometry items during rendering.
        See Also:
        isEnabledFastClipping()
        Version:
        01.06.07, 1.00 created (kp)
      • isEnabledZBuffer

        public boolean isEnabledZBuffer()
        Check whether z-buffered drawing is enabled.
        Specified by:
        isEnabledZBuffer in interface PvDisplayIf
      • isEnabledTags

        public boolean isEnabledTags()
        Determine whether tag mode is enabled to move marked elements.
      • setEnabledTags

        public void setEnabledTags(boolean flag)
        Enable and disable tag mode to move marked elements.
      • isEnabledPainters

        public boolean isEnabledPainters()
        Check whether painter's algorithm during drawing is enabled.
        Specified by:
        isEnabledPainters in interface PvDisplayIf
      • setEnabledPainters

        public void setEnabledPainters(boolean flag)
        Enable and disable painter's algorithm during drawing, i.e. a z-sort of drawing items.
        Specified by:
        setEnabledPainters in interface PvDisplayIf
      • isEnabledClip

        public boolean isEnabledClip()
        Check whether clipping with front and back plane is enabled.
        Specified by:
        isEnabledClip in interface PvDisplayIf
      • setEnabledClip

        public void setEnabledClip(boolean flag)
        Enable and disable clipping with front and back plane in camera viewing direction.
        Specified by:
        setEnabledClip in interface PvDisplayIf
      • isEnabledClipAutoBounds

        public boolean isEnabledClipAutoBounds()
        Check whether automatic recalculation of clip range is enabled when clipRange is switched on.
        Specified by:
        isEnabledClipAutoBounds in interface PvDisplayIf
      • setEnabledClipAutoBounds

        public void setEnabledClipAutoBounds(boolean flag)
        Enable automatic recalculation of clip range when clipRange is switched on.
        Specified by:
        setEnabledClipAutoBounds in interface PvDisplayIf
      • isEnabledClipBounds

        public boolean isEnabledClipBounds()
        Check whether clipping with scene in direction of coordinate axis is enabled.
        Specified by:
        isEnabledClipBounds in interface PvDisplayIf
      • setEnabledClipBounds

        public void setEnabledClipBounds(boolean flag)
        Enable and disable clipping of scene along coordinate axes.
        Specified by:
        setEnabledClipBounds in interface PvDisplayIf
      • isEnabledBoxRatio

        public boolean isEnabledBoxRatio()
        Check whether individual scaling factors of coordinate axes is enabled.
        Specified by:
        isEnabledBoxRatio in interface PvDisplayIf
      • setEnabledBoxRatio

        public void setEnabledBoxRatio(boolean flag)
        Enable and disable individual scaling factors of coordinate axes.
        Specified by:
        setEnabledBoxRatio in interface PvDisplayIf
      • getBoxRatio

        public PdVector getBoxRatio()
        Get individual scaling factors of coordinate axes.
        Specified by:
        getBoxRatio in interface PvDisplayIf
        Returns:
        scaling factors of coordinate axes
        Since:
        JavaView 2.60.002
        Version:
        15.03.03, 1.00 created (kp)
      • setBoxRatio

        public void setBoxRatio(PdVector ratio)
        Set individual scaling factors of coordinate axes.
        Specified by:
        setBoxRatio in interface PvDisplayIf
        Parameters:
        ratio - scaling factors of coordinate axes
        Since:
        JavaView 2.60.002
        Version:
        15.03.03, 1.00 created (kp)
      • isClip

        public boolean isClip()
        Deprecated. use #isEnabledClip
        Check whether clipping with front and back plane is enabled.
        Specified by:
        isClip in interface PvDisplayIf
      • enableClip

        public void enableClip(boolean aFlag)
        Deprecated. use #setEnabledClip
        Enable and disable clipping with front and back plane.
        Specified by:
        enableClip in interface PvDisplayIf
      • getNearClip

        public double getNearClip()
        Get near clip distance of current camera. Returns a value even if clipping is disabled.
        Specified by:
        getNearClip in interface PvDisplayIf
      • setNearClip

        public void setNearClip(double dist)
        Set near clip distance of current camera, works even if clipping is disabled.
        Specified by:
        setNearClip in interface PvDisplayIf
      • getFarClip

        public double getFarClip()
        Get far clip distance of current camera. Returns a value even if clipping is disabled.
        Specified by:
        getFarClip in interface PvDisplayIf
      • setFarClip

        public void setFarClip(double dist)
        Set far clip distance of current camera, works even if clipping is disabled.
        Specified by:
        setFarClip in interface PvDisplayIf
      • getClipBoundsType

        public int getClipBoundsType()
        Get index of axis which is selected when scene clip bounds is active of becomes active.
        Specified by:
        getClipBoundsType in interface PvDisplayIf
        Since:
        JavaView 2.99.012
        Version:
        01.09.03, 1.00 created (kp)
      • setClipBoundsType

        public void setClipBoundsType(int type)
        Set index of axis which is selected when scene clip bounds is active of becomes active.
        Specified by:
        setClipBoundsType in interface PvDisplayIf
        Since:
        JavaView 2.99.012
        Version:
        01.09.03, 1.00 created (kp)
      • getClipBounds

        public double[] getClipBounds(int ind)
        Get minimum and maximum in one dimension of the clipping box.
        Specified by:
        getClipBounds in interface PvDisplayIf
        Parameters:
        ind - index of ruler of axes in which direction is clipped
        Returns:
        range minimum and maximum of visible range in axis direction
        Since:
        JavaView 2.49.005
        Version:
        19.01.03, 1.00 created (kp)
      • setClipBounds

        public void setClipBounds(int ind,
                                  double[] range)
        Set minimum and maximum in one dimension of the clipping box.
        Specified by:
        setClipBounds in interface PvDisplayIf
        Parameters:
        ind - index of ruler of axes in which direction is clipped
        range - minimum and maximum of visible range in axis direction
        Since:
        JavaView 2.49.005
        Version:
        21.05.03, 1.10 revised (kp) Adjusted to the use of PuDouble.
        19.01.03, 1.00 created (kp)
      • isEnabled3DLook

        public boolean isEnabled3DLook()
        Check whether thick vertices and edges are drawn as 3d shapes in z-buffer mode.
        Specified by:
        isEnabled3DLook in interface PvDisplayIf
        Since:
        JavaView 3.20.004
        Version:
        11.04.04, 1.00 created (kp)
      • setEnabled3DLook

        public void setEnabled3DLook(boolean flag)
        Enable drawing of thick vertices and edges as 3d shapes in z-buffer mode.
        Specified by:
        setEnabled3DLook in interface PvDisplayIf
        Since:
        JavaView 3.20.004
        Version:
        11.04.04, 1.00 created (kp)
      • isEnabledAdaptiveSize

        public boolean isEnabledAdaptiveSize()
        Check whether adaptive thickness of vertices and edges is enabled.
        Specified by:
        isEnabledAdaptiveSize in interface PvDisplayIf
        Since:
        JavaView 3.22.000
        Version:
        25.04.04, 1.00 created (kp)
      • setEnabledAdaptiveSize

        public void setEnabledAdaptiveSize(boolean flag)
        Enabled adaptive thickness of vertices and edges.
        Specified by:
        setEnabledAdaptiveSize in interface PvDisplayIf
        Since:
        JavaView 3.22.000
        Version:
        25.04.04, 1.00 created (kp)
      • getTransMatrix

        public PdMatrix getTransMatrix(int type)
        Get 4*4 transformation matrix or components from current camera and display. Allows to transform world coordinates into screen coordinates [0,0]*[width-1,height-1] of display.
        Specified by:
        getTransMatrix in interface PvDisplayIf
        Parameters:
        type - Any matrix type jv.project.PvDisplayIf#MATRIX_...
      • setTransMatrix

        public void setTransMatrix(int type,
                                   PdMatrix mat)
        Set transformation matrices PV, P, V and their inverses in current camera and display. Allows to transform world coordinates into screen coordinates [0,0]*[width-1,height-1] of display.

        Modeling matrix should be set in original geometry model.

        Specified by:
        setTransMatrix in interface PvDisplayIf
        Parameters:
        type - Any matrix type jv.project.PvDisplayIf#MATRIX_...
        Version:
        28.11.02, 1.10 revised (kp) Body moved to PvCamera#setTransMatrix().
      • isShowingAllViews

        public boolean isShowingAllViews()
        Check drawing of copyright information in the display window.
      • addCamera

        public int addCamera(java.lang.String aName,
                             PvCamera aCamera)
        Add new camera and make it accessible under the given name. Most applications use the built-in cameras. TODO: Method currently does not allow to add user defined cameras.
        Returns:
        unique key of camera which allows to select camera, or -1 if error.
      • getCamera

        public PvCameraIf getCamera()
        Get current camera object.
        Specified by:
        getCamera in interface PvDisplayIf
        Returns:
        current camera object
      • getCameras

        public PvCameraIf[] getCameras()
        Get current camera object.
        Specified by:
        getCameras in interface PvDisplayIf
        Returns:
        current camera object
      • setAutoCenter

        public void setAutoCenter(boolean flag)
        Set flag which determines whether camera will automatically center on geometry. An argument false will prevent automatic centering.
        Specified by:
        setAutoCenter in interface PvDisplayIf
      • getPosition

        public java.awt.Point getPosition(int xPos,
                                          int yPos)
        Get upper left corner of frame, or null if no parent frame available.
      • setPosition

        public void setPosition(int xPos,
                                int yPos)
        Set position of upper left corner of frame from outside.
      • getSize

        public java.awt.Dimension getSize()
        Get height of drawing canvas.
        Specified by:
        getSize in interface PvDisplayIf
        Overrides:
        getSize in class java.awt.Component
      • setSizeWithinFrame

        public void setSizeWithinFrame(int width,
                                       int height)
        Set dimension of display which is included in a parent frame. This call should be used instead of a direct call of setSize(Dimension) resp. setSize(int, int). Size of parent frame is the size of the display plus the its border margins.
        Specified by:
        setSizeWithinFrame in interface PvDisplayIf
        Parameters:
        width - width of display area, not of parent frame
        height - height of display area, not of parent frame
        Version:
        17.08.14, 2.00 revised (kp) Correct error when updating display size.
      • setDefaultSize

        public static void setDefaultSize(java.awt.Dimension size)
        Set default dimension of drawing canvas from outside. TODO: since v3.63.002, should use setPreferredSize(Dimension) but problem with static/non-static.
      • setPreferredSize

        public void setPreferredSize(java.awt.Dimension size)
        Set default dimension of drawing canvas from outside.
        Overrides:
        setPreferredSize in class java.awt.Component
        Since:
        since JavaView v3.63.002.
      • setExternalRenderSize

        public void setExternalRenderSize(int width,
                                          int height)
        Set dimension of the external render image.

        This method modifies internally the size of the doubleBuffer, offscreen and antialias images, if active. When external rendering is switched off then the internal images are resized back to size of this display canvas.

        Parameters:
        width - width of external render image
        height - height of external render image
        See Also:
        setEnabledExternalRendering(boolean)
      • isEnabledExternalRendering

        public boolean isEnabledExternalRendering()
        Check if rendering into an external image is enabled.
        Version:
        12.07.02, 1.00 created (kp)
      • setEnabledExternalRendering

        public void setEnabledExternalRendering(boolean flag)
        Enable rendering into an external image.

        Drawing into an external image blocks rendering into the AWT drawing canvas of this display. The external image is the doubleBuffer image which may be obtained from this display using getImage(). Future versions may allow to set the external image into which rendering is done.

        See Also:
        setExternalRenderSize(int width, int height)
        Version:
        12.07.02, 1.00 created (kp)
      • setParent

        public void setParent(PsUpdateIf father)
        Set father of display which receives update events when current class has changed. Method must be defined since PvDisplay does not derive from PsObject.
        Specified by:
        setParent in interface PsUpdateIf
        Parameters:
        father - will receive events which this does not handle
        See Also:
        PsUpdateIf.getFather(), PsUpdateIf.update(Object)
      • isEnabledRepaint

        public boolean isEnabledRepaint()
        Determine whether painting is enabled.
        Specified by:
        isEnabledRepaint in interface PvDisplayIf
        Since:
        JavaView 3.62.000
        Version:
        31.10.04, 1.00 created (kp)
      • setEnabledRepaint

        public void setEnabledRepaint(boolean flag)
        Set flag which determines whether painting is enabled. Switch off repaint when updating a larger number of geometries at the same time.
        Specified by:
        setEnabledRepaint in interface PvDisplayIf
        Since:
        JavaView 3.62.000
        Version:
        31.10.04, 1.00 created (kp)
      • isEnabledUpdate

        public boolean isEnabledUpdate()
        Determine whether update mechanism is enabled.
        Specified by:
        isEnabledUpdate in interface PvDisplayIf
      • setEnabledUpdate

        public void setEnabledUpdate(boolean flag)
        Set flag which determines whether update mechanism is enabled.
        Specified by:
        setEnabledUpdate in interface PvDisplayIf
      • update

        public boolean update(java.lang.Object event)
        Handle update events sent to display by JavaView. Notice, Java itself sends update(Graphics) calls to display too.
        Specified by:
        update in interface PsUpdateIf
        Specified by:
        update in interface PvDisplayIf
        Parameters:
        event - carries a lot of information
        Returns:
        true if event has been handled, otherwise false
        See Also:
        PsObject, PsUpdateIf.getFather(), PsUpdateIf.setParent(PsUpdateIf)
        Version:
        16.04.06, 1.30 (kp) Perform update of infoPanel AFTER update of geometries since name of geometry must be known.
        10.07.00, 1.20 (kp) Removed special handling for grid, now it is an ordinary geometry.
        30.09.99, 1.10 (kp) revised Check for m_grid added.
      • setPaintTag

        public void setPaintTag(long flags,
                                boolean val)
        Set all bits which are set in parameter. See jv.project.PvDisplayIf for a list of possible flags.

        Special flag for internal purpose is PAINT_ZOOM: Scale transformation matrix to simulate floating point accuracy in pixel integers. Required for PostScript printing to increase pixel accuracy.

        HACK: This PostScript Driver temporarily scales all integer valued quantities during display by a factor of PS_ZOOM to increase accuracy. The variable PS_ZOOM is set to allow to adjust all 'thickness' sizes as well. The thickness sizes are not scaled by PostScript, so we must do it in PvThickGraphics by hand. This procedure is very error prune.

        Setting flag PvDisplayIf#PAINT_ALL invokes a repaint() of the display, just for convenience.

        Specified by:
        setPaintTag in interface PvDisplayIf
        See Also:
        hasPaintTag(long)
      • paint

        public void paint(java.awt.Graphics g)
        Main method to initiate the drawing of a scene. This methods overrides Canvas.paint(g) to initiate redrawing of geometries.
        Overrides:
        paint in class java.awt.Canvas
        Version:
        10.06.17, 2.00 revised (kp) Full revision with new internal images and better sync with update(g).
      • update

        public void update(java.awt.Graphics g)
        Override Component.update(g) to initiate redrawing of geometries.
        Overrides:
        update in class java.awt.Canvas
        Version:
        10.06.17, 2.00 revised (kp) Better sync with paint(g), directly call paint(g).
      • repaint

        public void repaint()
        For debug only.
        Overrides:
        repaint in class java.awt.Component
      • render

        public void render()
        Initiate the rendering process when using this display as a batch renderer.
        Version:
        15.07.02, 1.00 created (kp)
      • resizeImage

        public boolean resizeImage()
        Resize the target screen image if user has changed the canvas size. Scale background image to fit the whole canvas. Disable width and height slider if container is not a frame.
        Returns:
        false if size of display still 0.
        Version:
        03.02.02, 2.00 revised (kp) Split into different devices, pick, offscreen and display.
        17.07.00, 1.10 revised (kp) Do not center scene if m_currentGeometry is null.
      • getImage

        public java.awt.Image getImage()
        Make image of display available to outside world.
        Specified by:
        getImage in interface PvDisplayIf
      • isEnabledAntiAlias

        public boolean isEnabledAntiAlias()
        Check if antialiased drawing is enabled.
        Specified by:
        isEnabledAntiAlias in interface PvDisplayIf
        Version:
        05.12.01, 1.00 created (ep)
      • setEnabledAntiAlias

        public void setEnabledAntiAlias(boolean flag)
        Enable antialiased drawing. Antialiased drawing will slow down the rendering speed.
        Specified by:
        setEnabledAntiAlias in interface PvDisplayIf
        Version:
        05.12.01, 1.00 created (ep)
      • isEnabledDoubleBuffer

        public boolean isEnabledDoubleBuffer()
        Check if double buffered drawing is enabled.
        Specified by:
        isEnabledDoubleBuffer in interface PvDisplayIf
        Version:
        06.05.02, 1.00 created (kp)
      • setEnabledDoubleBuffer

        public void setEnabledDoubleBuffer(boolean flag)
        Enable double buffered drawing.
        Specified by:
        setEnabledDoubleBuffer in interface PvDisplayIf
        Version:
        06.05.02, 1.00 created (kp)
      • getBackgroundImage

        public java.awt.Image getBackgroundImage()
        Make background image of display available to outside world.
        Specified by:
        getBackgroundImage in interface PvDisplayIf
      • getBackgroundImageFile

        public java.lang.String getBackgroundImageFile()
        Get filename of background image of display canvas.
        Specified by:
        getBackgroundImageFile in interface PvDisplayIf
        Returns:
        relative file name of image.
      • setBackgroundImageFile

        public void setBackgroundImageFile(java.lang.String fileName)
        Set filename of background image of display canvas. Method tries to load file immediately if showing of image is enabled.
        Specified by:
        setBackgroundImageFile in interface PvDisplayIf
        Parameters:
        fileName - relative file name of image.
        Since:
        JavaView 2.31
        Version:
        02.11.02, 1.20 revised (kp) Just return if fileName is same as current filename.
        05.10.02, 1.10 revised (kp) Load image only if image is showing.
      • setBackgroundImage

        public void setBackgroundImage(java.lang.String fileName)
        Deprecated. use setBackgroundImageFile(String)
        Load an image from file and set it as background image of display canvas. Method tries to load the image from file immediately.
        Parameters:
        fileName - relative file name of image.
      • getForegroundImage

        public java.awt.Image getForegroundImage()
        Get foreground image of display canvas.
        Specified by:
        getForegroundImage in interface PvDisplayIf
        Since:
        JavaView 2.31
      • getForegroundImageFile

        public java.lang.String getForegroundImageFile()
        Get filename of foreground image of display canvas.
        Specified by:
        getForegroundImageFile in interface PvDisplayIf
        Returns:
        relative file name of image.
        Since:
        JavaView 2.31
      • setForegroundImageFile

        public void setForegroundImageFile(java.lang.String fileName)
        Load an image from file and set it as foreground image of display canvas. Method tries to load file immediately if showing of image is enabled.
        Specified by:
        setForegroundImageFile in interface PvDisplayIf
        Parameters:
        fileName - relative file name of image.
        Since:
        JavaView 2.31
        Version:
        02.11.02, 1.20 revised (kp) Just return of fileName is same as current filename.
        05.10.02, 1.10 revised (kp) Load image only if image is showing.
      • mousePressed

        public void mousePressed(java.awt.event.MouseEvent event)
        Do not react on popup events or other than left mouse clicks.
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Version:
        09.06.06, 1.30 (kp) Use pressed middle mouse button for translation.
        01.06.00, 1.20 (kp) Do not react on popup events or other than left mouse clicks.
        11.03.00, 1.10 (kp) Use copy instead of set() of m_worldPick to keep bitfield in vertex.
      • mouseDragged

        public void mouseDragged(java.awt.event.MouseEvent event)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Version:
        27.02.03, 2.20 revised (kp) Avoid repaint when dragging in initialPick and displayPick modes.
        27.09.01, 2.10 revised (kp) Shift constraint rotation corrected.
      • mouseReleased

        public void mouseReleased(java.awt.event.MouseEvent event)
        Handle mouse key release events.
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Version:
        07.10.17, 2.10 revised (kp) In fastAntialias mode re-enable antiAlias after dragging with middle and right mouse.
        17.07.12, 2.00 revised (ur) Enable popup menu on Mac OS.
      • getPickEvent

        public PvPickEvent getPickEvent(int x,
                                        int y)
        Find intersection of ray through pick locus on visible geometries and background. The hit point with the nearest geometry of the set of tested geometries is returned. The type of tested geometries can be configured using the parameter pickType.

        The set of tested geometries is determined by the method getPickType().

        Parameters:
        x - x coordinate of mouse pick in pixel coordinates of display.
        y - y coordinate of mouse pick in pixel coordinates of display.
        Returns:
        Hit point on the nearest tested geometry is returned.
        See Also:
        getPickEvent(int, int, int), getPickType()
        Version:
        26.11.06, 2.00 revised (kp) Body of original method is now contained in getPickEvent(int, int, int).
        23.04.01, 1.20 revised (kp) Assign viewBase as picked vertex of no geometry is hit.
        03.07.00, 1.10 revised (kp) Check other geometries, ignore non visible ones.
        03.07.00, 1.00 created (kp) Extracted from other methods.
      • getPickEvent

        public PvPickEvent getPickEvent(int x,
                                        int y,
                                        int pickType)
        Find intersection of ray through pick locus on visible geometries and background. The hit point with the nearest geometry of the set of tested geometries is returned. The type of tested geometries can be configured using the parameter pickType.

        The parameter pickType determines the set of tested geometries. The different types are given, for example, by: PvDisplay.PICK_SELECTED|PvDisplay.PICK_UNSELECTED.

        Parameters:
        x - x coordinate of mouse pick in pixel coordinates of display.
        y - y coordinate of mouse pick in pixel coordinates of display.
        pickType - Determines the set of tested geometries.
        Returns:
        Hit point on the nearest tested geometry is returned.
        See Also:
        getPickEvent(int, int)
        Version:
        26.11.06, 2.00 revised (kp) Signature extended from getPickEvent(int, int) by adding pickType.
        23.04.01, 1.20 revised (kp) Assign viewBase as picked vertex of no geometry is hit.
        03.07.00, 1.10 revised (kp) Check other geometries, ignore non visible ones.
        03.07.00, 1.00 created (kp) Extracted from other methods.
      • mouseMoved

        public void mouseMoved(java.awt.event.MouseEvent event)
        Updates mouse position and invokes temporary information like magnet and info.
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
      • mouseEntered

        public void mouseEntered(java.awt.event.MouseEvent event)
        This display requests the focus when the mouse enters the canvas unless request of focus is disabled by external calls. Disable the requestFocus since this would bring the display to front.
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
        Version:
        08.12.02, 1.30 (kp) Allow to switch of request of focus.
        15.06.02, 1.20 (kp) Avoid bringing display to front when mouse enters the canvas.
      • mouseExited

        public void mouseExited(java.awt.event.MouseEvent event)
        Sets a flag that mouse is outside.
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
      • mouseClicked

        public void mouseClicked(java.awt.event.MouseEvent event)
        Shows popup menu if event is a popup trigger.
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
      • getMajorMode

        public int getMajorMode()
        Get the current interaction mode. Modes may be changed either interactively using a keyboard shortcuts, or via the display panel or using via method. Modes are available in in jv.project.PvDisplayIf, for example, PvDisplayIf.MODE_SCALE
        Specified by:
        getMajorMode in interface PvDisplayIf
        Returns:
        aMode any of the modes available in PvDisplayIf.
        See Also:
        setMajorMode(int)
      • setMajorMode

        public void setMajorMode(int mode)
        Switch between interaction modes like rotating or scaling, usually done interactively. Modes may be changed either interactively using a keyboard shortcuts, or via the display panel or using via method. Modes are available in in jv.project.PvDisplayIf, for example, PvDisplayIf.MODE_SCALE
        Specified by:
        setMajorMode in interface PvDisplayIf
        Parameters:
        mode - any of the modes available in PvDisplayIf.
        See Also:
        getMajorMode()
      • keyTyped

        public void keyTyped(java.awt.event.KeyEvent event)
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
      • keyReleased

        public void keyReleased(java.awt.event.KeyEvent event)
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
      • keyPressed

        public void keyPressed(java.awt.event.KeyEvent event)
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
        Version:
        07.06.06, 1.20 revised (kp) Ctrl-shift-tab added.
        24.03.03, 1.10 revised (kp) Ctrl-tab now ignores invisible geometries.
      • configure

        public void configure(PvDisplayIf disp)
        Configure an empty given display with all settings and geometries of this display. The only exception is the name of the argument display which is not changed during configuration if not empty before.
        Parameters:
        disp - target display which will be configured
        Since:
        JavaView 2.46
        Version:
        22.07.06, 1.20 revised (kp) All listeners registered in new display as well.
        11.06.06, 1.10 revised (kp) Name of argument display no longer changed.
        17.11.02, 1.00 created (kp)
      • actionPerformed

        public void actionPerformed(java.awt.event.ActionEvent event)
        Perform action events, currently used for popup menu events only.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • clearPopupMenu

        public void clearPopupMenu()
        Removes all added menu items from right-mouse popup menu, except some standard JavaView items such as "exit". Use addPopupItem(int) to fill popup menu with own selection of menu items.
        Specified by:
        clearPopupMenu in interface PvDisplayIf
        Since:
        JavaView 3.97.044
        See Also:
        addPopupItem(int)
        Version:
        05.01.07, 1.00 created (kp)
      • addPopupItem

        public void addPopupItem(int menuID)
        Add a menu item to the right-mouse popup menu. Menu items appear in the same order in which they where added.

        Possible menu items are all major modes of PvDisplay specified in PsViewerIf#MENU_DISPLAY_XXX plus MENU_FILE_NEW_DISPLAY, MENU_WINDOW_CONSOLE, MENU_INSPECTOR and MENU_SEPARATOR.

        Specified by:
        addPopupItem in interface PvDisplayIf
        Since:
        JavaView 3.97.044
        See Also:
        clearPopupMenu()
        Version:
        05.01.07, 1.00 created (kp)
      • getInfoPanel

        public PsPanel getInfoPanel()
        Get info panel of display. Display allocates panel if it does not exist.
        Specified by:
        getInfoPanel in interface PvDisplayIf
        Version:
        07.06.00, 1.10 revised (kp) Recreate panel if language has changed.
      • getCameraPanel

        public PsPanel getCameraPanel()
        Get info panel of current camera. Camera allocates panel if it does not exist.
        Specified by:
        getCameraPanel in interface PvDisplayIf
      • getAxisPanel

        public PsPanel getAxisPanel()
        Get info panel of axes object to control all rulers uniformly. If axis object is null then an axis object is created.
        Version:
        18.03.06, 1.10 revised (kp) Create an axis object if missing.
      • getAxisPanel

        public PsPanel getAxisPanel(int ind)
        Get info panel of individual ruler.
        Parameters:
        ind - identifies requested ruler, for example, PsViewerIf.AXIS_X.
        Since:
        JavaView 3.62.011
        Version:
        25.11.04, 1.00 created (kp)
      • createDefaultLights

        public void createDefaultLights()
        Create default lights of JavaView.
      • createDefaultHighlight

        public void createDefaultHighlight()
        Create default lights with highlight of JavaView.
      • getMinimumSize

        public java.awt.Dimension getMinimumSize()
        Assure correct horizontal size of all project panels. TODO: locate preferred horizontal size in PsConfig. This method was necessary since especially PaParmSurface_IP tends to shrink.
        Overrides:
        getMinimumSize in class java.awt.Component
        Version:
        16.06.17, 1.10 revised (kp) Avoid call m_renderCanvas.getPreferredSize() since infinite loop when closing project curve/CurvaturePlot.
      • getPreferredSize

        public java.awt.Dimension getPreferredSize()
        Assure correct horizontal size of all project panels. TODO: locate preferred horizontal size in PsConfig. This method was necessary since especially PaParmSurface_IP tends to shrink.
        Overrides:
        getPreferredSize in class java.awt.Component
      • start

        public void start()
        Start animation by creating a new thread
        Specified by:
        start in interface PvDisplayIf
      • stop

        public void stop()
        Stop animation by stopping the thread. Netscape does not like to suspend a thread.
        Specified by:
        stop in interface PvDisplayIf
      • run

        public void run()
        Do the animation by incrementing the transformation matrix with the last action.
        Specified by:
        run in interface java.lang.Runnable
      • setAutoRotation

        public void setAutoRotation(PdVector axis,
                                    double angle)
        Set axis and angle for auto-rotation.
        Specified by:
        setAutoRotation in interface PvDisplayIf
      • incrementAutoRotation

        public boolean incrementAutoRotation()
        Do a single increment of auto-rotation animation. Method is invoked from PvViewer to generate GIF animations.
        Specified by:
        incrementAutoRotation in interface PvDisplayIf
        Version:
        26.09.00, 1.10 revised (kp) Renamed to incrementAutoRotation to remove dependency on jv.anim.
      • burn

        public void burn()
        Burn the current status as texture on each surface.
        Version:
        06.06.03, 1.00 created (kp)
      • selectLight

        public boolean selectLight(PvLightIf light)
        Select light from the list of registered lights in this scene.
        Specified by:
        selectLight in interface PvDisplayIf
        Parameters:
        light - a registered light object
        Returns:
        true if light was found and successfully selected.
      • showAllViews

        public void showAllViews(boolean flag)
        Enable and disable drawing of copyright information in the display window.
        Parameters:
        flag - enable or disable 4-camera-view
        Since:
        JavaView 2.46
        Version:
        06.05.16, 2.00 revised (kp) Configuration and launch of three minor displays revised.
        17.11.02, 1.00 created (kp)
"JavaView? v5.03.003"

"

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

You see the box below because you did not login.