Class ImagePane.CoordinateTranslator

java.lang.Object
is.codion.swing.common.ui.component.image.ImagePane.CoordinateTranslator
Enclosing class:
ImagePane

public final class ImagePane.CoordinateTranslator extends Object
Provides coordinate translations.
  • Method Details

    • toImage

      public Point2D.Double toImage(Point paneCoordinate)
      Converts this pane's point into the original image coordinates
      Parameters:
      paneCoordinate - the pane coordinates
      Returns:
      the image coordinates
    • toPane

      public Point2D.Double toPane(Point2D.Double imageCoordinate)
      Converts the original image point into this pane's coordinates
      Parameters:
      imageCoordinate - the image coordinates
      Returns:
      the pane coordinates
    • withinImage

      public boolean withinImage(Point paneCoordinate)
      Tests whether a given pane coordinate in the pane falls within the image boundaries.
      Parameters:
      paneCoordinate - the point on the pane
      Returns:
      true if an image is available and the given point is within the image