Class Equirectangular
- java.lang.Object
-
- java.awt.event.ComponentAdapter
-
- org.openstreetmap.josm.gui.layer.geoimage.viewers.projections.Equirectangular
-
- All Implemented Interfaces:
ComponentListener
,EventListener
,IImageViewer
public class Equirectangular extends ComponentAdapter implements IImageViewer
A class for showing 360 images that use the equirectangular projection- Since:
- 18246
-
-
Field Summary
Fields Modifier and Type Field Description private CameraPlane
cameraPlane
private BufferedImage
offscreenImage
-
Constructor Summary
Constructors Constructor Description Equirectangular()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkAndModifyVisibleRectSize(Image image, ImageDisplay.VisRect visibleRect)
Check and modify the visible rect size to appropriate dimensionsvoid
componentResized(ComponentEvent e)
ImageDisplay.VisRect
getDefaultVisibleRectangle(Component component, Image image)
Get the default visible rectangle for the projectionImage
getMaxImageSize(ImageDisplay imageDisplay, Image image)
Get the maximum image size that can be displayedVector3D
getRotation()
Get the current rotation in the image viewerSet<Projections>
getSupportedProjections()
Get the supported projections for the image viewervoid
mouseDragged(Point from, Point to, ImageDisplay.VisRect currentVisibleRect)
Indicate that the mouse has been dragged to a pointvoid
paintImage(Graphics g, BufferedImage image, Rectangle target, Rectangle visibleRect)
Paint the image-
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
-
-
-
-
Field Detail
-
cameraPlane
private volatile CameraPlane cameraPlane
-
offscreenImage
private volatile BufferedImage offscreenImage
-
-
Constructor Detail
-
Equirectangular
public Equirectangular()
-
-
Method Detail
-
getSupportedProjections
public Set<Projections> getSupportedProjections()
Description copied from interface:IImageViewer
Get the supported projections for the image viewer- Specified by:
getSupportedProjections
in interfaceIImageViewer
- Returns:
- The projections supported. Typically, only one.
-
paintImage
public void paintImage(Graphics g, BufferedImage image, Rectangle target, Rectangle visibleRect)
Description copied from interface:IImageViewer
Paint the image- Specified by:
paintImage
in interfaceIImageViewer
- Parameters:
g
- The graphics to paint onimage
- The image to painttarget
- The target areavisibleRect
- The visible rectangle
-
getDefaultVisibleRectangle
public ImageDisplay.VisRect getDefaultVisibleRectangle(Component component, Image image)
Description copied from interface:IImageViewer
Get the default visible rectangle for the projection- Specified by:
getDefaultVisibleRectangle
in interfaceIImageViewer
- Parameters:
component
- The component the image will be displayed inimage
- The image that will be shown- Returns:
- The default visible rectangle
-
getRotation
public Vector3D getRotation()
Description copied from interface:IImageViewer
Get the current rotation in the image viewer- Specified by:
getRotation
in interfaceIImageViewer
- Returns:
- The rotation
-
componentResized
public void componentResized(ComponentEvent e)
- Specified by:
componentResized
in interfaceComponentListener
- Overrides:
componentResized
in classComponentAdapter
-
mouseDragged
public void mouseDragged(Point from, Point to, ImageDisplay.VisRect currentVisibleRect)
Description copied from interface:IImageViewer
Indicate that the mouse has been dragged to a point- Specified by:
mouseDragged
in interfaceIImageViewer
- Parameters:
from
- The point the mouse was dragged fromto
- The point the mouse has been dragged tocurrentVisibleRect
- The currently visible rectangle (this is updated by the default implementation)
-
checkAndModifyVisibleRectSize
public void checkAndModifyVisibleRectSize(Image image, ImageDisplay.VisRect visibleRect)
Description copied from interface:IImageViewer
Check and modify the visible rect size to appropriate dimensions- Specified by:
checkAndModifyVisibleRectSize
in interfaceIImageViewer
- Parameters:
image
- The image to use for checkingvisibleRect
- the visible rectangle to update
-
getMaxImageSize
public Image getMaxImageSize(ImageDisplay imageDisplay, Image image)
Description copied from interface:IImageViewer
Get the maximum image size that can be displayed- Specified by:
getMaxImageSize
in interfaceIImageViewer
- Parameters:
imageDisplay
- The image displayimage
- The image- Returns:
- The maximum image size (may be the original image passed in)
-
-