Class Equirectangular

  • All Implemented Interfaces:
    java.awt.event.ComponentListener, java.util.EventListener, IImageViewer

    public class Equirectangular
    extends java.awt.event.ComponentAdapter
    implements IImageViewer
    A class for showing 360 images that use the equirectangular projection
    Since:
    18246
    • Constructor Summary

      Constructors 
      Constructor Description
      Equirectangular()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkAndModifyVisibleRectSize​(java.awt.Image image, ImageDisplay.VisRect visibleRect)
      Check and modify the visible rect size to appropriate dimensions
      void componentResized​(java.awt.event.ComponentEvent e)  
      ImageDisplay.VisRect getDefaultVisibleRectangle​(java.awt.Component component, java.awt.Image image)
      Get the default visible rectangle for the projection
      java.awt.Image getMaxImageSize​(ImageDisplay imageDisplay, java.awt.Image image)
      Get the maximum image size that can be displayed
      Vector3D getRotation()
      Get the current rotation in the image viewer
      java.util.Set<Projections> getSupportedProjections()
      Get the supported projections for the image viewer
      void mouseDragged​(java.awt.Point from, java.awt.Point to, ImageDisplay.VisRect currentVisibleRect)
      Indicate that the mouse has been dragged to a point
      void paintImage​(java.awt.Graphics g, java.awt.image.BufferedImage image, java.awt.Rectangle target, java.awt.Rectangle visibleRect)
      Paint the image
      private CameraPlane updateCameraPlane​(int width, int height)
      Update the current camera plane
      • Methods inherited from class java.awt.event.ComponentAdapter

        componentHidden, componentMoved, componentShown
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.awt.event.ComponentListener

        componentHidden, componentMoved, componentShown
    • Method Detail

      • paintImage

        public void paintImage​(java.awt.Graphics g,
                               java.awt.image.BufferedImage image,
                               java.awt.Rectangle target,
                               java.awt.Rectangle visibleRect)
        Description copied from interface: IImageViewer
        Paint the image
        Specified by:
        paintImage in interface IImageViewer
        Parameters:
        g - The graphics to paint on
        image - The image to paint
        target - The target area
        visibleRect - The visible rectangle
      • componentResized

        public void componentResized​(java.awt.event.ComponentEvent e)
        Specified by:
        componentResized in interface java.awt.event.ComponentListener
        Overrides:
        componentResized in class java.awt.event.ComponentAdapter
      • updateCameraPlane

        @Nonnull
        private CameraPlane updateCameraPlane​(int width,
                                              int height)
        Update the current camera plane
        Parameters:
        width - The width to use
        height - The height to use
      • mouseDragged

        public void mouseDragged​(java.awt.Point from,
                                 java.awt.Point to,
                                 ImageDisplay.VisRect currentVisibleRect)
        Description copied from interface: IImageViewer
        Indicate that the mouse has been dragged to a point
        Specified by:
        mouseDragged in interface IImageViewer
        Parameters:
        from - The point the mouse was dragged from
        to - The point the mouse has been dragged to
        currentVisibleRect - The currently visible rectangle (this is updated by the default implementation)
      • getMaxImageSize

        public java.awt.Image getMaxImageSize​(ImageDisplay imageDisplay,
                                              java.awt.Image image)
        Description copied from interface: IImageViewer
        Get the maximum image size that can be displayed
        Specified by:
        getMaxImageSize in interface IImageViewer
        Parameters:
        imageDisplay - The image display
        image - The image
        Returns:
        The maximum image size (may be the original image passed in)