jvx.imageDisplay

## Class PvImageDisplay

- java.lang.Object
- - jv.object.PsObject
  - - jvx.imageDisplay.PvImageDisplay

- All Implemented Interfaces:
    java.awt.event.ComponentListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, PsUpdateIf, PvCameraListenerIf

      public class PvImageDisplay
      extends PsObject
      implements java.awt.event.ComponentListener, PvCameraListenerIf

  Wrapper of a JavaView display provides interaction with the background image. The background image will be computed in an image source and assigned to the display. Camera interaction is handled and allows zooming, translation and rect-zoom into the image.
  See Also:
    Serialized Form
  Author:
    Konrad Polthier
  Version:
    05.11.16, 1.00 revised (kp) Better integration in project handling
    24.03.11, 1.00 created (kp)

- - ### Field Summary

    - ### Fields inherited from class jv.object.PsObject

      `HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PvImageDisplay()` Constructor creates a new display and some sliders.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `componentHidden(java.awt.event.ComponentEvent comp)` Invoked when component has been hidden.
    `void` | `componentMoved(java.awt.event.ComponentEvent comp)` Invoked when component has been moved.
    `void` | `componentResized(java.awt.event.ComponentEvent comp)` When component has been resized all images must be resized.
    `void` | `componentShown(java.awt.event.ComponentEvent comp)` Invoked when component has been shown.
    `static PdVector` | `computeDomainBounds(java.awt.Dimension size, PdVector interest, double dist)` Compute new viewport in xy-plane centered at given interest and dimensions.
    `void` | `dragCamera(PvCameraEvent event)` Get camera position and viewing direction when a mouse drag event has occurred.
    `double` | `getDistance()` Get distance of camera to z=0-plane.
    `PvDisplayIf` | `getImageDisplay()` Get image display.
    `double` | `getImageSize()` Get image size factor, i.e. the ratio of image size to canvas size.
    `PiImageSource` | `getImageSource()` Get image source.
    `PdVector` | `getInterest()` Get interest of camera.
    `void` | `init()` Performed default initialization.
    `void` | `pickCamera(PvCameraEvent event)` Get camera position and viewing direction when a mouse pressed event has occurred.
    `void` | `reset()` Called when project is launched by project start method.
    `void` | `setDistance(double distance)` Set distance of camera to z=0-plane.
    `void` | `setImageDisplay(PvDisplayIf disp)` Set image display.
    `void` | `setImageSize(double factor)` Set image size factor, i.e. the ratio of image size to canvas size.
    `void` | `setImageSource(PiImageSource imageSource)` Set image source.
    `void` | `setInterest(PdVector interest)` Set interest of camera.
    `void` | `start()` Performs further initialization of this display.
    `boolean` | `update(java.lang.Object event)` Update the class whenever a child has changed.

    - ### Methods inherited from class jv.object.PsObject

      `addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels`

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

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

    - ### Methods inherited from interface jv.project.PvCameraListenerIf

      `getName`

- - ### Constructor Detail

    - #### PvImageDisplay

          public PvImageDisplay()

      Constructor creates a new display and some sliders.

  - ### Method Detail

    - #### init

          public void init()

      Performed default initialization.
      Overrides:
        `init` in class `PsObject`

    - #### start

          public void start()

      Performs further initialization of this display. Should be called when parent project is started by viewer.

    - #### reset

          public void reset()

      Called when project is launched by project start method.

    - #### update

          public boolean update(java.lang.Object event)

      Update the class whenever a child has changed. Method is usually invoked from the children.
      Specified by:
        `update` in interface `PsUpdateIf`
      Overrides:
        `update` in class `PsObject`
      Parameters:
        `event` - carries a lot of information
      Returns:
        true if event has been handled, otherwise false
      See Also:
        `PsObject.setParent(PsUpdateIf)`, `PsObject.getFather()`, `PsObject.addUpdateListener(PsUpdateIf)`

    - #### getImageDisplay

          public PvDisplayIf getImageDisplay()

      Get image display.

    - #### setImageDisplay

          public void setImageDisplay(PvDisplayIf disp)

      Set image display.

    - #### getImageSource

          public PiImageSource getImageSource()

      Get image source.

    - #### setImageSource

          public void setImageSource(PiImageSource imageSource)

      Set image source.

    - #### getInterest

          public PdVector getInterest()

      Get interest of camera.
      Returns:
        interest of camera

    - #### setInterest

          public void setInterest(PdVector interest)

      Set interest of camera.
      Parameters:
        `interest` - interest of camera

    - #### getDistance

          public double getDistance()

      Get distance of camera to z=0-plane.
      Returns:
        distance of camera to z=0-plane

    - #### setDistance

          public void setDistance(double distance)

      Set distance of camera to z=0-plane.
      Parameters:
        `distance` - distance of camera to z=0-plane

    - #### getImageSize

          public double getImageSize()

      Get image size factor, i.e. the ratio of image size to canvas size.

      A factor 1 means that the image has same size than the canvas, resp. a factor 0.5. means that the image is half the size of the canvas, leading to larger pixelization effects but also to a faster computation.

      Returns:
        ratio of image size to canvas size

    - #### setImageSize

          public void setImageSize(double factor)

      Set image size factor, i.e. the ratio of image size to canvas size.

      A factor 1 means that the image has same size than the canvas, resp. a factor 0.5. means that the image is half the size of the canvas, leading to larger pixelization effects but also to a faster computation.

      Parameters:
        `factor` - ratio of image size to canvas size

    - #### componentShown

          public void componentShown(java.awt.event.ComponentEvent comp)

      Invoked when component has been shown.
      Specified by:
        `componentShown` in interface `java.awt.event.ComponentListener`

    - #### componentHidden

          public void componentHidden(java.awt.event.ComponentEvent comp)

      Invoked when component has been hidden.
      Specified by:
        `componentHidden` in interface `java.awt.event.ComponentListener`

    - #### componentMoved

          public void componentMoved(java.awt.event.ComponentEvent comp)

      Invoked when component has been moved.
      Specified by:
        `componentMoved` in interface `java.awt.event.ComponentListener`

    - #### componentResized

          public void componentResized(java.awt.event.ComponentEvent comp)

      When component has been resized all images must be resized.
      Specified by:
        `componentResized` in interface `java.awt.event.ComponentListener`

    - #### dragCamera

          public void dragCamera(PvCameraEvent event)

      Get camera position and viewing direction when a mouse drag event has occurred. No pick information about geometry is supplied.
      Specified by:
        `dragCamera` in interface `PvCameraListenerIf`
      Parameters:
        `event` - Drag event issued by the display
      See Also:
        `PvCameraListenerIf`

    - #### pickCamera

          public void pickCamera(PvCameraEvent event)

      Get camera position and viewing direction when a mouse pressed event has occurred. No pick information about geometry is supplied.
      Specified by:
        `pickCamera` in interface `PvCameraListenerIf`
      Parameters:
        `event` - Pick event issued by the display
      See Also:
        `PvCameraListenerIf`

    - #### computeDomainBounds

          public static PdVector computeDomainBounds(java.awt.Dimension size,
                                                     PdVector interest,
                                                     double dist)

      Compute new viewport in xy-plane centered at given interest and dimensions. Dimension of new viewport is computed based on given aspect ratio, interest and distance of camera.
      Parameters:
        `size` - current size of display, used to compute aspect ratio
        `interest` - camera interest, xy-coordinates used
        `dist` - camera distance
      Version:
        16.07.13, 1.10 revised (kp) Effect of y-move inverted i.e. corrected.

"

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