Class CompareTwoImagePanel

All Implemented Interfaces:
MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
AssociationPanel, AssociationScorePanel

public abstract class CompareTwoImagePanel
extends JPanel
implements MouseListener, MouseMotionListener
Panel for displaying two images next to each other separated by a border.
See Also:
Serialized Form
  • Field Details

    • leftPts

      protected List<Point2D_F64> leftPts
    • rightPts

      protected List<Point2D_F64> rightPts
    • selectedIsLeft

      protected boolean selectedIsLeft
    • selectRegion

      protected boolean selectRegion
    • borderSize

      protected int borderSize
    • leftImage

      protected BufferedImage leftImage
    • rightImage

      protected BufferedImage rightImage
    • scaleLeft

      protected double scaleLeft
    • scaleRight

      protected double scaleRight
    • firstClick

      @Nullable protected @Nullable Point2D_I32 firstClick
    • mousePosition

      protected Point2D_I32 mousePosition
  • Constructor Details

    • CompareTwoImagePanel

      protected CompareTwoImagePanel​(int borderSize, boolean canSelectRegion)
  • Method Details

    • setLocation

      public void setLocation​(List<Point2D_F64> leftPts, List<Point2D_F64> rightPts)
    • setPreferredSize

      public void setPreferredSize​(int widthLeft, int heightLeft, int widthRight, int heightRight)
    • setImages

      public void setImages​(BufferedImage leftImage, BufferedImage rightImage)
      Sets the internal images. Not thread safe.
    • paintComponent

      public void paintComponent​(Graphics g)
      paintComponent in class JComponent
    • drawFeatures

      protected abstract void drawFeatures​(Graphics2D g2, double scaleLeft, int leftX, int leftY, double scaleRight, int rightX, int rightY)
      Implement this function to draw features related to each image.
      scaleLeft - Scale of left image.
      leftX - Left image (0,0) coordinate.
      leftY - Left image (0,0) coordinate.
      scaleRight - Scale of right image.
      rightX - Right image (0,0) coordinate.
      rightY - Right image (0,0) coordinate.
    • mouseClicked

      public void mouseClicked​(MouseEvent e)
      Specified by:
      mouseClicked in interface MouseListener
    • isValidPoint

      protected abstract boolean isValidPoint​(int index)
    • mousePressed

      public void mousePressed​(MouseEvent e)
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased​(MouseEvent e)
      Specified by:
      mouseReleased in interface MouseListener
    • mouseEntered

      public void mouseEntered​(MouseEvent e)
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited​(MouseEvent e)
      Specified by:
      mouseExited in interface MouseListener
    • mouseDragged

      public void mouseDragged​(MouseEvent e)
      Specified by:
      mouseDragged in interface MouseMotionListener
    • mouseMoved

      public void mouseMoved​(MouseEvent e)
      Specified by:
      mouseMoved in interface MouseMotionListener