Class CaptureSupportImpl

java.lang.Object
org.testfx.service.support.impl.CaptureSupportImpl
All Implemented Interfaces:
CaptureSupport

public class CaptureSupportImpl extends Object implements CaptureSupport
  • Field Details

  • Constructor Details

    • CaptureSupportImpl

      public CaptureSupportImpl(BaseRobot baseRobot)
  • Method Details

    • captureNode

      public javafx.scene.image.Image captureNode(javafx.scene.Node node)
      Description copied from interface: CaptureSupport
      Returns a snapshot of the node.
      Specified by:
      captureNode in interface CaptureSupport
    • captureRegion

      public javafx.scene.image.Image captureRegion(javafx.geometry.Rectangle2D region)
      Description copied from interface: CaptureSupport
      Returns a screenshot of the given region.
      Specified by:
      captureRegion in interface CaptureSupport
    • loadImage

      public javafx.scene.image.Image loadImage(Path path)
      Description copied from interface: CaptureSupport
      Loads the image file from the given path.
      Specified by:
      loadImage in interface CaptureSupport
    • saveImage

      public void saveImage(javafx.scene.image.Image image, Path path)
      Description copied from interface: CaptureSupport
      Saves the given image to the given path.
      Specified by:
      saveImage in interface CaptureSupport
    • saveImage

      public void saveImage(javafx.scene.image.Image image, CaptureFileFormat format, Path path)
      Description copied from interface: CaptureSupport
      Saves the given image, with a provided fileformat to the given path.
      Specified by:
      saveImage in interface CaptureSupport
    • annotateImage

      public javafx.scene.image.Image annotateImage(javafx.scene.shape.Shape shape, javafx.scene.image.Image image)
      Description copied from interface: CaptureSupport
      NOT YET IMPLEMENTED
      Specified by:
      annotateImage in interface CaptureSupport
    • matchImages

      public PixelMatcherResult matchImages(javafx.scene.image.Image image0, javafx.scene.image.Image image1, PixelMatcher pixelMatcher)
      Description copied from interface: CaptureSupport
      Compares two images and returns a PixelMatcherResult that defines the how similar/dissimilar one was from the other.
      Specified by:
      matchImages in interface CaptureSupport
    • checkFileExists

      private void checkFileExists(Path path)
    • checkParentDirectoryExists

      private void checkParentDirectoryExists(Path path)
    • snapshotNodeToImage

      private javafx.scene.image.Image snapshotNodeToImage(javafx.scene.Node node)
    • readImageFromStream

      private javafx.scene.image.Image readImageFromStream(InputStream inputStream) throws IOException
      Throws:
      IOException
    • writeImageToStream

      private void writeImageToStream(javafx.scene.image.Image image, String imageFormat, OutputStream outputStream) throws IOException
      Throws:
      IOException
    • blendImages

      private javafx.scene.image.Image blendImages(javafx.scene.image.Image image0, javafx.scene.image.Image image1, javafx.scene.effect.BlendMode blendMode, javafx.geometry.Pos alignment)