Interface IImageViewer
-
- All Superinterfaces:
java.awt.event.ComponentListener
,java.util.EventListener
- All Known Implementing Classes:
Equirectangular
,Perspective
public interface IImageViewer extends java.awt.event.ComponentListener
An interface for image viewers for specific projections- Since:
- 18246
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
checkAndModifyVisibleRectSize(java.awt.Image image, ImageDisplay.VisRect visibleRect)
Check and modify the visible rect size to appropriate dimensionsImageDisplay.VisRect
getDefaultVisibleRectangle(java.awt.Component component, java.awt.Image image)
Get the default visible rectangle for the projectiondefault java.awt.Image
getMaxImageSize(ImageDisplay imageDisplay, java.awt.Image image)
Get the maximum image size that can be displayeddefault Vector3D
getRotation()
Get the current rotation in the image viewerjava.util.Set<Projections>
getSupportedProjections()
Get the supported projections for the image viewerdefault void
mouseDragged(java.awt.Point from, java.awt.Point to, ImageDisplay.VisRect currentVisibleRect)
Indicate that the mouse has been dragged to a pointvoid
paintImage(java.awt.Graphics g, java.awt.image.BufferedImage image, java.awt.Rectangle target, java.awt.Rectangle visibleRect)
Paint the image
-
-
-
Method Detail
-
getSupportedProjections
java.util.Set<Projections> getSupportedProjections()
Get the supported projections for the image viewer- Returns:
- The projections supported. Typically, only one.
-
paintImage
void paintImage(java.awt.Graphics g, java.awt.image.BufferedImage image, java.awt.Rectangle target, java.awt.Rectangle visibleRect)
Paint the image- Parameters:
g
- The graphics to paint onimage
- The image to painttarget
- The target areavisibleRect
- The visible rectangle
-
getDefaultVisibleRectangle
ImageDisplay.VisRect getDefaultVisibleRectangle(java.awt.Component component, java.awt.Image image)
Get the default visible rectangle for the projection- Parameters:
component
- The component the image will be displayed inimage
- The image that will be shown- Returns:
- The default visible rectangle
-
getRotation
default Vector3D getRotation()
Get the current rotation in the image viewer- Returns:
- The rotation
- Since:
- 18263
-
mouseDragged
default void mouseDragged(java.awt.Point from, java.awt.Point to, ImageDisplay.VisRect currentVisibleRect)
Indicate that the mouse has been dragged to a point- 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
default void checkAndModifyVisibleRectSize(java.awt.Image image, ImageDisplay.VisRect visibleRect)
Check and modify the visible rect size to appropriate dimensions- Parameters:
visibleRect
- the visible rectangle to updateimage
- The image to use for checking
-
getMaxImageSize
default java.awt.Image getMaxImageSize(ImageDisplay imageDisplay, java.awt.Image image)
Get the maximum image size that can be displayed- Parameters:
imageDisplay
- The image displayimage
- The image- Returns:
- The maximum image size (may be the original image passed in)
-
-