changeset 12:c1848648774f tip

7902419: Resolve package name conflicts in Jemmy v3 Reviewed-by: hirt, ghb, reinhapa
author shurailine
date Mon, 03 Jun 2019 11:12:19 -0700
parents 7f267a1c3d63
children
files SWT/JemmySWT/pom.xml SWT/JemmySWT/src/org/jemmy/input/KeyboardSelectable.java SWT/JemmySWT/src/org/jemmy/input/KeyboardSelector.java SWT/JemmySWT/src/org/jemmy/swt/CComboWrap.java SWT/JemmySWT/src/org/jemmy/swt/ComboWrap.java SWT/JemmySWT/src/org/jemmy/swt/ListWrap.java SWT/JemmySWT/src/org/jemmy/swt/Shells.java SWT/JemmySWT/src/org/jemmy/swt/TreeWrap.java SWT/JemmySWT/src/org/jemmy/swt/input/KeyboardSelectable.java SWT/JemmySWT/src/org/jemmy/swt/input/KeyboardSelector.java SWT/JemmySWT/src/org/jemmy/swt/jemmy.properties core/JemmyAWTInput/build.xml core/JemmyAWTInput/pom.xml core/JemmyAWTInput/src/org/jemmy/image/AWTImage.java core/JemmyAWTInput/src/org/jemmy/image/AWTRobotCapturer.java core/JemmyAWTInput/src/org/jemmy/image/AbstractImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/AverageDistanceImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/BufferedImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/ClasspathImageLoader.java core/JemmyAWTInput/src/org/jemmy/image/ColorImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/DiffDialog.form core/JemmyAWTInput/src/org/jemmy/image/DiffDialog.java core/JemmyAWTInput/src/org/jemmy/image/FilesystemImageLoader.java core/JemmyAWTInput/src/org/jemmy/image/ImageFinder.java core/JemmyAWTInput/src/org/jemmy/image/ImageTool.java core/JemmyAWTInput/src/org/jemmy/image/NaturalImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/PNGDecoder.java core/JemmyAWTInput/src/org/jemmy/image/PNGEncoder.java core/JemmyAWTInput/src/org/jemmy/image/PNGImageLoader.java core/JemmyAWTInput/src/org/jemmy/image/PNGImageSaver.java core/JemmyAWTInput/src/org/jemmy/image/ResizeImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/RoughImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/RoughImageFinder.java core/JemmyAWTInput/src/org/jemmy/image/StrictImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/StrictImageFinder.java core/JemmyAWTInput/src/org/jemmy/image/Utils.java core/JemmyAWTInput/src/org/jemmy/image/awt/AWTImage.java core/JemmyAWTInput/src/org/jemmy/image/awt/AWTRobotCapturer.java core/JemmyAWTInput/src/org/jemmy/image/awt/AbstractImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/awt/AverageDistanceImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/awt/BufferedImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/awt/ClasspathImageLoader.java core/JemmyAWTInput/src/org/jemmy/image/awt/ColorImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/awt/DiffDialog.form core/JemmyAWTInput/src/org/jemmy/image/awt/DiffDialog.java core/JemmyAWTInput/src/org/jemmy/image/awt/FilesystemImageLoader.java core/JemmyAWTInput/src/org/jemmy/image/awt/ImageFinder.java core/JemmyAWTInput/src/org/jemmy/image/awt/ImageTool.java core/JemmyAWTInput/src/org/jemmy/image/awt/NaturalImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/awt/PNGDecoder.java core/JemmyAWTInput/src/org/jemmy/image/awt/PNGEncoder.java core/JemmyAWTInput/src/org/jemmy/image/awt/PNGImageLoader.java core/JemmyAWTInput/src/org/jemmy/image/awt/PNGImageSaver.java core/JemmyAWTInput/src/org/jemmy/image/awt/ResizeImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/awt/RoughImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/awt/RoughImageFinder.java core/JemmyAWTInput/src/org/jemmy/image/awt/StrictImageComparator.java core/JemmyAWTInput/src/org/jemmy/image/awt/StrictImageFinder.java core/JemmyAWTInput/src/org/jemmy/image/awt/Utils.java core/JemmyAWTInput/src/org/jemmy/image/awt/package.html core/JemmyAWTInput/src/org/jemmy/image/package.html core/JemmyAWTInput/src/org/jemmy/input/AWTMap.java core/JemmyAWTInput/src/org/jemmy/input/AWTRobotInputFactory.java core/JemmyAWTInput/src/org/jemmy/input/ClassReference.java core/JemmyAWTInput/src/org/jemmy/input/DragImpl.java core/JemmyAWTInput/src/org/jemmy/input/KeyboardImpl.java core/JemmyAWTInput/src/org/jemmy/input/MouseImpl.java core/JemmyAWTInput/src/org/jemmy/input/RobotDriver.java core/JemmyAWTInput/src/org/jemmy/input/RobotExecutor.java core/JemmyAWTInput/src/org/jemmy/input/Version.java core/JemmyAWTInput/src/org/jemmy/input/awt/AWTMap.java core/JemmyAWTInput/src/org/jemmy/input/awt/AWTRobotInputFactory.java core/JemmyAWTInput/src/org/jemmy/input/awt/ClassReference.java core/JemmyAWTInput/src/org/jemmy/input/awt/DragImpl.java core/JemmyAWTInput/src/org/jemmy/input/awt/KeyboardImpl.java core/JemmyAWTInput/src/org/jemmy/input/awt/MouseImpl.java core/JemmyAWTInput/src/org/jemmy/input/awt/RobotDriver.java core/JemmyAWTInput/src/org/jemmy/input/awt/RobotExecutor.java core/JemmyAWTInput/src/org/jemmy/input/awt/Version.java core/JemmyAWTInput/src/org/jemmy/input/awt/jemmy.properties core/JemmyAWTInput/src/org/jemmy/input/jemmy.properties core/JemmyAWTInput/src/org/jemmy/operators/AWTScreen.java core/JemmyAWTInput/src/org/jemmy/operators/awt/AWTScreen.java core/JemmyAWTInput/test/org/jemmy/image/AreaChart_a.png core/JemmyAWTInput/test/org/jemmy/image/AreaChart_a_res.png core/JemmyAWTInput/test/org/jemmy/image/AverageDistanceImageComparatorTest.java core/JemmyAWTInput/test/org/jemmy/image/CheckBox_a_start.png core/JemmyAWTInput/test/org/jemmy/image/CheckBox_a_start_res.png core/JemmyAWTInput/test/org/jemmy/image/EnvTest.java core/JemmyAWTInput/test/org/jemmy/image/ImageResizerTest.java core/JemmyAWTInput/test/org/jemmy/image/InitTest.java core/JemmyAWTInput/test/org/jemmy/image/NaturalImageComparatorTest.java core/JemmyAWTInput/test/org/jemmy/image/SaveLoadTest.java core/JemmyAWTInput/test/org/jemmy/image/ScreenAreaImageTest.java core/JemmyAWTInput/test/org/jemmy/image/ScreenImageTest.java core/JemmyAWTInput/test/org/jemmy/image/awt/AreaChart_a.png core/JemmyAWTInput/test/org/jemmy/image/awt/AreaChart_a_res.png core/JemmyAWTInput/test/org/jemmy/image/awt/AverageDistanceImageComparatorTest.java core/JemmyAWTInput/test/org/jemmy/image/awt/CheckBox_a_start.png core/JemmyAWTInput/test/org/jemmy/image/awt/CheckBox_a_start_res.png core/JemmyAWTInput/test/org/jemmy/image/awt/EnvTest.java core/JemmyAWTInput/test/org/jemmy/image/awt/ImageResizerTest.java core/JemmyAWTInput/test/org/jemmy/image/awt/InitTest.java core/JemmyAWTInput/test/org/jemmy/image/awt/NaturalImageComparatorTest.java core/JemmyAWTInput/test/org/jemmy/image/awt/SaveLoadTest.java core/JemmyAWTInput/test/org/jemmy/image/awt/ScreenAreaImageTest.java core/JemmyAWTInput/test/org/jemmy/image/awt/ScreenImageTest.java core/JemmyAWTInput/test/org/jemmy/image/awt/comparator/ComparatorTest.java core/JemmyAWTInput/test/org/jemmy/image/awt/comparator/actual-averagedistance.png core/JemmyAWTInput/test/org/jemmy/image/awt/comparator/actual-hyperlink.png core/JemmyAWTInput/test/org/jemmy/image/awt/comparator/actual-strict.png core/JemmyAWTInput/test/org/jemmy/image/awt/comparator/golden-averagedistance.png core/JemmyAWTInput/test/org/jemmy/image/awt/comparator/golden-hyperlink.png core/JemmyAWTInput/test/org/jemmy/image/awt/comparator/golden-strict.png core/JemmyAWTInput/test/org/jemmy/image/awt/data/golden/fail.png core/JemmyAWTInput/test/org/jemmy/image/awt/data/golden/mess.png core/JemmyAWTInput/test/org/jemmy/image/awt/data/golden/missed.png core/JemmyAWTInput/test/org/jemmy/image/awt/data/golden/pass.png core/JemmyAWTInput/test/org/jemmy/image/awt/data/results/fail.png core/JemmyAWTInput/test/org/jemmy/image/awt/data/results/mess.png core/JemmyAWTInput/test/org/jemmy/image/awt/data/results/new.png core/JemmyAWTInput/test/org/jemmy/image/awt/data/results/pass.png core/JemmyAWTInput/test/org/jemmy/image/awt/image1.jpg core/JemmyAWTInput/test/org/jemmy/image/awt/image2.jpg core/JemmyAWTInput/test/org/jemmy/image/awt/image3.jpg core/JemmyAWTInput/test/org/jemmy/image/awt/test_image.png core/JemmyAWTInput/test/org/jemmy/image/comparator/ComparatorTest.java core/JemmyAWTInput/test/org/jemmy/image/comparator/actual-averagedistance.png core/JemmyAWTInput/test/org/jemmy/image/comparator/actual-hyperlink.png core/JemmyAWTInput/test/org/jemmy/image/comparator/actual-strict.png core/JemmyAWTInput/test/org/jemmy/image/comparator/golden-averagedistance.png core/JemmyAWTInput/test/org/jemmy/image/comparator/golden-hyperlink.png core/JemmyAWTInput/test/org/jemmy/image/comparator/golden-strict.png core/JemmyAWTInput/test/org/jemmy/image/image1.jpg core/JemmyAWTInput/test/org/jemmy/image/image2.jpg core/JemmyAWTInput/test/org/jemmy/image/image3.jpg core/JemmyAWTInput/test/org/jemmy/image/test_image.png core/JemmyAWTInput/test/org/jemmy/image/tool/data/golden/fail.png core/JemmyAWTInput/test/org/jemmy/image/tool/data/golden/mess.png core/JemmyAWTInput/test/org/jemmy/image/tool/data/golden/missed.png core/JemmyAWTInput/test/org/jemmy/image/tool/data/golden/pass.png core/JemmyAWTInput/test/org/jemmy/image/tool/data/results/fail.png core/JemmyAWTInput/test/org/jemmy/image/tool/data/results/mess.png core/JemmyAWTInput/test/org/jemmy/image/tool/data/results/new.png core/JemmyAWTInput/test/org/jemmy/image/tool/data/results/pass.png core/JemmyAWTInput/test/org/jemmy/input/AWTMapTest.java core/JemmyAWTInput/test/org/jemmy/input/RobotDriver2Test.java core/JemmyAWTInput/test/org/jemmy/input/RobotDriverTest.java core/JemmyAWTInput/test/org/jemmy/input/RobotExecutorTest.java core/JemmyAWTInput/test/org/jemmy/input/SmoothMoveTest.java core/JemmyAWTInput/test/org/jemmy/input/awt/AWTMapTest.java core/JemmyAWTInput/test/org/jemmy/input/awt/RobotDriver2Test.java core/JemmyAWTInput/test/org/jemmy/input/awt/RobotDriverTest.java core/JemmyAWTInput/test/org/jemmy/input/awt/RobotExecutorTest.java core/JemmyAWTInput/test/org/jemmy/input/awt/SmoothMoveTest.java core/JemmyAWTInput/test/org/jemmy/operators/ScreenTest.java core/JemmyAWTInput/test/org/jemmy/operators/awt/ScreenTest.java core/JemmyBrowser/pom.xml core/JemmyCore/pom.xml pom.xml
diffstat 160 files changed, 8945 insertions(+), 8906 deletions(-) [+]
line wrap: on
line diff
--- a/SWT/JemmySWT/pom.xml	Tue Jan 08 15:44:49 2019 -0800
+++ b/SWT/JemmySWT/pom.xml	Mon Jun 03 11:12:19 2019 -0700
@@ -28,7 +28,7 @@
     <parent>
         <groupId>org.adoptopenjdk</groupId>
         <artifactId>jemmy</artifactId>
-        <version>1.0.2</version>
+        <version>2.0.0</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <artifactId>jemmy-swt</artifactId>
@@ -83,17 +83,17 @@
         <dependency>
             <groupId>org.adoptopenjdk</groupId>
             <artifactId>jemmy-core</artifactId>
-            <version>1.0.2</version>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.adoptopenjdk</groupId>
             <artifactId>jemmy-browser</artifactId>
-            <version>1.0.2</version>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.adoptopenjdk</groupId>
             <artifactId>jemmy-awt-input</artifactId>
-            <version>1.0.2</version>
+            <version>${project.version}</version>
         </dependency>
     </dependencies>
 </project>
--- a/SWT/JemmySWT/src/org/jemmy/input/KeyboardSelectable.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-import org.jemmy.interfaces.Selectable;
-
-/**
- *
- * @author shura
- */
-public interface KeyboardSelectable<T> extends Selectable<T> {
-    public boolean isVertical();
-    public int index(T item);
-    public int selection();
-}
--- a/SWT/JemmySWT/src/org/jemmy/input/KeyboardSelector.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-import org.jemmy.control.Wrap;
-import org.jemmy.interfaces.Focusable;
-import org.jemmy.interfaces.Keyboard.KeyboardButton;
-import org.jemmy.interfaces.Keyboard.KeyboardButtons;
-import org.jemmy.interfaces.Selector;
-
-/**
- *
- * @author shura
- */
-public class KeyboardSelector<T> implements Selector<T> {
-
-    private final Wrap<?> wrap;
-    private final KeyboardSelectable<T> control;
-
-    public KeyboardSelector(Wrap<?> wrap, KeyboardSelectable<T> control) {
-        this.wrap = wrap;
-        this.control = control;
-    }
-
-    public void select(T state) {
-        wrap.as(Focusable.class).focuser().focus();
-        int to = control.index(state);
-        int from = control.selection();
-        KeyboardButton btt;
-        if (control.isVertical()) {
-            btt = (to > from)
-                    ? KeyboardButtons.DOWN : KeyboardButtons.UP;
-        } else {
-            btt = (to > from)
-                    ? KeyboardButtons.RIGHT : KeyboardButtons.LEFT;
-        }
-        for (int i = 0; i < Math.abs(to - from); i++) {
-            wrap.keyboard().pushKey(btt);
-        }
-    }
-}
--- a/SWT/JemmySWT/src/org/jemmy/swt/CComboWrap.java	Tue Jan 08 15:44:49 2019 -0800
+++ b/SWT/JemmySWT/src/org/jemmy/swt/CComboWrap.java	Mon Jun 03 11:12:19 2019 -0700
@@ -32,8 +32,8 @@
 import org.jemmy.control.Property;
 import org.jemmy.control.Wrap;
 import org.jemmy.env.Environment;
-import org.jemmy.input.KeyboardSelectable;
-import org.jemmy.input.KeyboardSelector;
+import org.jemmy.swt.input.KeyboardSelectable;
+import org.jemmy.swt.input.KeyboardSelector;
 import org.jemmy.input.SelectionText;
 import org.jemmy.interfaces.ControlInterface;
 import org.jemmy.interfaces.Focusable;
--- a/SWT/JemmySWT/src/org/jemmy/swt/ComboWrap.java	Tue Jan 08 15:44:49 2019 -0800
+++ b/SWT/JemmySWT/src/org/jemmy/swt/ComboWrap.java	Mon Jun 03 11:12:19 2019 -0700
@@ -33,8 +33,8 @@
 import org.jemmy.control.Property;
 import org.jemmy.control.Wrap;
 import org.jemmy.env.Environment;
-import org.jemmy.input.KeyboardSelectable;
-import org.jemmy.input.KeyboardSelector;
+import org.jemmy.swt.input.KeyboardSelectable;
+import org.jemmy.swt.input.KeyboardSelector;
 import org.jemmy.input.SelectionText;
 import org.jemmy.interfaces.ControlInterface;
 import org.jemmy.interfaces.Focusable;
--- a/SWT/JemmySWT/src/org/jemmy/swt/ListWrap.java	Tue Jan 08 15:44:49 2019 -0800
+++ b/SWT/JemmySWT/src/org/jemmy/swt/ListWrap.java	Mon Jun 03 11:12:19 2019 -0700
@@ -30,8 +30,8 @@
 import org.jemmy.action.GetAction;
 import org.jemmy.control.ControlType;
 import org.jemmy.env.Environment;
-import org.jemmy.input.KeyboardSelectable;
-import org.jemmy.input.KeyboardSelector;
+import org.jemmy.swt.input.KeyboardSelectable;
+import org.jemmy.swt.input.KeyboardSelector;
 import org.jemmy.interfaces.Focusable;
 import org.jemmy.interfaces.Selector;
 
--- a/SWT/JemmySWT/src/org/jemmy/swt/Shells.java	Tue Jan 08 15:44:49 2019 -0800
+++ b/SWT/JemmySWT/src/org/jemmy/swt/Shells.java	Mon Jun 03 11:12:19 2019 -0700
@@ -32,7 +32,7 @@
 import org.jemmy.action.GetAction;
 import org.jemmy.control.DefaultWrapper;
 import org.jemmy.env.Environment;
-import org.jemmy.input.AWTRobotInputFactory;
+import org.jemmy.input.awt.AWTRobotInputFactory;
 import org.jemmy.lookup.AbstractParent;
 import org.jemmy.lookup.ControlHierarchy;
 import org.jemmy.lookup.HierarchyLookup;
--- a/SWT/JemmySWT/src/org/jemmy/swt/TreeWrap.java	Tue Jan 08 15:44:49 2019 -0800
+++ b/SWT/JemmySWT/src/org/jemmy/swt/TreeWrap.java	Mon Jun 03 11:12:19 2019 -0700
@@ -35,8 +35,8 @@
 import org.jemmy.control.Property;
 import org.jemmy.control.Wrap;
 import org.jemmy.env.Environment;
-import org.jemmy.input.KeyboardSelectable;
-import org.jemmy.input.KeyboardSelector;
+import org.jemmy.swt.input.KeyboardSelectable;
+import org.jemmy.swt.input.KeyboardSelector;
 import org.jemmy.input.StringTree;
 import org.jemmy.interfaces.ControlInterface;
 import org.jemmy.interfaces.Focusable;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SWT/JemmySWT/src/org/jemmy/swt/input/KeyboardSelectable.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.swt.input;
+
+import org.jemmy.interfaces.Selectable;
+
+/**
+ *
+ * @author shura
+ */
+public interface KeyboardSelectable<T> extends Selectable<T> {
+    public boolean isVertical();
+    public int index(T item);
+    public int selection();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SWT/JemmySWT/src/org/jemmy/swt/input/KeyboardSelector.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.swt.input;
+
+import org.jemmy.control.Wrap;
+import org.jemmy.interfaces.Focusable;
+import org.jemmy.interfaces.Keyboard.KeyboardButton;
+import org.jemmy.interfaces.Keyboard.KeyboardButtons;
+import org.jemmy.interfaces.Selector;
+
+/**
+ *
+ * @author shura
+ */
+public class KeyboardSelector<T> implements Selector<T> {
+
+    private final Wrap<?> wrap;
+    private final KeyboardSelectable<T> control;
+
+    public KeyboardSelector(Wrap<?> wrap, KeyboardSelectable<T> control) {
+        this.wrap = wrap;
+        this.control = control;
+    }
+
+    public void select(T state) {
+        wrap.as(Focusable.class).focuser().focus();
+        int to = control.index(state);
+        int from = control.selection();
+        KeyboardButton btt;
+        if (control.isVertical()) {
+            btt = (to > from)
+                    ? KeyboardButtons.DOWN : KeyboardButtons.UP;
+        } else {
+            btt = (to > from)
+                    ? KeyboardButtons.RIGHT : KeyboardButtons.LEFT;
+        }
+        for (int i = 0; i < Math.abs(to - from); i++) {
+            wrap.keyboard().pushKey(btt);
+        }
+    }
+}
--- a/SWT/JemmySWT/src/org/jemmy/swt/jemmy.properties	Tue Jan 08 15:44:49 2019 -0800
+++ b/SWT/JemmySWT/src/org/jemmy/swt/jemmy.properties	Mon Jun 03 11:12:19 2019 -0700
@@ -1,4 +1,4 @@
-version.major=1
+version.major=2
 version.minor=0
-version.mini=2
+version.mini=0
 build=${buildnumber} 
--- a/core/JemmyAWTInput/build.xml	Tue Jan 08 15:44:49 2019 -0800
+++ b/core/JemmyAWTInput/build.xml	Mon Jun 03 11:12:19 2019 -0700
@@ -27,7 +27,7 @@
     <import file="${basedir}/../../make/build_template.xml"/>
     <property name="core.jar" location="../JemmyCore/build/JemmyCore.jar"/>
     <property name="version.file" value="org/jemmy/input/jemmy.properties"/>
-    <property name="version.class" value="org.jemmy.input.Version"/>
+    <property name="version.class" value="org.jemmy.input.awt.Version"/>
     <property name="dependencies.classpath" value="${core.jar}"/>
     <target name="check-dependecies-impl">
         <available file="${core.jar}" property="dependencies.are.built"/>
--- a/core/JemmyAWTInput/pom.xml	Tue Jan 08 15:44:49 2019 -0800
+++ b/core/JemmyAWTInput/pom.xml	Mon Jun 03 11:12:19 2019 -0700
@@ -28,20 +28,20 @@
     <parent>
         <groupId>org.adoptopenjdk</groupId>
         <artifactId>jemmy</artifactId>
-        <version>1.0.2</version>
+        <version>2.0.0</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <artifactId>jemmy-awt-input</artifactId>
     <packaging>jar</packaging>
     <properties>
         <version.file>org/jemmy/input/jemmy.properties</version.file>
-        <version.class>org.jemmy.input.Version</version.class>
+        <version.class>org.jemmy.input.awt.Version</version.class>
     </properties>
     <dependencies>
         <dependency>
             <groupId>org.adoptopenjdk</groupId>
             <artifactId>jemmy-core</artifactId>
-            <version>1.0.2</version>
+            <version>${project.version}</version>
         </dependency>
     </dependencies>
     <build>
--- a/core/JemmyAWTInput/src/org/jemmy/image/AWTImage.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,210 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-import org.jemmy.Dimension;
-import org.jemmy.JemmyException;
-import org.jemmy.control.Wrap;
-import org.jemmy.env.Environment;
-import org.jemmy.image.pixel.*;
-
-
-/**
- * @author shura
- */
-public class AWTImage implements Image, WriteableRaster {
-
-    public static final String OUTPUT = AWTImage.class.getName() + ".OUTPUT";
-    public static final String PNG_FILE = ".png";
-
-    /**
-     * Get the value of imageRoot. The field is used to store images by relative
-     * path within the root. Images should be pointed out by full file names if
-     * the value is null.
-     *
-     * @return the value of imageRoot
-     */
-    public static File getImageRoot() {
-        ImageStore res = Environment.getEnvironment().getProperty(ImageStore.class);
-        if(!(res instanceof PNGFileImageStore)) {
-            throw new IllegalStateException("Unsupported ImageStore: " + res.getClass().getName());
-        }
-        return ((PNGFileImageStore)res).getRoot();
-    }
-
-    /**
-     * Set the value of imageRoot. If null, an image ID should be full path.
-     *
-     * @param imageRoot new value of imageRoot
-     */
-    public static void setImageRoot(File imageRoot) {
-        Environment.getEnvironment().setProperty(ImageStore.class, new PNGFileImageStore(imageRoot));
-    }
-
-    /**
-     * Gets comparator to be used by default.
-     *
-     * @see Wrap#waitImage(org.jemmy.image.Image, java.lang.String,
-     * java.lang.String)
-     * @see ImageComparator
-     * @return default comparator
-     */
-    public static ImageComparator getComparator() {
-        return Environment.getEnvironment().getProperty(ImageComparator.class);
-    }
-
-    /**
-     * Sets comparator to be used by default.
-     *
-     * @see Wrap#waitImage(org.jemmy.image.Image, java.lang.String,
-     * java.lang.String)
-     * @see ImageComparator
-     * @param comparator todo document
-     */
-    public static void setComparator(ImageComparator comparator) {
-        Environment.getEnvironment().setProperty(ImageComparator.class, comparator);
-    }
-
-    static {
-        Environment.getEnvironment().setPropertyIfNotSet(ImageComparator.class,
-                new BufferedImageComparator(Environment.getEnvironment()));
-        Environment.getEnvironment().setPropertyIfNotSet(ImageStore.class, new PNGFileImageStore());
-    }
-
-    private BufferedImage image;
-
-    public AWTImage(BufferedImage img) {
-        this.image = img;
-    }
-
-    public BufferedImage getTheImage() {
-        return image;
-    }
-
-    /**
-     * Compares using current comparator.
-     *
-     * @see AWTImage#getComparator()
-     * @param img todo document
-     * @return diff image.
-     */
-    public Image compareTo(Image img) {
-        return getComparator().compare(this, img);
-    }
-
-    /**
-     * Saves to a filesystem. fileName is expected to be a full path, unless
-     * imageRoot is specified. ".png" extension is added automatically if not
-     * specified.
-     *
-     * @see AWTImage#getImageRoot()
-     * @param fileName full or relative file name
-     */
-    public void save(String fileName) {
-        try {
-            String fullPath = fileName;
-            File imageRoot = getImageRoot();
-            if (imageRoot != null) {
-                fullPath = imageRoot.getAbsolutePath() + File.separator + fileName;
-            }
-            if (!fullPath.toLowerCase().endsWith(PNG_FILE)) {
-                fullPath += PNG_FILE;
-            }
-            new PNGImageSaver().save(image, fullPath);
-            Environment.getEnvironment().getOutput(OUTPUT).println("Image saved to " + fullPath);
-        } catch (IOException ex) {
-            throw new JemmyException("Unable to save image", ex, fileName);
-        }
-    }
-
-    public Dimension getSize() {
-        return new Dimension(image.getWidth(), image.getHeight());
-    }
-
-    public void getColors(int x, int y, double[] colors) {
-        int orig = image.getRGB(x, y);
-        int ivalue;
-        for (Raster.Component c : getSupported()) {
-            switch (c) {
-                case ALPHA:
-                    ivalue = (orig & 0xFF000000) >>> 0x18;
-                    break;
-                case RED:
-                    ivalue = (orig & 0xFF0000) >>> 0x10;
-                    break;
-                case GREEN:
-                    ivalue = (orig & 0xFF00) >>> 0x8;
-                    break;
-                case BLUE:
-                    ivalue = (orig & 0xFF);
-                    break;
-                default:
-                    throw new IllegalArgumentException("Unknown color component" + c);
-            }
-            colors[PixelImageComparator.arrayIndexOf(getSupported(), c)] = (double) ivalue / 0xFF;
-        }
-    }
-
-    public void setColors(int x, int y, double[] colors) {
-        int rgb = 0;
-        double value;
-        int ivalue;
-        for (Raster.Component c : getSupported()) {
-            value = colors[PixelImageComparator.arrayIndexOf(getSupported(), c)];
-            if (value < 0 || value > 1) {
-                throw new IllegalArgumentException("Color component value should be within (0, 1). Gotten: " + value);
-            }
-            ivalue = (int) Math.round(value * 0xFF);
-            if (ivalue > 0xFF) {
-                throw new IllegalStateException("Component value is greater than 0xFF: " + ivalue);
-            }
-            switch (c) {
-                case ALPHA:
-                    rgb |= (ivalue << 0x18);
-                    break;
-                case RED:
-                    rgb |= (ivalue << 0x10);
-                    break;
-                case GREEN:
-                    rgb |= (ivalue << 0x8);
-                    break;
-                case BLUE:
-                    rgb |= ivalue;
-                    break;
-                default:
-                    throw new IllegalArgumentException("Unknown color component: " + c);
-            }
-        }
-        getTheImage().setRGB(x, y, rgb);
-    }
-
-    public Component[] getSupported() {
-        return new Component[]{Component.RED, Component.BLUE, Component.GREEN, Component.ALPHA};
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/AWTRobotCapturer.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-
-import org.jemmy.Rectangle;
-import org.jemmy.control.Wrap;
-import org.jemmy.input.RobotDriver;
-
-
-/**
- * Uses java.awt.Robot to capture the images
- * @author mrkam, shura
- */
-public class AWTRobotCapturer implements ImageCapturer {
-    static {
-        try {
-            Class.forName(AWTImage.class.getName());
-        } catch (ClassNotFoundException ex) {
-        }
-    }
-
-    public Image capture(Wrap<?> control, Rectangle area) {
-        Rectangle rect = new Rectangle();
-        Rectangle bounds = control.getScreenBounds();
-        rect.x = bounds.x + area.x;
-        rect.y = bounds.y + area.y;
-        rect.width = area.width;
-        rect.height = area.height;
-        return RobotDriver.createScreenCapture(rect);
-    }
-
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/AbstractImageComparator.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package org.jemmy.image;
-
-
-import java.awt.image.BufferedImage;
-
-
-/**
- * Common part of most ImageComparators.
- *
- * @author KAM
- * @deprecated Use classes from org.jemmy.image.pixel package instead.
- */
-@Deprecated
-public abstract class AbstractImageComparator implements ImageComparator {
-
-    /**
-     * Checks whether images have difference.
-     * @param image1 First image to compare.
-     * @param image2 Second image to compare.
-     * @return true if images have no difference, false otherwise.
-     */
-    public abstract boolean noDifference(BufferedImage image1, BufferedImage image2);
-
-    /**
-     * {@inheritDoc}
-     */
-    public BufferedImage compare(BufferedImage image1, BufferedImage image2) {
-        if (noDifference(image1, image2)) {
-            return null;
-        } else {
-            return ImageTool.subtractImage(image1, image2);
-        }
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/AverageDistanceImageComparator.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package org.jemmy.image;
-
-
-import java.awt.image.BufferedImage;
-import org.jemmy.image.pixel.AverageDistanceComparator;
-
-
-/**
- * Compares two images calculating average color distance between pixels and
- * comparing it to the threshold value. See {@linkplain NaturalImageComparator
- * NaturalImageComparator} for color comparison details.
- *
- * @author KAM
- */
-public class AverageDistanceImageComparator extends BufferedImageComparator {
-
-    /**
-     * Creates comparator with the default sensitivity value = 0.02
-     * (around 5 in 0-255 color component value).
-     * @see #AverageDistanceImageComparator(double)
-     */
-    public AverageDistanceImageComparator() {
-        this(0.02);
-    }
-
-    /**
-     * Creates comparator with the specified sensitivity value
-     * @param sensitivity Maximum threshold for average 3-D distance between
-     * colors in 3-D sRGB color space for images to be considered equal.
-     * Meaningful values lay between 0 and approx 1.733. 0 means colors should
-     * be equal to pass the comparison, 1.733 (which is more than square root
-     * of 3) means that comparison will be passed even if all the colors are
-     * completely different.
-     */
-    public AverageDistanceImageComparator(double sensitivity) {
-        super(new AverageDistanceComparator(sensitivity));
-    }
-
-    public void setSensitivity(double sensitivity) {
-        ((AverageDistanceComparator)getRasterComparator()).setThreshold(sensitivity);
-    }
-    public double getSensitivity() {
-        return ((AverageDistanceComparator)getRasterComparator()).getThreshold();
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/BufferedImageComparator.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import java.awt.image.BufferedImage;
-import org.jemmy.env.Environment;
-import org.jemmy.image.pixel.PixelImageComparator;
-import org.jemmy.image.pixel.Raster;
-import org.jemmy.image.pixel.RasterComparator;
-import org.jemmy.image.pixel.WriteableRaster;
-
-/**
- *
- * @author shura
- */
-public class BufferedImageComparator extends PixelImageComparator {
-
-    public BufferedImageComparator(RasterComparator comparator) {
-        super(comparator);
-    }
-
-    public BufferedImageComparator(Environment env) {
-        super(env);
-    }
-
-    @Override
-    protected Image toImage(Raster image) {
-        if(image instanceof AWTImage) {
-            return (AWTImage)image;
-        } else {
-            throw new IllegalArgumentException("Unrecognized image type" + image.getClass().getName());
-        }
-    }
-
-    @Override
-    protected Raster toRaster(Image image) {
-        if(image instanceof AWTImage) {
-            return (AWTImage)image;
-        } else {
-            throw new IllegalArgumentException("Unrecognized image type" + image.getClass().getName());
-        }
-    }
-
-    @Override
-    protected WriteableRaster createDiffRaster(Raster r1, Raster r2) {
-        AWTImage img2 = (AWTImage) r2;
-        AWTImage img1 = (AWTImage) r1;
-        return new AWTImage(new BufferedImage(
-                Math.max(img1.getSize().width, img2.getSize().width),
-                Math.max(img1.getSize().height, img2.getSize().height),
-                img1.getTheImage().getType()));
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/ClasspathImageLoader.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-
-import org.jemmy.env.Environment;
-
-
-/**
- * ImageLoader implementation which is able to load images through
- * a given classloader.
- * @author mrkam
- * @author shura
- */
-public class ClasspathImageLoader implements ImageLoader {
-
-    private String packagePrefix = "";
-    private ClassLoader classLoader = getClassLoader();
-
-    public static final String OUTPUT = AWTImage.class.getName() + ".OUTPUT";
-
-    /**
-     * Get the value of classLoader which is used to load images.
-     *
-     * @return the value of classLoader
-     */
-    public ClassLoader getClassLoader() {
-        return classLoader;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public Image load(String ID) {
-        String fullId = ((packagePrefix != null) ? packagePrefix : "") + ID;
-        Environment.getEnvironment().getOutput(ClasspathImageLoader.OUTPUT).println("Image loaded from " + fullId + " by " + classLoader);
-        return new AWTImage(PNGDecoder.decode(classLoader, fullId));
-    }
-
-    /**
-     * Set the value of classLoader
-     *
-     * @param classLoader new value of classLoader
-     */
-    public void setClassLoader(ClassLoader classLoader) {
-        this.classLoader = classLoader;
-    }
-
-    public void setRootPackage(Package rootPackage) {
-        if (rootPackage != null) {
-            this.packagePrefix = rootPackage.getName().replace('.', '/') + "/";
-        } else {
-            this.packagePrefix = null;
-        }
-    }
-
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/ColorImageComparator.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import java.awt.image.BufferedImage;
-import org.jemmy.image.pixel.PixelEqualityRasterComparator;
-
-/**
- * Compares two images with color mapping defined by
- * <code>ColorModel</code> implementation.
- *
- * @author Alexandre Iline (alexandre.iline@sun.com)
- * @deprecated Use classes form org.jemmy.image.pixel instead.
- */
-@Deprecated
-public class ColorImageComparator implements ImageComparator {
-
-    ColorMap leftMap, rightMap;
-    ImageComparator comparator = null;
-
-    /**
-     * Creates a comparator with a color maps. Object created by this
-     * constructor behaves like
-     * <code>StrictImageComparator</code>. Object created works faster because
-     * it does not create intermediate images for another comparator.
-     *
-     * @param map Map applied to both left and right images during comparision.
-     */
-    public ColorImageComparator(ColorMap map) {
-        this(map, new StrictImageComparator());
-    }
-
-    /**
-     * Creates a comparator with
-     * <code>map</code> color mapping. Actual comparision perfomed by
-     * <code>comparator</code> parameter.
-     *
-     * @param map Map applied to both left and right images during comparision.
-     * @param subComparator comporator to perform a comparision of to images
-     * with mapped colors.
-     */
-    public ColorImageComparator(ColorMap map, ImageComparator subComparator) {
-        this(map, map, subComparator);
-    }
-
-    /**
-     * Creates a comparator with two color maps. Object created by this
-     * constructor behaves like
-     * <code>StrictImageComparator</code>. Object created works faster because
-     * it does not create intermediate images for another comparator.
-     *
-     * @param leftMap Map applied to the left image during comparision.
-     * @param rightMap Map applied to the right image during comparision.
-     */
-    public ColorImageComparator(ColorMap leftMap, ColorMap rightMap) {
-        this(leftMap, rightMap, new BufferedImageComparator(new PixelEqualityRasterComparator(0)));
-    }
-
-    /**
-     * Creates a comparator with two color maps. Actual comparision perfomed by
-     * <code>comparator</code> parameter.
-     *
-     * @param leftMap Map applied to the left image during comparision.
-     * @param rightMap Map applied to the right image during comparision.
-     * @param subComparator comporator to perform a comparision of to images
-     * with mapped colors.
-     */
-    public ColorImageComparator(ColorMap leftMap, ColorMap rightMap, ImageComparator subComparator) {
-        this.leftMap = leftMap;
-        this.rightMap = rightMap;
-        this.comparator = subComparator;
-    }
-
-    /**
-     * Compares images by
-     * <code>ImageComparator</code> passed into constructor, or itself if no
-     * <code>ImageComparator</code> was passed, processing both images by
-     * <code>ColorMap</code> instance before comparision.
-     */
-    @Override
-    public Image compare(Image image1, Image image2) {
-        return (comparator.compare(
-                recolor((AWTImage)image1, leftMap),
-                recolor((AWTImage)image2, rightMap)));
-    }
-
-    private AWTImage recolor(AWTImage isrc, ColorMap map) {
-        BufferedImage src = isrc.getTheImage();
-        BufferedImage result = new BufferedImage(src.getWidth(), src.getHeight(), src.getType());
-        for (int x = 0; x < src.getWidth(); x++) {
-            for (int y = 0; y < src.getWidth(); y++) {
-                result.setRGB(x, y, map.mapColor(src.getRGB(x, y)));
-            }
-        }
-        return new AWTImage(result);
-    }
-
-    protected final boolean compareColors(int rgb1, int rgb2) {
-        return (leftMap.mapColor(rgb1) == rightMap.mapColor(rgb2));
-    }
-
-    public String getID() {
-        return ColorImageComparator.class.getName();
-    }
-
-    /**
-     * Interface to map colors during the comparision.
-     */
-    public static interface ColorMap {
-
-        /**
-         * Maps one color into another.
-         *
-         * @param rgb an original color.
-         * @return a converted color.
-         */
-        public int mapColor(int rgb);
-    }
-
-    /**
-     * Turns
-     * <code>foreground</code> color to white, other - to black.
-     */
-    public static class ForegroundColorMap implements ColorMap {
-
-        int foreground;
-
-        /**
-         * Constructs a ColorImageComparator$ForegroundColorMap object.
-         *
-         * @param foreground Foreground color.
-         */
-        public ForegroundColorMap(int foreground) {
-            this.foreground = foreground;
-        }
-
-        public int mapColor(int rgb) {
-            return ((rgb == foreground) ? 0xffffff : 0);
-        }
-    }
-
-    /**
-     * Turns
-     * <code>background</code> color to black, left others unchanged.
-     */
-    public static class BackgroundColorMap implements ColorMap {
-
-        int background;
-
-        /**
-         * Constructs a ColorImageComparator$BackgroundColorMap object.
-         *
-         * @param background Background color.
-         */
-        public BackgroundColorMap(int background) {
-            this.background = background;
-        }
-
-        public int mapColor(int rgb) {
-            return ((rgb == background) ? 0 : rgb);
-        }
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/DiffDialog.form	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,259 +0,0 @@
-<!--
-Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
- -->
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
-  <SyntheticProperties>
-    <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
-  </SyntheticProperties>
-  <AuxValues>
-    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
-    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
-    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
-    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
-    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
-  </AuxValues>
-
-  <Layout>
-    <DimensionLayout dim="0">
-      <Group type="103" groupAlignment="0" attributes="0">
-          <Component id="tbSplit" alignment="0" pref="549" max="32767" attributes="0"/>
-      </Group>
-    </DimensionLayout>
-    <DimensionLayout dim="1">
-      <Group type="103" groupAlignment="0" attributes="0">
-          <Component id="tbSplit" alignment="0" pref="461" max="32767" attributes="0"/>
-      </Group>
-    </DimensionLayout>
-  </Layout>
-  <SubComponents>
-    <Container class="javax.swing.JSplitPane" name="tbSplit">
-      <Properties>
-        <Property name="dividerLocation" type="int" value="200"/>
-        <Property name="orientation" type="int" value="0"/>
-      </Properties>
-
-      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
-      <SubComponents>
-        <Container class="javax.swing.JSplitPane" name="lrSplit">
-          <Properties>
-            <Property name="dividerLocation" type="int" value="250"/>
-          </Properties>
-          <Constraints>
-            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
-              <JSplitPaneConstraints position="top"/>
-            </Constraint>
-          </Constraints>
-
-          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
-          <SubComponents>
-            <Container class="javax.swing.JPanel" name="leftPane">
-              <Constraints>
-                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
-                  <JSplitPaneConstraints position="left"/>
-                </Constraint>
-              </Constraints>
-
-              <Layout>
-                <DimensionLayout dim="0">
-                  <Group type="103" groupAlignment="0" attributes="0">
-                      <EmptySpace min="0" pref="250" max="32767" attributes="0"/>
-                  </Group>
-                </DimensionLayout>
-                <DimensionLayout dim="1">
-                  <Group type="103" groupAlignment="0" attributes="0">
-                      <EmptySpace min="0" pref="200" max="32767" attributes="0"/>
-                  </Group>
-                </DimensionLayout>
-              </Layout>
-            </Container>
-            <Container class="javax.swing.JPanel" name="rightPane">
-              <Constraints>
-                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
-                  <JSplitPaneConstraints position="right"/>
-                </Constraint>
-              </Constraints>
-
-              <Layout>
-                <DimensionLayout dim="0">
-                  <Group type="103" groupAlignment="0" attributes="0">
-                      <EmptySpace min="0" pref="293" max="32767" attributes="0"/>
-                  </Group>
-                </DimensionLayout>
-                <DimensionLayout dim="1">
-                  <Group type="103" groupAlignment="0" attributes="0">
-                      <EmptySpace min="0" pref="200" max="32767" attributes="0"/>
-                  </Group>
-                </DimensionLayout>
-              </Layout>
-            </Container>
-          </SubComponents>
-        </Container>
-        <Container class="javax.swing.JSplitPane" name="dcSplit">
-          <Constraints>
-            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
-              <JSplitPaneConstraints position="right"/>
-            </Constraint>
-          </Constraints>
-
-          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
-          <SubComponents>
-            <Container class="javax.swing.JPanel" name="diffPane">
-              <Constraints>
-                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
-                  <JSplitPaneConstraints position="left"/>
-                </Constraint>
-              </Constraints>
-
-              <Layout>
-                <DimensionLayout dim="0">
-                  <Group type="103" groupAlignment="0" attributes="0">
-                      <EmptySpace min="0" pref="100" max="32767" attributes="0"/>
-                  </Group>
-                </DimensionLayout>
-                <DimensionLayout dim="1">
-                  <Group type="103" groupAlignment="0" attributes="0">
-                      <EmptySpace min="0" pref="255" max="32767" attributes="0"/>
-                  </Group>
-                </DimensionLayout>
-              </Layout>
-            </Container>
-            <Container class="javax.swing.JPanel" name="controlPane">
-              <Constraints>
-                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
-                  <JSplitPaneConstraints position="right"/>
-                </Constraint>
-              </Constraints>
-
-              <Layout>
-                <DimensionLayout dim="0">
-                  <Group type="103" groupAlignment="0" attributes="0">
-                      <Group type="102" attributes="0">
-                          <EmptySpace pref="289" max="32767" attributes="0"/>
-                          <Group type="103" groupAlignment="0" attributes="0">
-                              <Group type="102" alignment="1" attributes="0">
-                                  <Component id="jButton6" min="-2" max="-2" attributes="0"/>
-                                  <EmptySpace max="-2" attributes="0"/>
-                                  <Component id="jButton7" min="-2" max="-2" attributes="0"/>
-                              </Group>
-                              <Group type="102" alignment="1" attributes="0">
-                                  <Component id="jButton1" min="-2" max="-2" attributes="0"/>
-                                  <EmptySpace max="-2" attributes="0"/>
-                                  <Component id="jButton2" min="-2" max="-2" attributes="0"/>
-                              </Group>
-                              <Component id="copyBtn" alignment="1" min="-2" max="-2" attributes="0"/>
-                              <Component id="removeBtn" alignment="1" min="-2" max="-2" attributes="0"/>
-                          </Group>
-                          <EmptySpace max="-2" attributes="0"/>
-                      </Group>
-                  </Group>
-                </DimensionLayout>
-                <DimensionLayout dim="1">
-                  <Group type="103" groupAlignment="0" attributes="0">
-                      <Group type="102" alignment="0" attributes="0">
-                          <EmptySpace max="-2" attributes="0"/>
-                          <Group type="103" groupAlignment="3" attributes="0">
-                              <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
-                              <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
-                          </Group>
-                          <EmptySpace max="-2" attributes="0"/>
-                          <Component id="copyBtn" min="-2" max="-2" attributes="0"/>
-                          <EmptySpace max="-2" attributes="0"/>
-                          <Component id="removeBtn" min="-2" max="-2" attributes="0"/>
-                          <EmptySpace pref="107" max="32767" attributes="0"/>
-                          <Group type="103" groupAlignment="3" attributes="0">
-                              <Component id="jButton7" alignment="3" min="-2" max="-2" attributes="0"/>
-                              <Component id="jButton6" alignment="3" min="-2" max="-2" attributes="0"/>
-                          </Group>
-                          <EmptySpace max="-2" attributes="0"/>
-                      </Group>
-                  </Group>
-                </DimensionLayout>
-              </Layout>
-              <SubComponents>
-                <Component class="javax.swing.JButton" name="jButton1">
-                  <Properties>
-                    <Property name="mnemonic" type="int" value="43"/>
-                    <Property name="text" type="java.lang.String" value="+"/>
-                  </Properties>
-                  <Events>
-                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
-                  </Events>
-                </Component>
-                <Component class="javax.swing.JButton" name="jButton2">
-                  <Properties>
-                    <Property name="mnemonic" type="int" value="45"/>
-                    <Property name="text" type="java.lang.String" value="-"/>
-                  </Properties>
-                  <Events>
-                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
-                  </Events>
-                </Component>
-                <Component class="javax.swing.JButton" name="copyBtn">
-                  <Properties>
-                    <Property name="text" type="java.lang.String" value="Copy to golgen"/>
-                    <Property name="enabled" type="boolean" value="false"/>
-                  </Properties>
-                  <Events>
-                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="copyBtnActionPerformed"/>
-                  </Events>
-                </Component>
-                <Component class="javax.swing.JButton" name="removeBtn">
-                  <Properties>
-                    <Property name="text" type="java.lang.String" value="Remove from golden"/>
-                    <Property name="enabled" type="boolean" value="false"/>
-                  </Properties>
-                  <Events>
-                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeBtnActionPerformed"/>
-                  </Events>
-                </Component>
-                <Component class="javax.swing.JButton" name="jButton6">
-                  <Properties>
-                    <Property name="text" type="java.lang.String" value="Next"/>
-                  </Properties>
-                  <Events>
-                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton6ActionPerformed"/>
-                  </Events>
-                </Component>
-                <Component class="javax.swing.JButton" name="jButton7">
-                  <Properties>
-                    <Property name="text" type="java.lang.String" value="Exit"/>
-                  </Properties>
-                  <Events>
-                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton7ActionPerformed"/>
-                  </Events>
-                </Component>
-              </SubComponents>
-            </Container>
-          </SubComponents>
-        </Container>
-      </SubComponents>
-    </Container>
-  </SubComponents>
-</Form>
--- a/core/JemmyAWTInput/src/org/jemmy/image/DiffDialog.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,395 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Toolkit;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.image.BufferedImage;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-/**
- *
- * @author shura
- */
-public class DiffDialog extends javax.swing.JDialog {
-
-    private final static StrictImageComparator comparator = new StrictImageComparator();
-    private double scale = 1.0;
-    private int imageWidth, imageHeight, scaledWidth, scaledHeight;
-    private ImagePane left = null, right = null, diff = null;
-    int status = 0;
-
-    /** Creates new form ImageDiff */
-    DiffDialog() {
-        super((JDialog)null, true);
-        initComponents();
-        leftPane.setLayout(new BorderLayout());
-        leftPane.add(new JLabel("Golden"), BorderLayout.NORTH);
-        rightPane.setLayout(new BorderLayout());
-        rightPane.add(new JLabel("Result"), BorderLayout.NORTH);
-        diffPane.setLayout(new BorderLayout());
-        diffPane.add(new JLabel("Diff"), BorderLayout.NORTH);
-        getContentPane().addComponentListener(new ComponentListener() {
-
-            public void componentResized(ComponentEvent e) {
-                lrSplit.setDividerLocation(.5);
-                dcSplit.setDividerLocation(.5);
-                tbSplit.setDividerLocation(.5);
-            }
-
-            public void componentMoved(ComponentEvent e) {
-                throw new UnsupportedOperationException("Not supported yet.");
-            }
-
-            public void componentShown(ComponentEvent e) {
-                throw new UnsupportedOperationException("Not supported yet.");
-            }
-
-            public void componentHidden(ComponentEvent e) {
-                throw new UnsupportedOperationException("Not supported yet.");
-            }
-        });
-        setSize(400, 300);
-
-        // Get the size of the screen
-        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
-
-        // Determine the new location of the window
-        int w = getSize().width;
-        int h = getSize().height;
-        int x = (dim.width - w) / 2;
-        int y = (dim.height - h) / 2;
-
-        // Move the window
-        setLocation(x, y);
-    }
-
-    void setImages(BufferedImage leftImage, BufferedImage rightImage) {
-        if (leftImage != null && rightImage != null) {
-            copyBtn.setEnabled(true);
-            removeBtn.setEnabled(false);
-            imageWidth = leftImage.getWidth();
-            imageHeight = leftImage.getHeight();
-        } else {
-            if (leftImage == null) {
-                copyBtn.setEnabled(true);
-                removeBtn.setEnabled(false);
-                imageWidth = rightImage.getWidth();
-                imageHeight = rightImage.getHeight();
-            } else if (rightImage == null) {
-                copyBtn.setEnabled(false);
-                removeBtn.setEnabled(true);
-                imageWidth = leftImage.getWidth();
-                imageHeight = leftImage.getHeight();
-            }
-        }
-        if (left == null) {
-            left = new ImagePane(leftImage);
-        } else {
-            left.setImage(leftImage);
-        }
-        leftPane.add(left, BorderLayout.CENTER);
-        if (right == null) {
-            right = new ImagePane(rightImage);
-        } else {
-            right.setImage(rightImage);
-        }
-        rightPane.add(right, BorderLayout.CENTER);
-        if (diff == null) {
-            diff = new ImagePane(subtract(leftImage, rightImage));
-        } else {
-            diff.setImage(subtract(leftImage, rightImage));
-        }
-        diffPane.add(diff, BorderLayout.CENTER);
-        rescaleAll();
-    }
-
-    private BufferedImage subtract(BufferedImage left, BufferedImage right) {
-        if(left != null && right != null) {
-            return ImageTool.subtractImage(left, right);
-        } else {
-            return null;
-        }
-    }
-
-    /** This method is called from within the constructor to
-     * initialize the form.
-     * WARNING: Do NOT modify this code. The content of this method is
-     * always regenerated by the Form Editor.
-     */
-    @SuppressWarnings("unchecked")
-    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
-    private void initComponents() {
-
-        tbSplit = new javax.swing.JSplitPane();
-        lrSplit = new javax.swing.JSplitPane();
-        leftPane = new javax.swing.JPanel();
-        rightPane = new javax.swing.JPanel();
-        dcSplit = new javax.swing.JSplitPane();
-        diffPane = new javax.swing.JPanel();
-        controlPane = new javax.swing.JPanel();
-        jButton1 = new javax.swing.JButton();
-        jButton2 = new javax.swing.JButton();
-        copyBtn = new javax.swing.JButton();
-        removeBtn = new javax.swing.JButton();
-        jButton6 = new javax.swing.JButton();
-        jButton7 = new javax.swing.JButton();
-
-        tbSplit.setDividerLocation(200);
-        tbSplit.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
-
-        lrSplit.setDividerLocation(250);
-
-        javax.swing.GroupLayout leftPaneLayout = new javax.swing.GroupLayout(leftPane);
-        leftPane.setLayout(leftPaneLayout);
-        leftPaneLayout.setHorizontalGroup(
-            leftPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 250, Short.MAX_VALUE)
-        );
-        leftPaneLayout.setVerticalGroup(
-            leftPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 200, Short.MAX_VALUE)
-        );
-
-        lrSplit.setLeftComponent(leftPane);
-
-        javax.swing.GroupLayout rightPaneLayout = new javax.swing.GroupLayout(rightPane);
-        rightPane.setLayout(rightPaneLayout);
-        rightPaneLayout.setHorizontalGroup(
-            rightPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 293, Short.MAX_VALUE)
-        );
-        rightPaneLayout.setVerticalGroup(
-            rightPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 200, Short.MAX_VALUE)
-        );
-
-        lrSplit.setRightComponent(rightPane);
-
-        tbSplit.setTopComponent(lrSplit);
-
-        javax.swing.GroupLayout diffPaneLayout = new javax.swing.GroupLayout(diffPane);
-        diffPane.setLayout(diffPaneLayout);
-        diffPaneLayout.setHorizontalGroup(
-            diffPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 100, Short.MAX_VALUE)
-        );
-        diffPaneLayout.setVerticalGroup(
-            diffPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 255, Short.MAX_VALUE)
-        );
-
-        dcSplit.setLeftComponent(diffPane);
-
-        jButton1.setMnemonic('+');
-        jButton1.setText("+");
-        jButton1.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                jButton1ActionPerformed(evt);
-            }
-        });
-
-        jButton2.setMnemonic('-');
-        jButton2.setText("-");
-        jButton2.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                jButton2ActionPerformed(evt);
-            }
-        });
-
-        copyBtn.setText("Copy to golgen");
-        copyBtn.setEnabled(false);
-        copyBtn.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                copyBtnActionPerformed(evt);
-            }
-        });
-
-        removeBtn.setText("Remove from golden");
-        removeBtn.setEnabled(false);
-        removeBtn.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                removeBtnActionPerformed(evt);
-            }
-        });
-
-        jButton6.setText("Next");
-        jButton6.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                jButton6ActionPerformed(evt);
-            }
-        });
-
-        jButton7.setText("Exit");
-        jButton7.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                jButton7ActionPerformed(evt);
-            }
-        });
-
-        javax.swing.GroupLayout controlPaneLayout = new javax.swing.GroupLayout(controlPane);
-        controlPane.setLayout(controlPaneLayout);
-        controlPaneLayout.setHorizontalGroup(
-            controlPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(controlPaneLayout.createSequentialGroup()
-                .addContainerGap(289, Short.MAX_VALUE)
-                .addGroup(controlPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, controlPaneLayout.createSequentialGroup()
-                        .addComponent(jButton6)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(jButton7))
-                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, controlPaneLayout.createSequentialGroup()
-                        .addComponent(jButton1)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(jButton2))
-                    .addComponent(copyBtn, javax.swing.GroupLayout.Alignment.TRAILING)
-                    .addComponent(removeBtn, javax.swing.GroupLayout.Alignment.TRAILING))
-                .addContainerGap())
-        );
-        controlPaneLayout.setVerticalGroup(
-            controlPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(controlPaneLayout.createSequentialGroup()
-                .addContainerGap()
-                .addGroup(controlPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                    .addComponent(jButton1)
-                    .addComponent(jButton2))
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(copyBtn)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(removeBtn)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 107, Short.MAX_VALUE)
-                .addGroup(controlPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                    .addComponent(jButton7)
-                    .addComponent(jButton6))
-                .addContainerGap())
-        );
-
-        dcSplit.setRightComponent(controlPane);
-
-        tbSplit.setRightComponent(dcSplit);
-
-        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
-        getContentPane().setLayout(layout);
-        layout.setHorizontalGroup(
-            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(tbSplit, javax.swing.GroupLayout.DEFAULT_SIZE, 549, Short.MAX_VALUE)
-        );
-        layout.setVerticalGroup(
-            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(tbSplit, javax.swing.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)
-        );
-
-        pack();
-    }// </editor-fold>//GEN-END:initComponents
-
-    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
-        scale *= .9;
-        rescaleAll();
-    }//GEN-LAST:event_jButton2ActionPerformed
-
-    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
-        scale *= 1.1;
-        rescaleAll();
-    }//GEN-LAST:event_jButton1ActionPerformed
-
-    private void rescaleAll() {
-        scaledWidth = (int) (imageWidth * scale);
-        scaledHeight = (int) (imageHeight * scale);
-        left.reScale();
-        right.reScale();
-        diff.reScale();
-        getContentPane().repaint();
-    }
-
-    private void copyBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copyBtnActionPerformed
-        status = -1;
-        setVisible(false);
-    }//GEN-LAST:event_copyBtnActionPerformed
-
-    private void removeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeBtnActionPerformed
-        status = 1;
-        setVisible(false);
-    }//GEN-LAST:event_removeBtnActionPerformed
-
-    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
-        setVisible(false);
-    }//GEN-LAST:event_jButton6ActionPerformed
-
-    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
-        status = -2;
-        setVisible(false);
-    }//GEN-LAST:event_jButton7ActionPerformed
-
-    private class ImagePane extends JPanel {
-
-        BufferedImage img;
-        java.awt.Image scaled;
-
-        public ImagePane(BufferedImage img) {
-            this.img = img;
-        }
-
-        @Override
-        protected void paintComponent(Graphics g) {
-            if (img != null) {
-                g.drawImage(scaled, 0, 0, this);
-            } else {
-                super.paintComponent(g);
-            }
-        }
-
-        void setImage(BufferedImage img) {
-            this.img = img;
-            reScale();
-        }
-
-        void reScale() {
-            if (img != null) {
-                    scaled = img.getScaledInstance(scaledWidth, scaledHeight, java.awt.Image.SCALE_DEFAULT);
-            }
-        }
-    }
-    // Variables declaration - do not modify//GEN-BEGIN:variables
-    private javax.swing.JPanel controlPane;
-    private javax.swing.JButton copyBtn;
-    private javax.swing.JSplitPane dcSplit;
-    private javax.swing.JPanel diffPane;
-    private javax.swing.JButton jButton1;
-    private javax.swing.JButton jButton2;
-    private javax.swing.JButton jButton6;
-    private javax.swing.JButton jButton7;
-    private javax.swing.JPanel leftPane;
-    private javax.swing.JSplitPane lrSplit;
-    private javax.swing.JButton removeBtn;
-    private javax.swing.JPanel rightPane;
-    private javax.swing.JSplitPane tbSplit;
-    // End of variables declaration//GEN-END:variables
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/FilesystemImageLoader.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-
-import java.io.File;
-import org.jemmy.env.Environment;
-
-
-/**
- * This is an implementation of ImageLoader which loads images from filesystem.
- * @author mrkam
- */
-public class FilesystemImageLoader implements ImageLoader {
-
-    private File imageRoot = null;
-
-    public static final String OUTPUT = AWTImage.class.getName() + ".OUTPUT";
-
-    public File getImageRoot() {
-        return imageRoot;
-    }
-
-    public Image load(String ID) {
-        String fullPath = ID + (ID.toLowerCase().endsWith(AWTImage.PNG_FILE) ? "" :
-                AWTImage.PNG_FILE);
-        if (imageRoot != null) {
-            fullPath = imageRoot.getAbsolutePath() + File.separator + ID;
-        }
-        Environment.getEnvironment().getOutput(FilesystemImageLoader.OUTPUT).println("Image loaded from " + fullPath);
-        return new AWTImage(PNGDecoder.decode(fullPath));
-    }
-
-    public void setImageRoot(File imageRoot) {
-        this.imageRoot = imageRoot;
-    }
-
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/ImageFinder.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import org.jemmy.Point;
-
-import java.awt.image.BufferedImage;
-
-/**
- * Interface for all classes performing image lookup.
- *
- * @author Alexandre Iline (alexandre.iline@sun.com)
- */
-public interface ImageFinder {
-
-    /**
-     * Should return location if image lays inside an image represented by this object.
-     * @param image an image to search.
-     * @param index an ordinal image location index. If equal to 1, for example,
-     * second appropriate location will be found.
-     * @return Image location coordinates if image was found, null otherwise.
-     */
-    public Point findImage(BufferedImage image, int index);
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/ImageTool.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-
-import java.awt.Color;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import javax.imageio.ImageIO;
-
-
-/**
- * Contains util methods to work with images.
- *
- * @author Alexandre Iline (alexandre.iline@sun.com)
- */
-class ImageTool {
-
-    /**
-     * Increases image.
-     * @param image an image to enlarge.
-     * @param zoom A scale.
-     * @return a result image.
-     */
-    public static BufferedImage enlargeImage(BufferedImage image, int zoom) {
-        int wight = image.getWidth();
-        int height = image.getHeight();
-        BufferedImage result = new BufferedImage(wight * zoom,
-                height * zoom,
-                image.getType());
-        int rgb;
-        for (int x = 0; x < wight; x++) {
-            for (int y = 0; y < height; y++) {
-                rgb = image.getRGB(x, y);
-                for (int i = 0; i < zoom; i++) {
-                    for (int j = 0; j < zoom; j++) {
-                        result.setRGB(x * zoom + i,
-                                y * zoom + j,
-                                rgb);
-                    }
-                }
-            }
-        }
-        return (result);
-    }
-
-    /**
-     * Subtracts second image from first one.
-     * Could be used to save file difference for future analysis.
-     * @param minuend an image to subtract from.
-     * @param deduction an image to subtract.
-     * @return a result image.
-     */
-    public static BufferedImage subtractImage(BufferedImage minuend, BufferedImage deduction) {
-        return (subtractImage(minuend, deduction, 0, 0, null));
-    }
-
-    /**
-     * Subtracts second image from first one.
-     * Could be used to save file difference for future analysis.
-     * @param minuend an image to subtract from.
-     * @param deduction an image to subtract.
-     * @param highlight - a color to highlight the difference. If null,
-     * color difference is shown.
-     * @return a result image.
-     */
-    public static BufferedImage subtractImage(BufferedImage minuend, BufferedImage deduction, Color highlight) {
-        return (subtractImage(minuend, deduction, 0, 0, highlight));
-    }
-
-    /**
-     * Subtracts subimage from image.
-     * Could be used to save file difference for future analysis.
-     * @param minuend an image to subtract from.
-     * @param deduction an image to subtract.
-     * @param relativeX - deduction-in-minuend X coordinate
-     * @param relativeY - deduction-in-minuend Y coordinate
-     * @return a result image.
-     */
-    public static BufferedImage subtractImage(BufferedImage minuend, BufferedImage deduction, int relativeX, int relativeY) {
-        return subtractImage(minuend, deduction, relativeX, relativeY, null);
-    }
-
-    /**
-     * Subtracts subimage from image.
-     * Could be used to save file difference for future analysis.
-     * @param minuend an image to subtract from.
-     * @param deduction an image to subtract.
-     * @param relativeX - deduction-in-minuend X coordinate
-     * @param relativeY - deduction-in-minuend Y coordinate
-     * @param highlight - a color to highlight the difference. If null,
-     * color difference is shown.
-     * @return a result image.
-     */
-    public static BufferedImage subtractImage(BufferedImage minuend, BufferedImage deduction, int relativeX, int relativeY, Color highlight) {
-        int mWidth = minuend.getWidth();
-        int mHeight = minuend.getHeight();
-        int dWidth = deduction.getWidth();
-        int dHeight = deduction.getHeight();
-
-        int maxWidth = (mWidth > relativeX + dWidth) ? mWidth : (relativeX + dWidth);
-        int maxHeight = (mHeight > relativeY + dHeight) ? mHeight : (relativeY + dHeight);
-
-        BufferedImage result = new BufferedImage(maxWidth, maxHeight, BufferedImage.TYPE_INT_RGB);
-        int mColor, dColor;
-        for (int x = 0; x < maxWidth; x++) {
-            for (int y = 0; y < maxHeight; y++) {
-                if (x >= mWidth ||
-                        y >= mHeight) {
-                    mColor = 0;
-                } else {
-                    mColor = minuend.getRGB(x, y);
-                }
-                if (x >= dWidth + relativeX ||
-                        y >= dHeight + relativeY ||
-                        x < relativeX ||
-                        y < relativeY) {
-                    dColor = 0;
-                } else {
-                    dColor = deduction.getRGB(x - relativeX, y - relativeY);
-                }
-                result.setRGB(x, y, (mColor != dColor) ? subtractColor((highlight != null) ? highlight.getRGB() : 0, mColor, dColor) : 0);
-            }
-        }
-        return (result);
-    }
-
-    public static double distance(int rgb1, int rgb2) {
-        float [] buffer1 = new float[3];
-        float [] buffer2 = new float[3];
-        Color c1 = new Color(rgb1);
-        Color c2 = new Color(rgb2);
-        c1.getRGBColorComponents(buffer1);
-        c2.getRGBColorComponents(buffer2);
-        double distSquare = 0;
-        for (int i = 0; i < 3; i++) {
-            distSquare += (buffer1[i] - buffer2[i]) * (buffer1[i] - buffer2[i]);
-        }
-        return Math.sqrt(distSquare);
-    }
-
-    private static int subtractColor(int highlight, int m, int d) {
-        if (highlight == 0) {
-            float scale = (float) (distance(m, d) / Math.sqrt(3));
-            return new Color(scale, scale, scale).getRGB();
-        } else {
-            return highlight;
-        }
-    }
-    /**
-     * @param args the command line arguments
-     */
-    public static void main(String[] args) throws IOException {
-        if (args.length != 2) {
-            usage();
-            System.exit(1);
-        }
-        compare(new File(args[0]).getAbsoluteFile(), new File(args[1]).getAbsoluteFile());
-    }
-
-    private static void compare(File golden, File results) throws IOException {
-        if (golden.isDirectory()) {
-            File rfl;
-            for (File fl : golden.listFiles()) {
-                compare(fl, new File(results.getAbsolutePath() + File.separator + fl.getName()));
-            }
-            for (File fl : results.listFiles()) {
-                rfl = new File(golden.getAbsolutePath() + File.separator + fl.getName());
-                if (!rfl.exists()) {
-                    compare(rfl, fl);
-                }
-            }
-        } else {
-            DiffDialog dialog = new DiffDialog();
-            dialog.setImages(golden.exists() ? ImageIO.read(golden) : null, results.exists() ? ImageIO.read(results) : null);
-            dialog.setVisible(true);
-            switch (dialog.status) {
-                case -2:
-                    System.exit(0);
-                case -1:
-                    copy(results, golden);
-                    break;
-                case 1:
-                    golden.delete();
-                    break;
-            }
-        }
-    }
-
-    private static void usage() {
-        System.out.println("java -jar JemmyAWTInput.jar <golden image set> <test result image set>");
-    }
-
-    private static void copy(File results, File golden) throws FileNotFoundException, IOException {
-        if (golden.exists()) {
-            golden.delete();
-        }
-        FileInputStream from = new FileInputStream(results);
-        FileOutputStream to = new FileOutputStream(golden);
-        byte[] buffer = new byte[4096];
-        int bytesRead;
-
-        while ((bytesRead = from.read(buffer)) != -1) {
-            to.write(buffer, 0, bytesRead); // write
-        }
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/NaturalImageComparator.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-
-import java.awt.Color;
-import java.awt.image.BufferedImage;
-import org.jemmy.image.pixel.AverageDistanceComparator;
-import org.jemmy.image.pixel.MaxDistanceComparator;
-
-
-/**
- * Compares two images naturally
- * (i.e. ignoring slight difference between pixel colors).
- *
- * @author KAM
- */
-public class NaturalImageComparator extends BufferedImageComparator {
-
-    /**
-     * Creates comparator with the default sensitivity value = 0.02
-     * (around 5 in 0-255 color component value).
-     * @see #NaturalImageComparator(double)
-     */
-    public NaturalImageComparator() {
-        this(0.02);
-    }
-
-    /**
-     * Creates comparator with the specified sensitivity value
-     * @param sensitivity Maximum threshold for 3-D distance between colors
-     * in 3-D sRGB color space for pixels to be considered equal.
-     * Meaningful values are between 0 and approx 1.733. 0 means colors should
-     * be equal to pass the comparison, 1.733 (which is more than square root
-     * of 3) means that comparison will be passed even if the colors are
-     * completely different.
-     */
-    public NaturalImageComparator(double sensitivity) {
-        super(new MaxDistanceComparator(sensitivity));
-    }
-    public void setSensitivity(double sensitivity) {
-        ((MaxDistanceComparator)getRasterComparator()).setThreshold(sensitivity);
-    }
-    public double getSensitivity() {
-        return ((MaxDistanceComparator)getRasterComparator()).getThreshold();
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/PNGDecoder.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import java.awt.Color;
-
-import java.awt.image.BufferedImage;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.FileInputStream;
-
-import org.jemmy.JemmyException;
-
-import java.util.zip.DataFormatException;
-import java.util.zip.Inflater;
-
-/**
- * Allows to load PNG graphical file.
- * @author Alexandre Iline
- */
-public class PNGDecoder extends Object {
-
-    InputStream in;
-
-    /**
-     * Constructs a PNGDecoder object.
-     * @param in input stream to read PNG image from.
-     */
-    public PNGDecoder(InputStream in) {
-        this.in = in;
-    }
-
-    byte read() throws IOException {
-        byte b = (byte)in.read();
-        return(b);
-    }
-
-    int readInt() throws IOException {
-        byte b[] = read(4);
-        return(((b[0]&0xff)<<24) +
-               ((b[1]&0xff)<<16) +
-               ((b[2]&0xff)<<8) +
-               ((b[3]&0xff)));
-    }
-
-    byte[] read(int count) throws IOException {
-        byte[] result = new byte[count];
-        for(int i = 0; i < count; i++) {
-            result[i] = read();
-        }
-        return(result);
-    }
-
-    boolean compare(byte[] b1, byte[] b2) {
-        if(b1.length != b2.length) {
-            return(false);
-        }
-        for(int i = 0; i < b1.length; i++) {
-            if(b1[i] != b2[i]) {
-                return(false);
-            }
-        }
-        return(true);
-    }
-
-    void checkEquality(byte[] b1, byte[] b2) {
-        if(!compare(b1, b2)) {
-            throw(new JemmyException("Format error"));
-        }
-    }
-
-    /**
-     * Decodes image from an input stream passed into constructor.
-     * @return a BufferedImage object
-     * @throws IOException todo document
-     */
-    public BufferedImage decode() throws IOException {
-        return decode(true);
-    }
-
-    /**
-     * Decodes image from an input stream passed into constructor.
-     * @return a BufferedImage object
-     * @param closeStream requests method to close the stream after the image is read
-     * @throws IOException todo document
-     */
-    public BufferedImage decode(boolean closeStream) throws IOException {
-
-        byte[] id = read(12);
-        checkEquality(id, new byte[] {-119, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13});
-
-        byte[] ihdr = read(4);
-        checkEquality(ihdr, "IHDR".getBytes());
-
-        int width = readInt();
-        int height = readInt();
-
-        BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
-
-        byte[] head = read(5);
-        int mode;
-        if(compare(head, new byte[]{1, 0, 0, 0, 0})) {
-            mode = PNGEncoder.BW_MODE;
-        } else if(compare(head, new byte[]{8, 0, 0, 0, 0})) {
-            mode = PNGEncoder.GREYSCALE_MODE;
-        } else if(compare(head, new byte[]{8, 2, 0, 0, 0})) {
-            mode = PNGEncoder.COLOR_MODE;
-        } else {
-            throw(new JemmyException("Format error"));
-        }
-
-        readInt();//!!crc
-
-        int size = readInt();
-
-        byte[] idat = read(4);
-        checkEquality(idat, "IDAT".getBytes());
-
-        byte[] data = read(size);
-
-
-        Inflater inflater = new Inflater();
-        inflater.setInput(data, 0, size);
-
-        int color;
-
-        try {
-            switch (mode) {
-            case PNGEncoder.BW_MODE:
-                {
-                    int bytes = (int)(width / 8);
-                    if((width % 8) != 0) {
-                        bytes++;
-                    }
-                    byte colorset;
-                    byte[] row = new byte[bytes];
-                    for (int y = 0; y < height; y++) {
-                        inflater.inflate(new byte[1]);
-                        inflater.inflate(row);
-                        for (int x = 0; x < bytes; x++) {
-                            colorset = row[x];
-                            for (int sh = 0; sh < 8; sh++) {
-                                if(x * 8 + sh >= width) {
-                                    break;
-                                }
-                                if((colorset & 0x80) == 0x80) {
-                                    result.setRGB(x * 8 + sh, y, Color.white.getRGB());
-                                } else {
-                                    result.setRGB(x * 8 + sh, y, Color.black.getRGB());
-                                }
-                                colorset <<= 1;
-                            }
-                        }
-                    }
-                }
-                break;
-            case PNGEncoder.GREYSCALE_MODE:
-                {
-                    byte[] row = new byte[width];
-                    for (int y = 0; y < height; y++) {
-                        inflater.inflate(new byte[1]);
-                        inflater.inflate(row);
-                        for (int x = 0; x < width; x++) {
-                            color = row[x];
-                            result.setRGB(x, y, (color << 16) + (color << 8) + color);
-                        }
-                    }
-                }
-                break;
-            case PNGEncoder.COLOR_MODE:
-                {
-                    byte[] row = new byte[width * 3];
-                    for (int y = 0; y < height; y++) {
-                        inflater.inflate(new byte[1]);
-                        inflater.inflate(row);
-                        for (int x = 0; x < width; x++) {
-                            result.setRGB(x, y,
-                                          ((row[x * 3 + 0]&0xff) << 16) +
-                                          ((row[x * 3 + 1]&0xff) << 8) +
-                                          ((row[x * 3 + 2]&0xff)));
-                        }
-                    }
-                }
-            }
-        } catch(DataFormatException e) {
-            throw(new JemmyException("ZIP error", e));
-        }
-
-        readInt();//!!crc
-        readInt();//0
-
-        byte[] iend = read(4);
-        checkEquality(iend, "IEND".getBytes());
-
-        readInt();//!!crc
-        if (closeStream) {
-            in.close();
-        }
-
-        return(result);
-    }
-
-    /**
-     * Decodes image from file.
-     * @param fileName a file to read image from
-     * @return a BufferedImage instance.
-     */
-    public static BufferedImage decode(String fileName) {
-        try {
-            return(new PNGDecoder(new FileInputStream(fileName)).decode());
-        } catch(IOException e) {
-            throw(new JemmyException("IOException during image reading", e));
-        }
-    }
-
-    /**
-     * Decodes image from input stream
-     * @param inputStream a file to read image from
-     * @param closeStream requests method to close the stream after the image is read
-     * @return a BufferedImage instance.
-     */
-    public static BufferedImage decode(InputStream inputStream, boolean closeStream) {
-        try {
-            return(new PNGDecoder(inputStream).decode(closeStream));
-        } catch(IOException e) {
-            throw(new JemmyException("IOException during image reading", e));
-        }
-    }
-
-    /**
-     * Decodes image from resource.
-     * @param loader ClassLoader to use to get the resource
-     * @param resource Image resource name
-     * @return a BufferedImage instance.
-     */
-    public static BufferedImage decode(ClassLoader loader, String resource) {
-        try {
-            InputStream resourceStream = loader.getResourceAsStream(resource);
-            if (resourceStream == null) {
-                throw new JemmyException("Resouce '" + resource + "' could not be found!");
-            }
-            return(new PNGDecoder(resourceStream).decode());
-        } catch(IOException e) {
-            throw(new JemmyException("IOException during image reading", e));
-        }
-    }
-
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/PNGEncoder.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import java.awt.AWTException;
-import java.awt.Rectangle;
-import java.awt.Robot;
-import java.awt.Toolkit;
-
-import java.awt.image.BufferedImage;
-
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.FileOutputStream;
-import java.io.OutputStream;
-
-import java.util.zip.CRC32;
-import java.util.zip.Deflater;
-import java.util.zip.DeflaterOutputStream;
-import org.jemmy.control.ScreenArea;
-
-/**
- * This class allows to encode BufferedImage into B/W, greyscale or true color PNG
- * image format with maximum compression.<br>
- * It also provides complete functionality for capturing full screen, part of
- * screen or single component, encoding and saving captured image info PNG file.
- * @author Adam Sotona
- * @version 1.0
- */
-public class PNGEncoder extends Object {
-
-    /** black and white image mode. */
-    public static final byte BW_MODE = 0;
-    /** grey scale image mode. */
-    public static final byte GREYSCALE_MODE = 1;
-    /** full color image mode. */
-    public static final byte COLOR_MODE = 2;
-
-    OutputStream out;
-    CRC32 crc;
-    byte mode;
-
-    public PNGEncoder(File file) throws FileNotFoundException {
-        this(new FileOutputStream(file));
-    }
-    /** public constructor of PNGEncoder class with greyscale mode by default.
-     * @param out output stream for PNG image format to write into
-     */
-    public PNGEncoder(OutputStream out) {
-        this(out, GREYSCALE_MODE);
-    }
-
-    /** public constructor of PNGEncoder class.
-     * @param out output stream for PNG image format to write into
-     * @param mode BW_MODE, GREYSCALE_MODE or COLOR_MODE
-     */
-    public PNGEncoder(OutputStream out, byte mode) {
-        crc=new CRC32();
-        this.out = out;
-        if (mode<0 || mode>2)
-            throw new IllegalArgumentException("Unknown color mode");
-        this.mode = mode;
-    }
-
-    void write(int i) throws IOException {
-        byte b[]={(byte)((i>>24)&0xff),(byte)((i>>16)&0xff),(byte)((i>>8)&0xff),(byte)(i&0xff)};
-        write(b);
-    }
-
-    void write(byte b[]) throws IOException {
-        out.write(b);
-        crc.update(b);
-    }
-
-    /** main encoding method (stays blocked till encoding is finished).
-     * @param image BufferedImage to encode
-     * @throws IOException IOException
-     */
-    public void encode(BufferedImage image) throws IOException {
-        encode(image, true);
-    }
-
-    /** main encoding method (stays blocked till encoding is finished).
-     * @param image BufferedImage to encode
-     * @param closeStream requests method to close the stream after the image is written
-     * @throws IOException IOException
-     */
-    public void encode(BufferedImage image, boolean closeStream) throws IOException {
-        int width = image.getWidth(null);
-        int height = image.getHeight(null);
-        final byte id[] = {-119, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13};
-        write(id);
-        crc.reset();
-        write("IHDR".getBytes());
-        write(width);
-        write(height);
-        byte head[]=null;
-        switch (mode) {
-            case BW_MODE: head=new byte[]{1, 0, 0, 0, 0}; break;
-            case GREYSCALE_MODE: head=new byte[]{8, 0, 0, 0, 0}; break;
-            case COLOR_MODE: head=new byte[]{8, 2, 0, 0, 0}; break;
-        }
-        write(head);
-        write((int) crc.getValue());
-        ByteArrayOutputStream compressed = new ByteArrayOutputStream(65536);
-        BufferedOutputStream bos = new BufferedOutputStream( new DeflaterOutputStream(compressed, new Deflater(9)));
-        int pixel;
-        int color;
-        int colorset;
-        switch (mode) {
-            case BW_MODE:
-                int rest=width%8;
-                int bytes=width/8;
-                for (int y=0;y<height;y++) {
-                    bos.write(0);
-                    for (int x=0;x<bytes;x++) {
-                        colorset=0;
-                        for (int sh=0; sh<8; sh++) {
-                            pixel=image.getRGB(x*8+sh,y);
-                            color=((pixel >> 16) & 0xff);
-                            color+=((pixel >> 8) & 0xff);
-                            color+=(pixel & 0xff);
-                            colorset<<=1;
-                            if (color>=3*128)
-                                colorset|=1;
-                        }
-                        bos.write((byte)colorset);
-                    }
-                    if (rest>0) {
-                        colorset=0;
-                        for (int sh=0; sh<width%8; sh++) {
-                            pixel=image.getRGB(bytes*8+sh,y);
-                            color=((pixel >> 16) & 0xff);
-                            color+=((pixel >> 8) & 0xff);
-                            color+=(pixel & 0xff);
-                            colorset<<=1;
-                            if (color>=3*128)
-                                colorset|=1;
-                        }
-                        colorset<<=8-rest;
-                        bos.write((byte)colorset);
-                    }
-                }
-                break;
-            case GREYSCALE_MODE:
-                for (int y=0;y<height;y++) {
-                    bos.write(0);
-                    for (int x=0;x<width;x++) {
-                        pixel=image.getRGB(x,y);
-                        color=((pixel >> 16) & 0xff);
-                        color+=((pixel >> 8) & 0xff);
-                        color+=(pixel & 0xff);
-                        bos.write((byte)(color/3));
-                    }
-                }
-                break;
-             case COLOR_MODE:
-                for (int y=0;y<height;y++) {
-                    bos.write(0);
-                    for (int x=0;x<width;x++) {
-                        pixel=image.getRGB(x,y);
-                        bos.write((byte)((pixel >> 16) & 0xff));
-                        bos.write((byte)((pixel >> 8) & 0xff));
-                        bos.write((byte)(pixel & 0xff));
-                    }
-                }
-                break;
-        }
-        bos.close();
-        write(compressed.size());
-        crc.reset();
-        write("IDAT".getBytes());
-        write(compressed.toByteArray());
-        write((int) crc.getValue());
-        write(0);
-        crc.reset();
-        write("IEND".getBytes());
-        write((int) crc.getValue());
-        out.flush();
-        if (closeStream) {
-            out.close();
-        }
-    }
-
-    /** Static method performing screen capture into PNG image format file with given fileName.
-     * @param rect Rectangle of screen to be captured
-     * @param fileName file name for screen capture PNG image file */
-    public static void captureScreen(Rectangle rect, String fileName) {
-        captureScreen(rect, fileName, GREYSCALE_MODE);
-    }
-
-    /** Static method performing screen capture into PNG image format file with given fileName.
-     * @param rect Rectangle of screen to be captured
-     * @param mode image color mode
-     * @param fileName file name for screen capture PNG image file */
-    public static void captureScreen(Rectangle rect, String fileName, byte mode) {
-        try {
-            BufferedImage capture=new Robot().createScreenCapture(rect);
-            BufferedOutputStream file=new BufferedOutputStream(new FileOutputStream(fileName));
-            PNGEncoder encoder=new PNGEncoder(file, mode);
-            encoder.encode(capture);
-        } catch (AWTException awte) {
-            awte.printStackTrace();
-        } catch (IOException ioe) {
-            ioe.printStackTrace();
-        }
-    }
-
-     /** Static method performing one component screen capture into PNG image format file with given fileName.
-      * @param comp Component to be captured
-      * @param fileName String image target filename */
-    public static void captureScreen(ScreenArea comp, String fileName) {
-        captureScreen(comp, fileName, GREYSCALE_MODE);
-    }
-
-    /** Static method performing one component screen capture into PNG image format file with given fileName.
-     * @param comp Component to be captured
-     * @param fileName String image target filename
-     * @param mode image color mode */
-    public static void captureScreen(ScreenArea comp, String fileName, byte mode) {
-        captureScreen(Utils.convert(comp.getScreenBounds()),
-            fileName, mode);
-    }
-
-
-    /** Static method performing whole screen capture into PNG image format file with given fileName.
-     * @param fileName String image target filename */
-    public static void captureScreen(String fileName) {
-        captureScreen(fileName, GREYSCALE_MODE);
-    }
-
-    /** Static method performing whole screen capture into PNG image format file with given fileName.
-     * @param fileName String image target filename
-     * @param mode image color mode */
-    public static void captureScreen(String fileName, byte mode) {
-        captureScreen(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()), fileName, mode);
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/PNGImageLoader.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import java.awt.image.BufferedImage;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-
-/**
- * Allowes to process PNF image format.
- *
- * @author Alexandre Iline (alexandre.iline@sun.com)
- */
-class PNGImageLoader {
-
-    /**
-     * Loads an image from a PNG image file.
-     * @param in
-     * @throws IOException
-     */
-    public BufferedImage load(InputStream in) throws IOException {
-        return(new PNGDecoder(in).decode());
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/PNGImageSaver.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import java.awt.image.BufferedImage;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-
-/**
- * Allows to process PNG image format.
- *
- * @author Alexandre Iline (alexandre.iline@sun.com)
- */
-class PNGImageSaver {
-
-    /**
-     * Saves an image into a PNG image file.
-     * @throws IOException
-     */
-    public void save(BufferedImage image, String fileName) throws IOException{
-        File f = new File(fileName);
-        File parent = f.getParentFile();
-        if (parent != null) {
-            parent.mkdirs();
-        }
-        new PNGEncoder(new BufferedOutputStream(new FileOutputStream(f)),
-                       PNGEncoder.COLOR_MODE).encode(image);
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/ResizeImageComparator.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,227 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import java.awt.Graphics2D;
-import java.awt.image.BufferedImage;
-import org.jemmy.Dimension;
-import org.jemmy.env.Environment;
-import org.jemmy.env.TestOut;
-import org.jemmy.image.pixel.Raster;
-import org.jemmy.image.pixel.RasterComparator;
-import org.jemmy.image.pixel.ResizeComparator;
-
-/**
- * Comparator that makes image sizes equal to compare them with other comparator
- * most of them work only for the images with equal dimensions.
- *
- * It is controlled by three parameters:
- * <p>
- * Resize Mode - defines way of resizing images that are being compared. One of the following constants:
- * <ul>
-*     <li>{@linkplain ResizeMode#NO_RESIZE NO_RESIZE},</li>
-*     <li>{@linkplain ResizeMode#PROPORTIONAL_RESIZE PROPORTIONAL_RESIZE},</li>
-*     <li>{@linkplain ResizeMode#ARBITRARY_RESIZE ARBITRARY_RESIZE}.</li>
- * </ul>
- *
- * Default value is {@linkplain ResizeMode#PROPORTIONAL_RESIZE}.
- * <ul>
- * <li>Resize Hint - defines the way of images scaling that is specified when
- * {@linkplain java.awt.Image#getScaledInstance(int, int, int) Image.getScaledInstance()} method is invoked.
- * One of the Image.SCALE_XXX is expected. Default value is {@linkplain java.awt.Image#SCALE_DEFAULT SCALE_DEFAULT}.</li>
- * <li>Proportion Distortion Threshold - defines maximum proportion distortion that is used in
- * {@linkplain ResizeMode#PROPORTIONAL_RESIZE PROPORTIONAL_RESIZE} mode to deal with cases when rounding and other
- * problems could cause sizes to be not ideally proportional.
- * <p>
- * Threshold value is applied in the following way: {@code Math.abs(image.getSize() * scale
- * - size) / image.getSize() > PROPORTION_DISTORTION_THRESHOLD}, where {@code image.getSize()}
- * is both image dimensions and {@code size} is target width and height (which
- * is defined as mininum of sizes of two images) and scale is the scale factor
- * that scales the particular image to fit the width and height.
- * <p>
- * Default value is 0.02 so as much as 2% of width/height could differ (around 5
- * in 0-255 color component values).</li>
- * </ul>
- *
- * @author mrkam
- */
-public class ResizeImageComparator extends ResizeComparator {
-
-    /**
-     * Identifies output where resize details are printed. Output is disabled
-     * by default.
-     *
-     * @see Environment#getOutput(java.lang.String)
-     */
-    public static final String OUTPUT = ResizeImageComparator.class.getName()
-            + ".OUTPUT";
-
-    static {
-        Environment.getEnvironment().setOutput(OUTPUT, TestOut.getNullOutput());
-    }
-    ResizeMode resizeMode;
-    int hint;
-    double propDistThreshold;
-
-    /**
-     * Resize Modes
-     *
-     * @see ResizeImageComparator#ResizeImageComparator(ResizeMode, ImageComparator)
-     * @see ResizeImageComparator#ResizeImageComparator(ResizeMode, double, int, ImageComparator)
-     */
-    public static enum ResizeMode {
-
-        /**
-         * Images are never resized. Original images are always compared.
-         */
-        NO_RESIZE,
-        /**
-         * Images are resized only if they have exactly or almost proportional
-         * sizes which is controlled by {@code proportionDistortion} parameter.
-         * If images have different proportions no resize is done and original
-         * images are compared.
-         *
-         * @see ResizeImageComparator#ResizeImageComparator(ResizeMode, ImageComparator)
-         */
-        PROPORTIONAL_RESIZE,
-        /**
-         * Images are always resized to match both width and height and then
-         * compared.
-         */
-        ARBITRARY_RESIZE
-    }
-
-    /**
-     * Creates ResizeImageComparator with default resize settings:
-     * <ul>
-     * <li>resize mode: {@linkplain ResizeMode#PROPORTIONAL_RESIZE ResizeMode.PROPORTIONAL_RESIZE}.</li>
-     * <li>proportion distortion threshold: 0.02.</li>
-     * <li>resize hint: {@linkplain java.awt.Image#SCALE_DEFAULT Image.SCALE_DEFAULT}.</li>
-     * </ul>
-     *
-     * @param subComparator comparator to compare images after resize.
-     * @see java.awt.Image#getScaledInstance(int, int, int)
-     * @see ResizeMode
-     * @see ResizeImageComparator
-     */
-    public ResizeImageComparator(ImageComparator subComparator) {
-        super(subComparator, ResizeComparator.Mode.LEFT);
-        this.resizeMode = ResizeMode.PROPORTIONAL_RESIZE;
-        this.hint = java.awt.Image.SCALE_DEFAULT;
-        this.propDistThreshold = 0.02;
-    }
-
-    /**
-     * Creates ResizeImageComparator with the specified resize mode and default
-     * settings for other parameters:
-     * <ul>
-     * <li>proportion distortion threshold: 0.02.</li>
-     * <li>resize hint: {@linkplain java.awt.Image#SCALE_DEFAULT Image.SCALE_DEFAULT}.</li>
-     * </ul>
-     *
-     * @param resizeMode resize mode for this comparator.
-     * @param subComparator comparator to compare images after resize.
-     * @see ResizeMode
-     * @see ResizeImageComparator
-     */
-    public ResizeImageComparator(ResizeMode resizeMode,
-            ImageComparator subComparator) {
-        this(subComparator);
-        this.resizeMode = resizeMode;
-    }
-
-    /**
-     * Creates ResizeImageComparator with the following settings:
-     * <ul>
-     * <li>resize mode: {@linkplain ResizeMode#PROPORTIONAL_RESIZE ResizeMode.PROPORTIONAL_RESIZE}.</li>
-     * <li>specified proportion distortion threshold.</li>
-     * <li>resize hint: {@linkplain java.awt.Image#SCALE_DEFAULT Image.SCALE_DEFAULT}.</li>
-     * </ul>
-     *
-     * @param propDistThreshold proportion distortion threshold.
-     * @param subComparator comparator to compare images after resize.
-     * @see ResizeImageComparator
-     */
-    public ResizeImageComparator(double propDistThreshold,
-            ImageComparator subComparator) {
-        this(subComparator);
-        this.propDistThreshold = propDistThreshold;
-    }
-
-    /**
-     * Creates ResizeImageComparator with specified settings.
-     *
-     * @param resizeMode Resize mode.
-     * @param propDistThreshold Proportion distortion threshold.
-     * @param hint Resize hint.
-     * @param subComparator comparator to compare images after resize.
-     * @see ResizeImageComparator
-     * @see ResizeMode
-     */
-    public ResizeImageComparator(ResizeMode resizeMode, double propDistThreshold,
-            int hint, ImageComparator subComparator) {
-        this(subComparator);
-        this.resizeMode = resizeMode;
-        this.hint = hint;
-        this.propDistThreshold = propDistThreshold;
-    }
-
-    @Override
-    public Image resize(Image image, Dimension size) {
-        Dimension isize = getSize(image);
-        double scalex = (double) size.width / isize.width;
-        double scaley = (double) size.height / isize.height;
-        switch (resizeMode) {
-            case NO_RESIZE:
-                return image;
-            case PROPORTIONAL_RESIZE:
-                if (Math.abs(scalex - scaley) > propDistThreshold) {
-                    return null;
-                }
-            case ARBITRARY_RESIZE:
-                BufferedImage res = new BufferedImage(size.width, size.height, ((AWTImage) image).getTheImage().getType());
-                java.awt.Image scaled = ((AWTImage) image).getTheImage().getScaledInstance(
-                        size.width, size.height, hint);
-                Graphics2D g = res.createGraphics();
-                g.drawImage(scaled, 0, 0, null);
-                g.dispose();
-                return new AWTImage(res);
-            default:
-                return null;
-        }
-    }
-    @Override
-    public String getID() {
-        return ResizeImageComparator.class.getName() + "("
-                + getSubComparator().getID() + ")";
-    }
-
-    @Override
-    public Dimension getSize(Image image) {
-        BufferedImage bi = ((AWTImage)image).getTheImage();
-        return new Dimension(bi.getWidth(), bi.getHeight());
-    }
-
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/RoughImageComparator.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import org.jemmy.image.pixel.PixelEqualityRasterComparator;
-
-/**
- * Compares two images roughly (i.e. not all of the pixel colors should match).
- *
- * @author shura
- * @author mrkam
- */
-public class RoughImageComparator extends BufferedImageComparator {
-
-    /**
-     * Creates a comparator with
-     * <code>roughness</code> allowed roughness.
-     *
-     * @param roughness Allowed comparision roughness.
-     */
-    public RoughImageComparator(double roughness) {
-        super(new PixelEqualityRasterComparator(roughness));
-    }
-    public void setRoughness(double roughness) {
-        ((PixelEqualityRasterComparator)getRasterComparator()).setThreshold(roughness);
-    }
-    public double getRoughness() {
-        return ((PixelEqualityRasterComparator)getRasterComparator()).getThreshold();
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/RoughImageFinder.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import org.jemmy.Point;
-import java.awt.image.BufferedImage;
-
-/**
- * Performs "rough" image search.
- *
- * @author shura
- */
-public class RoughImageFinder implements ImageFinder {
-    double roughness = .0;
-    int bigWidth, bigHeight;
-    int[][] bigPixels;
-
-    /**
-     * Creates an instance allowing to find an image inside the one
-     * passed as parameter with some "roughness".
-     * @param area - Image to search in.
-     * @param roughness - Allowed
-     */
-    public RoughImageFinder(BufferedImage area, double roughness) {
-        this.roughness = roughness;
-        bigWidth  = area.getWidth();
-        bigHeight = area.getHeight();
-        bigPixels = new int[bigWidth][bigHeight];
-        for(int x = 0; x < bigWidth; x++) {
-            for(int y = 0; y < bigHeight; y++) {
-                bigPixels[x][y] = area.getRGB(x, y);
-            }
-        }
-    }
-
-    /**
-     * Performs "rough" search.
-     * @param image an image to search.
-     * @param index an ordinal image location index.
-     * @return Point where number of unmatching pixels less or equal to
-     * <code>image1.getWidth() * image1.getHeight() * roughness</code>
-     */
-    public Point findImage(BufferedImage image, int index) {
-        int smallWidth  = image.getWidth();
-        int smallHeight = image.getHeight();
-        int[][] smallPixels = new int[smallWidth][smallHeight];
-        for(int x = 0; x < smallWidth; x++) {
-            for(int y = 0; y < smallHeight; y++) {
-                smallPixels[x][y] = image.getRGB(x, y);
-            }
-        }
-        double maxRoughPixels = (double)(smallWidth * smallHeight) * roughness;
-        int count = 0;
-        for(int X = 0; X <= bigWidth - smallWidth; X++) {
-            for(int Y = 0; Y <= bigHeight - smallHeight; Y++) {
-                int roughPixels = 0;
-                for(int x = 0; x < smallWidth; x++) {
-                    for(int y = 0; y < smallHeight; y++) {
-                        if(smallPixels[x][y] != bigPixels[X + x][Y + y]) {
-                            roughPixels++;
-                            if(roughPixels > maxRoughPixels) {
-                                break;
-                            }
-                        }
-                    }
-                    if(roughPixels > maxRoughPixels) {
-                        break;
-                    }
-                }
-                if(roughPixels <= maxRoughPixels) {
-                    if(count == index) {
-                        return(new Point(X, Y));
-                    }
-                    count++;
-                }
-            }
-        }
-        return(null);
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/StrictImageComparator.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import org.jemmy.image.pixel.PixelEqualityRasterComparator;
-
-/**
- * Compares two images strictly (i.e. all the pixel colors should match).
- *
- * @author shura
- * @author mrkam
- */
-public class StrictImageComparator extends BufferedImageComparator {
-
-    public StrictImageComparator() {
-        super(new PixelEqualityRasterComparator(0));
-    }
-
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/StrictImageFinder.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-import org.jemmy.Point;
-import java.awt.image.BufferedImage;
-
-/**
- * Performs "strict" (i.e. based on all pixels matching) image search.
- *
- * @author Alexandre Iline (alexandre.iline@sun.com)
- */
-public class StrictImageFinder implements ImageFinder {
-    int bigWidth, bigHeight;
-    int[][] bigPixels;
-
-    /**
-     * Creates an instance searching subimages insige a parameter image.
-     * @param area - Image to search in.
-     */
-    public StrictImageFinder(BufferedImage area) {
-        bigWidth  = area.getWidth();
-        bigHeight = area.getHeight();
-        bigPixels = new int[bigWidth][bigHeight];
-        for(int x = 0; x < bigWidth; x++) {
-            for(int y = 0; y < bigHeight; y++) {
-                bigPixels[x][y] = area.getRGB(x, y);
-            }
-        }
-    }
-
-    /**
-     * Searchs for an image inside image passed into constructor.
-     * @param image an image to search.
-     * @param index an ordinal image location index. If equal to 1, for example,
-     * second appropriate location will be found.
-     * @return Left-up corner coordinates of image location.
-     */
-    public Point findImage(BufferedImage image, int index) {
-        int smallWidth  = image.getWidth();
-        int smallHeight = image.getHeight();
-        int[][] smallPixels = new int[smallWidth][smallHeight];
-        for(int x = 0; x < smallWidth; x++) {
-            for(int y = 0; y < smallHeight; y++) {
-                smallPixels[x][y] = image.getRGB(x, y);
-            }
-        }
-        boolean good;
-        int count = 0;
-        for(int X = 0; X <= bigWidth - smallWidth; X++) {
-            for(int Y = 0; Y <= bigHeight - smallHeight; Y++) {
-                good = true;
-                for(int x = 0; x < smallWidth; x++) {
-                    for(int y = 0; y < smallHeight; y++) {
-                        if(smallPixels[x][y] != bigPixels[X + x][Y + y]) {
-                            good = false;
-                            break;
-                        }
-                    }
-                    if(!good) {
-                        break;
-                    }
-                }
-                if(good) {
-                    if(count == index) {
-                        return(new Point(X, Y));
-                    }
-                    count++;
-                }
-            }
-        }
-        return(null);
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/image/Utils.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.image;
-
-
-import org.jemmy.Dimension;
-import org.jemmy.Point;
-import org.jemmy.Rectangle;
-
-
-/**
- *
- * @author mrkam
- */
-public class Utils {
-
-    public static java.awt.Rectangle convert(Rectangle r) {
-        return new java.awt.Rectangle(r.x, r.y, r.width, r.height);
-    }
-
-    public static Rectangle convert(java.awt.Rectangle r) {
-        return new Rectangle(r.x, r.y, r.width, r.height);
-    }
-
-    public static java.awt.Point convert(Point p) {
-        return new java.awt.Point(p.x, p.y);
-    }
-
-    public static Point convert(java.awt.Point p) {
-        return new Point(p.x, p.y);
-    }
-
-    public static java.awt.Dimension convert(Dimension d) {
-        return new java.awt.Dimension(d.width, d.height);
-    }
-
-    public static Dimension convert(java.awt.Dimension d) {
-        return new Dimension(d.width, d.height);
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/AWTImage.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import org.jemmy.Dimension;
+import org.jemmy.JemmyException;
+import org.jemmy.control.Wrap;
+import org.jemmy.env.Environment;
+import org.jemmy.image.Image;
+import org.jemmy.image.ImageComparator;
+import org.jemmy.image.ImageStore;
+import org.jemmy.image.pixel.*;
+
+
+/**
+ * @author shura
+ */
+public class AWTImage implements Image, WriteableRaster {
+
+    public static final String OUTPUT = AWTImage.class.getName() + ".OUTPUT";
+    public static final String PNG_FILE = ".png";
+
+    /**
+     * Get the value of imageRoot. The field is used to store images by relative
+     * path within the root. Images should be pointed out by full file names if
+     * the value is null.
+     *
+     * @return the value of imageRoot
+     */
+    public static File getImageRoot() {
+        ImageStore res = Environment.getEnvironment().getProperty(ImageStore.class);
+        if(!(res instanceof PNGFileImageStore)) {
+            throw new IllegalStateException("Unsupported ImageStore: " + res.getClass().getName());
+        }
+        return ((PNGFileImageStore)res).getRoot();
+    }
+
+    /**
+     * Set the value of imageRoot. If null, an image ID should be full path.
+     *
+     * @param imageRoot new value of imageRoot
+     */
+    public static void setImageRoot(File imageRoot) {
+        Environment.getEnvironment().setProperty(ImageStore.class, new PNGFileImageStore(imageRoot));
+    }
+
+    /**
+     * Gets comparator to be used by default.
+     *
+     * @see Wrap#waitImage(org.jemmy.image.Image, java.lang.String,
+     * java.lang.String)
+     * @see ImageComparator
+     * @return default comparator
+     */
+    public static ImageComparator getComparator() {
+        return Environment.getEnvironment().getProperty(ImageComparator.class);
+    }
+
+    /**
+     * Sets comparator to be used by default.
+     *
+     * @see Wrap#waitImage(org.jemmy.image.Image, java.lang.String,
+     * java.lang.String)
+     * @see ImageComparator
+     * @param comparator todo document
+     */
+    public static void setComparator(ImageComparator comparator) {
+        Environment.getEnvironment().setProperty(ImageComparator.class, comparator);
+    }
+
+    static {
+        Environment.getEnvironment().setPropertyIfNotSet(ImageComparator.class,
+                new BufferedImageComparator(Environment.getEnvironment()));
+        Environment.getEnvironment().setPropertyIfNotSet(ImageStore.class, new PNGFileImageStore());
+    }
+
+    private BufferedImage image;
+
+    public AWTImage(BufferedImage img) {
+        this.image = img;
+    }
+
+    public BufferedImage getTheImage() {
+        return image;
+    }
+
+    /**
+     * Compares using current comparator.
+     *
+     * @see AWTImage#getComparator()
+     * @param img todo document
+     * @return diff image.
+     */
+    public Image compareTo(Image img) {
+        return getComparator().compare(this, img);
+    }
+
+    /**
+     * Saves to a filesystem. fileName is expected to be a full path, unless
+     * imageRoot is specified. ".png" extension is added automatically if not
+     * specified.
+     *
+     * @see AWTImage#getImageRoot()
+     * @param fileName full or relative file name
+     */
+    public void save(String fileName) {
+        try {
+            String fullPath = fileName;
+            File imageRoot = getImageRoot();
+            if (imageRoot != null) {
+                fullPath = imageRoot.getAbsolutePath() + File.separator + fileName;
+            }
+            if (!fullPath.toLowerCase().endsWith(PNG_FILE)) {
+                fullPath += PNG_FILE;
+            }
+            new PNGImageSaver().save(image, fullPath);
+            Environment.getEnvironment().getOutput(OUTPUT).println("Image saved to " + fullPath);
+        } catch (IOException ex) {
+            throw new JemmyException("Unable to save image", ex, fileName);
+        }
+    }
+
+    public Dimension getSize() {
+        return new Dimension(image.getWidth(), image.getHeight());
+    }
+
+    public void getColors(int x, int y, double[] colors) {
+        int orig = image.getRGB(x, y);
+        int ivalue;
+        for (Raster.Component c : getSupported()) {
+            switch (c) {
+                case ALPHA:
+                    ivalue = (orig & 0xFF000000) >>> 0x18;
+                    break;
+                case RED:
+                    ivalue = (orig & 0xFF0000) >>> 0x10;
+                    break;
+                case GREEN:
+                    ivalue = (orig & 0xFF00) >>> 0x8;
+                    break;
+                case BLUE:
+                    ivalue = (orig & 0xFF);
+                    break;
+                default:
+                    throw new IllegalArgumentException("Unknown color component" + c);
+            }
+            colors[PixelImageComparator.arrayIndexOf(getSupported(), c)] = (double) ivalue / 0xFF;
+        }
+    }
+
+    public void setColors(int x, int y, double[] colors) {
+        int rgb = 0;
+        double value;
+        int ivalue;
+        for (Raster.Component c : getSupported()) {
+            value = colors[PixelImageComparator.arrayIndexOf(getSupported(), c)];
+            if (value < 0 || value > 1) {
+                throw new IllegalArgumentException("Color component value should be within (0, 1). Gotten: " + value);
+            }
+            ivalue = (int) Math.round(value * 0xFF);
+            if (ivalue > 0xFF) {
+                throw new IllegalStateException("Component value is greater than 0xFF: " + ivalue);
+            }
+            switch (c) {
+                case ALPHA:
+                    rgb |= (ivalue << 0x18);
+                    break;
+                case RED:
+                    rgb |= (ivalue << 0x10);
+                    break;
+                case GREEN:
+                    rgb |= (ivalue << 0x8);
+                    break;
+                case BLUE:
+                    rgb |= ivalue;
+                    break;
+                default:
+                    throw new IllegalArgumentException("Unknown color component: " + c);
+            }
+        }
+        getTheImage().setRGB(x, y, rgb);
+    }
+
+    public Component[] getSupported() {
+        return new Component[]{Component.RED, Component.BLUE, Component.GREEN, Component.ALPHA};
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/AWTRobotCapturer.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+
+import org.jemmy.Rectangle;
+import org.jemmy.control.Wrap;
+import org.jemmy.image.Image;
+import org.jemmy.image.ImageCapturer;
+import org.jemmy.input.awt.RobotDriver;
+
+
+/**
+ * Uses java.awt.Robot to capture the images
+ * @author mrkam, shura
+ */
+public class AWTRobotCapturer implements ImageCapturer {
+    static {
+        try {
+            Class.forName(AWTImage.class.getName());
+        } catch (ClassNotFoundException ex) {
+        }
+    }
+
+    public Image capture(Wrap<?> control, Rectangle area) {
+        Rectangle rect = new Rectangle();
+        Rectangle bounds = control.getScreenBounds();
+        rect.x = bounds.x + area.x;
+        rect.y = bounds.y + area.y;
+        rect.width = area.width;
+        rect.height = area.height;
+        return RobotDriver.createScreenCapture(rect);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/AbstractImageComparator.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.jemmy.image.awt;
+
+
+import org.jemmy.image.ImageComparator;
+
+import java.awt.image.BufferedImage;
+
+
+/**
+ * Common part of most ImageComparators.
+ *
+ * @author KAM
+ * @deprecated Use classes from org.jemmy.image.pixel package instead.
+ */
+@Deprecated
+public abstract class AbstractImageComparator implements ImageComparator {
+
+    /**
+     * Checks whether images have difference.
+     * @param image1 First image to compare.
+     * @param image2 Second image to compare.
+     * @return true if images have no difference, false otherwise.
+     */
+    public abstract boolean noDifference(BufferedImage image1, BufferedImage image2);
+
+    /**
+     * {@inheritDoc}
+     */
+    public BufferedImage compare(BufferedImage image1, BufferedImage image2) {
+        if (noDifference(image1, image2)) {
+            return null;
+        } else {
+            return ImageTool.subtractImage(image1, image2);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/AverageDistanceImageComparator.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.jemmy.image.awt;
+
+
+import org.jemmy.image.pixel.AverageDistanceComparator;
+
+
+/**
+ * Compares two images calculating average color distance between pixels and
+ * comparing it to the threshold value. See {@linkplain NaturalImageComparator
+ * NaturalImageComparator} for color comparison details.
+ *
+ * @author KAM
+ */
+public class AverageDistanceImageComparator extends BufferedImageComparator {
+
+    /**
+     * Creates comparator with the default sensitivity value = 0.02
+     * (around 5 in 0-255 color component value).
+     * @see #AverageDistanceImageComparator(double)
+     */
+    public AverageDistanceImageComparator() {
+        this(0.02);
+    }
+
+    /**
+     * Creates comparator with the specified sensitivity value
+     * @param sensitivity Maximum threshold for average 3-D distance between
+     * colors in 3-D sRGB color space for images to be considered equal.
+     * Meaningful values lay between 0 and approx 1.733. 0 means colors should
+     * be equal to pass the comparison, 1.733 (which is more than square root
+     * of 3) means that comparison will be passed even if all the colors are
+     * completely different.
+     */
+    public AverageDistanceImageComparator(double sensitivity) {
+        super(new AverageDistanceComparator(sensitivity));
+    }
+
+    public void setSensitivity(double sensitivity) {
+        ((AverageDistanceComparator)getRasterComparator()).setThreshold(sensitivity);
+    }
+    public double getSensitivity() {
+        return ((AverageDistanceComparator)getRasterComparator()).getThreshold();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/BufferedImageComparator.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import java.awt.image.BufferedImage;
+import org.jemmy.env.Environment;
+import org.jemmy.image.Image;
+import org.jemmy.image.pixel.PixelImageComparator;
+import org.jemmy.image.pixel.Raster;
+import org.jemmy.image.pixel.RasterComparator;
+import org.jemmy.image.pixel.WriteableRaster;
+
+/**
+ *
+ * @author shura
+ */
+public class BufferedImageComparator extends PixelImageComparator {
+
+    public BufferedImageComparator(RasterComparator comparator) {
+        super(comparator);
+    }
+
+    public BufferedImageComparator(Environment env) {
+        super(env);
+    }
+
+    @Override
+    protected Image toImage(Raster image) {
+        if(image instanceof AWTImage) {
+            return (AWTImage)image;
+        } else {
+            throw new IllegalArgumentException("Unrecognized image type" + image.getClass().getName());
+        }
+    }
+
+    @Override
+    protected Raster toRaster(Image image) {
+        if(image instanceof AWTImage) {
+            return (AWTImage)image;
+        } else {
+            throw new IllegalArgumentException("Unrecognized image type" + image.getClass().getName());
+        }
+    }
+
+    @Override
+    protected WriteableRaster createDiffRaster(Raster r1, Raster r2) {
+        AWTImage img2 = (AWTImage) r2;
+        AWTImage img1 = (AWTImage) r1;
+        return new AWTImage(new BufferedImage(
+                Math.max(img1.getSize().width, img2.getSize().width),
+                Math.max(img1.getSize().height, img2.getSize().height),
+                img1.getTheImage().getType()));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/ClasspathImageLoader.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+
+import org.jemmy.env.Environment;
+import org.jemmy.image.Image;
+import org.jemmy.image.ImageLoader;
+
+
+/**
+ * ImageLoader implementation which is able to load images through
+ * a given classloader.
+ * @author mrkam
+ * @author shura
+ */
+public class ClasspathImageLoader implements ImageLoader {
+
+    private String packagePrefix = "";
+    private ClassLoader classLoader = getClassLoader();
+
+    public static final String OUTPUT = AWTImage.class.getName() + ".OUTPUT";
+
+    /**
+     * Get the value of classLoader which is used to load images.
+     *
+     * @return the value of classLoader
+     */
+    public ClassLoader getClassLoader() {
+        return classLoader;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Image load(String ID) {
+        String fullId = ((packagePrefix != null) ? packagePrefix : "") + ID;
+        Environment.getEnvironment().getOutput(ClasspathImageLoader.OUTPUT).println("Image loaded from " + fullId + " by " + classLoader);
+        return new AWTImage(PNGDecoder.decode(classLoader, fullId));
+    }
+
+    /**
+     * Set the value of classLoader
+     *
+     * @param classLoader new value of classLoader
+     */
+    public void setClassLoader(ClassLoader classLoader) {
+        this.classLoader = classLoader;
+    }
+
+    public void setRootPackage(Package rootPackage) {
+        if (rootPackage != null) {
+            this.packagePrefix = rootPackage.getName().replace('.', '/') + "/";
+        } else {
+            this.packagePrefix = null;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/ColorImageComparator.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import java.awt.image.BufferedImage;
+
+import org.jemmy.image.Image;
+import org.jemmy.image.ImageComparator;
+import org.jemmy.image.pixel.PixelEqualityRasterComparator;
+
+/**
+ * Compares two images with color mapping defined by
+ * <code>ColorModel</code> implementation.
+ *
+ * @author Alexandre Iline (alexandre.iline@sun.com)
+ * @deprecated Use classes form org.jemmy.image.pixel instead.
+ */
+@Deprecated
+public class ColorImageComparator implements ImageComparator {
+
+    ColorMap leftMap, rightMap;
+    ImageComparator comparator = null;
+
+    /**
+     * Creates a comparator with a color maps. Object created by this
+     * constructor behaves like
+     * <code>StrictImageComparator</code>. Object created works faster because
+     * it does not create intermediate images for another comparator.
+     *
+     * @param map Map applied to both left and right images during comparision.
+     */
+    public ColorImageComparator(ColorMap map) {
+        this(map, new StrictImageComparator());
+    }
+
+    /**
+     * Creates a comparator with
+     * <code>map</code> color mapping. Actual comparision perfomed by
+     * <code>comparator</code> parameter.
+     *
+     * @param map Map applied to both left and right images during comparision.
+     * @param subComparator comporator to perform a comparision of to images
+     * with mapped colors.
+     */
+    public ColorImageComparator(ColorMap map, ImageComparator subComparator) {
+        this(map, map, subComparator);
+    }
+
+    /**
+     * Creates a comparator with two color maps. Object created by this
+     * constructor behaves like
+     * <code>StrictImageComparator</code>. Object created works faster because
+     * it does not create intermediate images for another comparator.
+     *
+     * @param leftMap Map applied to the left image during comparision.
+     * @param rightMap Map applied to the right image during comparision.
+     */
+    public ColorImageComparator(ColorMap leftMap, ColorMap rightMap) {
+        this(leftMap, rightMap, new BufferedImageComparator(new PixelEqualityRasterComparator(0)));
+    }
+
+    /**
+     * Creates a comparator with two color maps. Actual comparision perfomed by
+     * <code>comparator</code> parameter.
+     *
+     * @param leftMap Map applied to the left image during comparision.
+     * @param rightMap Map applied to the right image during comparision.
+     * @param subComparator comporator to perform a comparision of to images
+     * with mapped colors.
+     */
+    public ColorImageComparator(ColorMap leftMap, ColorMap rightMap, ImageComparator subComparator) {
+        this.leftMap = leftMap;
+        this.rightMap = rightMap;
+        this.comparator = subComparator;
+    }
+
+    /**
+     * Compares images by
+     * <code>ImageComparator</code> passed into constructor, or itself if no
+     * <code>ImageComparator</code> was passed, processing both images by
+     * <code>ColorMap</code> instance before comparision.
+     */
+    @Override
+    public Image compare(Image image1, Image image2) {
+        return (comparator.compare(
+                recolor((AWTImage)image1, leftMap),
+                recolor((AWTImage)image2, rightMap)));
+    }
+
+    private AWTImage recolor(AWTImage isrc, ColorMap map) {
+        BufferedImage src = isrc.getTheImage();
+        BufferedImage result = new BufferedImage(src.getWidth(), src.getHeight(), src.getType());
+        for (int x = 0; x < src.getWidth(); x++) {
+            for (int y = 0; y < src.getWidth(); y++) {
+                result.setRGB(x, y, map.mapColor(src.getRGB(x, y)));
+            }
+        }
+        return new AWTImage(result);
+    }
+
+    protected final boolean compareColors(int rgb1, int rgb2) {
+        return (leftMap.mapColor(rgb1) == rightMap.mapColor(rgb2));
+    }
+
+    public String getID() {
+        return ColorImageComparator.class.getName();
+    }
+
+    /**
+     * Interface to map colors during the comparision.
+     */
+    public static interface ColorMap {
+
+        /**
+         * Maps one color into another.
+         *
+         * @param rgb an original color.
+         * @return a converted color.
+         */
+        public int mapColor(int rgb);
+    }
+
+    /**
+     * Turns
+     * <code>foreground</code> color to white, other - to black.
+     */
+    public static class ForegroundColorMap implements ColorMap {
+
+        int foreground;
+
+        /**
+         * Constructs a ColorImageComparator$ForegroundColorMap object.
+         *
+         * @param foreground Foreground color.
+         */
+        public ForegroundColorMap(int foreground) {
+            this.foreground = foreground;
+        }
+
+        public int mapColor(int rgb) {
+            return ((rgb == foreground) ? 0xffffff : 0);
+        }
+    }
+
+    /**
+     * Turns
+     * <code>background</code> color to black, left others unchanged.
+     */
+    public static class BackgroundColorMap implements ColorMap {
+
+        int background;
+
+        /**
+         * Constructs a ColorImageComparator$BackgroundColorMap object.
+         *
+         * @param background Background color.
+         */
+        public BackgroundColorMap(int background) {
+            this.background = background;
+        }
+
+        public int mapColor(int rgb) {
+            return ((rgb == background) ? 0 : rgb);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/DiffDialog.form	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,259 @@
+<!--
+Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation. Oracle designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Oracle in the LICENSE file that accompanied this code.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+ -->
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
+  <SyntheticProperties>
+    <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+  </SyntheticProperties>
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Component id="tbSplit" alignment="0" pref="549" max="32767" attributes="0"/>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Component id="tbSplit" alignment="0" pref="461" max="32767" attributes="0"/>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Container class="javax.swing.JSplitPane" name="tbSplit">
+      <Properties>
+        <Property name="dividerLocation" type="int" value="200"/>
+        <Property name="orientation" type="int" value="0"/>
+      </Properties>
+
+      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
+      <SubComponents>
+        <Container class="javax.swing.JSplitPane" name="lrSplit">
+          <Properties>
+            <Property name="dividerLocation" type="int" value="250"/>
+          </Properties>
+          <Constraints>
+            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+              <JSplitPaneConstraints position="top"/>
+            </Constraint>
+          </Constraints>
+
+          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
+          <SubComponents>
+            <Container class="javax.swing.JPanel" name="leftPane">
+              <Constraints>
+                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+                  <JSplitPaneConstraints position="left"/>
+                </Constraint>
+              </Constraints>
+
+              <Layout>
+                <DimensionLayout dim="0">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <EmptySpace min="0" pref="250" max="32767" attributes="0"/>
+                  </Group>
+                </DimensionLayout>
+                <DimensionLayout dim="1">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <EmptySpace min="0" pref="200" max="32767" attributes="0"/>
+                  </Group>
+                </DimensionLayout>
+              </Layout>
+            </Container>
+            <Container class="javax.swing.JPanel" name="rightPane">
+              <Constraints>
+                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+                  <JSplitPaneConstraints position="right"/>
+                </Constraint>
+              </Constraints>
+
+              <Layout>
+                <DimensionLayout dim="0">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <EmptySpace min="0" pref="293" max="32767" attributes="0"/>
+                  </Group>
+                </DimensionLayout>
+                <DimensionLayout dim="1">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <EmptySpace min="0" pref="200" max="32767" attributes="0"/>
+                  </Group>
+                </DimensionLayout>
+              </Layout>
+            </Container>
+          </SubComponents>
+        </Container>
+        <Container class="javax.swing.JSplitPane" name="dcSplit">
+          <Constraints>
+            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+              <JSplitPaneConstraints position="right"/>
+            </Constraint>
+          </Constraints>
+
+          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
+          <SubComponents>
+            <Container class="javax.swing.JPanel" name="diffPane">
+              <Constraints>
+                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+                  <JSplitPaneConstraints position="left"/>
+                </Constraint>
+              </Constraints>
+
+              <Layout>
+                <DimensionLayout dim="0">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <EmptySpace min="0" pref="100" max="32767" attributes="0"/>
+                  </Group>
+                </DimensionLayout>
+                <DimensionLayout dim="1">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <EmptySpace min="0" pref="255" max="32767" attributes="0"/>
+                  </Group>
+                </DimensionLayout>
+              </Layout>
+            </Container>
+            <Container class="javax.swing.JPanel" name="controlPane">
+              <Constraints>
+                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+                  <JSplitPaneConstraints position="right"/>
+                </Constraint>
+              </Constraints>
+
+              <Layout>
+                <DimensionLayout dim="0">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Group type="102" attributes="0">
+                          <EmptySpace pref="289" max="32767" attributes="0"/>
+                          <Group type="103" groupAlignment="0" attributes="0">
+                              <Group type="102" alignment="1" attributes="0">
+                                  <Component id="jButton6" min="-2" max="-2" attributes="0"/>
+                                  <EmptySpace max="-2" attributes="0"/>
+                                  <Component id="jButton7" min="-2" max="-2" attributes="0"/>
+                              </Group>
+                              <Group type="102" alignment="1" attributes="0">
+                                  <Component id="jButton1" min="-2" max="-2" attributes="0"/>
+                                  <EmptySpace max="-2" attributes="0"/>
+                                  <Component id="jButton2" min="-2" max="-2" attributes="0"/>
+                              </Group>
+                              <Component id="copyBtn" alignment="1" min="-2" max="-2" attributes="0"/>
+                              <Component id="removeBtn" alignment="1" min="-2" max="-2" attributes="0"/>
+                          </Group>
+                          <EmptySpace max="-2" attributes="0"/>
+                      </Group>
+                  </Group>
+                </DimensionLayout>
+                <DimensionLayout dim="1">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Group type="102" alignment="0" attributes="0">
+                          <EmptySpace max="-2" attributes="0"/>
+                          <Group type="103" groupAlignment="3" attributes="0">
+                              <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
+                              <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
+                          </Group>
+                          <EmptySpace max="-2" attributes="0"/>
+                          <Component id="copyBtn" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace max="-2" attributes="0"/>
+                          <Component id="removeBtn" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace pref="107" max="32767" attributes="0"/>
+                          <Group type="103" groupAlignment="3" attributes="0">
+                              <Component id="jButton7" alignment="3" min="-2" max="-2" attributes="0"/>
+                              <Component id="jButton6" alignment="3" min="-2" max="-2" attributes="0"/>
+                          </Group>
+                          <EmptySpace max="-2" attributes="0"/>
+                      </Group>
+                  </Group>
+                </DimensionLayout>
+              </Layout>
+              <SubComponents>
+                <Component class="javax.swing.JButton" name="jButton1">
+                  <Properties>
+                    <Property name="mnemonic" type="int" value="43"/>
+                    <Property name="text" type="java.lang.String" value="+"/>
+                  </Properties>
+                  <Events>
+                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
+                  </Events>
+                </Component>
+                <Component class="javax.swing.JButton" name="jButton2">
+                  <Properties>
+                    <Property name="mnemonic" type="int" value="45"/>
+                    <Property name="text" type="java.lang.String" value="-"/>
+                  </Properties>
+                  <Events>
+                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
+                  </Events>
+                </Component>
+                <Component class="javax.swing.JButton" name="copyBtn">
+                  <Properties>
+                    <Property name="text" type="java.lang.String" value="Copy to golgen"/>
+                    <Property name="enabled" type="boolean" value="false"/>
+                  </Properties>
+                  <Events>
+                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="copyBtnActionPerformed"/>
+                  </Events>
+                </Component>
+                <Component class="javax.swing.JButton" name="removeBtn">
+                  <Properties>
+                    <Property name="text" type="java.lang.String" value="Remove from golden"/>
+                    <Property name="enabled" type="boolean" value="false"/>
+                  </Properties>
+                  <Events>
+                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeBtnActionPerformed"/>
+                  </Events>
+                </Component>
+                <Component class="javax.swing.JButton" name="jButton6">
+                  <Properties>
+                    <Property name="text" type="java.lang.String" value="Next"/>
+                  </Properties>
+                  <Events>
+                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton6ActionPerformed"/>
+                  </Events>
+                </Component>
+                <Component class="javax.swing.JButton" name="jButton7">
+                  <Properties>
+                    <Property name="text" type="java.lang.String" value="Exit"/>
+                  </Properties>
+                  <Events>
+                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton7ActionPerformed"/>
+                  </Events>
+                </Component>
+              </SubComponents>
+            </Container>
+          </SubComponents>
+        </Container>
+      </SubComponents>
+    </Container>
+  </SubComponents>
+</Form>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/DiffDialog.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,395 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Toolkit;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.image.BufferedImage;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+/**
+ *
+ * @author shura
+ */
+public class DiffDialog extends javax.swing.JDialog {
+
+    private final static StrictImageComparator comparator = new StrictImageComparator();
+    private double scale = 1.0;
+    private int imageWidth, imageHeight, scaledWidth, scaledHeight;
+    private ImagePane left = null, right = null, diff = null;
+    int status = 0;
+
+    /** Creates new form ImageDiff */
+    DiffDialog() {
+        super((JDialog)null, true);
+        initComponents();
+        leftPane.setLayout(new BorderLayout());
+        leftPane.add(new JLabel("Golden"), BorderLayout.NORTH);
+        rightPane.setLayout(new BorderLayout());
+        rightPane.add(new JLabel("Result"), BorderLayout.NORTH);
+        diffPane.setLayout(new BorderLayout());
+        diffPane.add(new JLabel("Diff"), BorderLayout.NORTH);
+        getContentPane().addComponentListener(new ComponentListener() {
+
+            public void componentResized(ComponentEvent e) {
+                lrSplit.setDividerLocation(.5);
+                dcSplit.setDividerLocation(.5);
+                tbSplit.setDividerLocation(.5);
+            }
+
+            public void componentMoved(ComponentEvent e) {
+                throw new UnsupportedOperationException("Not supported yet.");
+            }
+
+            public void componentShown(ComponentEvent e) {
+                throw new UnsupportedOperationException("Not supported yet.");
+            }
+
+            public void componentHidden(ComponentEvent e) {
+                throw new UnsupportedOperationException("Not supported yet.");
+            }
+        });
+        setSize(400, 300);
+
+        // Get the size of the screen
+        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
+
+        // Determine the new location of the window
+        int w = getSize().width;
+        int h = getSize().height;
+        int x = (dim.width - w) / 2;
+        int y = (dim.height - h) / 2;
+
+        // Move the window
+        setLocation(x, y);
+    }
+
+    void setImages(BufferedImage leftImage, BufferedImage rightImage) {
+        if (leftImage != null && rightImage != null) {
+            copyBtn.setEnabled(true);
+            removeBtn.setEnabled(false);
+            imageWidth = leftImage.getWidth();
+            imageHeight = leftImage.getHeight();
+        } else {
+            if (leftImage == null) {
+                copyBtn.setEnabled(true);
+                removeBtn.setEnabled(false);
+                imageWidth = rightImage.getWidth();
+                imageHeight = rightImage.getHeight();
+            } else if (rightImage == null) {
+                copyBtn.setEnabled(false);
+                removeBtn.setEnabled(true);
+                imageWidth = leftImage.getWidth();
+                imageHeight = leftImage.getHeight();
+            }
+        }
+        if (left == null) {
+            left = new ImagePane(leftImage);
+        } else {
+            left.setImage(leftImage);
+        }
+        leftPane.add(left, BorderLayout.CENTER);
+        if (right == null) {
+            right = new ImagePane(rightImage);
+        } else {
+            right.setImage(rightImage);
+        }
+        rightPane.add(right, BorderLayout.CENTER);
+        if (diff == null) {
+            diff = new ImagePane(subtract(leftImage, rightImage));
+        } else {
+            diff.setImage(subtract(leftImage, rightImage));
+        }
+        diffPane.add(diff, BorderLayout.CENTER);
+        rescaleAll();
+    }
+
+    private BufferedImage subtract(BufferedImage left, BufferedImage right) {
+        if(left != null && right != null) {
+            return ImageTool.subtractImage(left, right);
+        } else {
+            return null;
+        }
+    }
+
+    /** This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    @SuppressWarnings("unchecked")
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+    private void initComponents() {
+
+        tbSplit = new javax.swing.JSplitPane();
+        lrSplit = new javax.swing.JSplitPane();
+        leftPane = new javax.swing.JPanel();
+        rightPane = new javax.swing.JPanel();
+        dcSplit = new javax.swing.JSplitPane();
+        diffPane = new javax.swing.JPanel();
+        controlPane = new javax.swing.JPanel();
+        jButton1 = new javax.swing.JButton();
+        jButton2 = new javax.swing.JButton();
+        copyBtn = new javax.swing.JButton();
+        removeBtn = new javax.swing.JButton();
+        jButton6 = new javax.swing.JButton();
+        jButton7 = new javax.swing.JButton();
+
+        tbSplit.setDividerLocation(200);
+        tbSplit.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
+
+        lrSplit.setDividerLocation(250);
+
+        javax.swing.GroupLayout leftPaneLayout = new javax.swing.GroupLayout(leftPane);
+        leftPane.setLayout(leftPaneLayout);
+        leftPaneLayout.setHorizontalGroup(
+            leftPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 250, Short.MAX_VALUE)
+        );
+        leftPaneLayout.setVerticalGroup(
+            leftPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 200, Short.MAX_VALUE)
+        );
+
+        lrSplit.setLeftComponent(leftPane);
+
+        javax.swing.GroupLayout rightPaneLayout = new javax.swing.GroupLayout(rightPane);
+        rightPane.setLayout(rightPaneLayout);
+        rightPaneLayout.setHorizontalGroup(
+            rightPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 293, Short.MAX_VALUE)
+        );
+        rightPaneLayout.setVerticalGroup(
+            rightPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 200, Short.MAX_VALUE)
+        );
+
+        lrSplit.setRightComponent(rightPane);
+
+        tbSplit.setTopComponent(lrSplit);
+
+        javax.swing.GroupLayout diffPaneLayout = new javax.swing.GroupLayout(diffPane);
+        diffPane.setLayout(diffPaneLayout);
+        diffPaneLayout.setHorizontalGroup(
+            diffPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 100, Short.MAX_VALUE)
+        );
+        diffPaneLayout.setVerticalGroup(
+            diffPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 255, Short.MAX_VALUE)
+        );
+
+        dcSplit.setLeftComponent(diffPane);
+
+        jButton1.setMnemonic('+');
+        jButton1.setText("+");
+        jButton1.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                jButton1ActionPerformed(evt);
+            }
+        });
+
+        jButton2.setMnemonic('-');
+        jButton2.setText("-");
+        jButton2.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                jButton2ActionPerformed(evt);
+            }
+        });
+
+        copyBtn.setText("Copy to golgen");
+        copyBtn.setEnabled(false);
+        copyBtn.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                copyBtnActionPerformed(evt);
+            }
+        });
+
+        removeBtn.setText("Remove from golden");
+        removeBtn.setEnabled(false);
+        removeBtn.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                removeBtnActionPerformed(evt);
+            }
+        });
+
+        jButton6.setText("Next");
+        jButton6.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                jButton6ActionPerformed(evt);
+            }
+        });
+
+        jButton7.setText("Exit");
+        jButton7.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                jButton7ActionPerformed(evt);
+            }
+        });
+
+        javax.swing.GroupLayout controlPaneLayout = new javax.swing.GroupLayout(controlPane);
+        controlPane.setLayout(controlPaneLayout);
+        controlPaneLayout.setHorizontalGroup(
+            controlPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(controlPaneLayout.createSequentialGroup()
+                .addContainerGap(289, Short.MAX_VALUE)
+                .addGroup(controlPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, controlPaneLayout.createSequentialGroup()
+                        .addComponent(jButton6)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                        .addComponent(jButton7))
+                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, controlPaneLayout.createSequentialGroup()
+                        .addComponent(jButton1)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                        .addComponent(jButton2))
+                    .addComponent(copyBtn, javax.swing.GroupLayout.Alignment.TRAILING)
+                    .addComponent(removeBtn, javax.swing.GroupLayout.Alignment.TRAILING))
+                .addContainerGap())
+        );
+        controlPaneLayout.setVerticalGroup(
+            controlPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(controlPaneLayout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(controlPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(jButton1)
+                    .addComponent(jButton2))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(copyBtn)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(removeBtn)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 107, Short.MAX_VALUE)
+                .addGroup(controlPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(jButton7)
+                    .addComponent(jButton6))
+                .addContainerGap())
+        );
+
+        dcSplit.setRightComponent(controlPane);
+
+        tbSplit.setRightComponent(dcSplit);
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+        getContentPane().setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addComponent(tbSplit, javax.swing.GroupLayout.DEFAULT_SIZE, 549, Short.MAX_VALUE)
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addComponent(tbSplit, javax.swing.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)
+        );
+
+        pack();
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
+        scale *= .9;
+        rescaleAll();
+    }//GEN-LAST:event_jButton2ActionPerformed
+
+    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
+        scale *= 1.1;
+        rescaleAll();
+    }//GEN-LAST:event_jButton1ActionPerformed
+
+    private void rescaleAll() {
+        scaledWidth = (int) (imageWidth * scale);
+        scaledHeight = (int) (imageHeight * scale);
+        left.reScale();
+        right.reScale();
+        diff.reScale();
+        getContentPane().repaint();
+    }
+
+    private void copyBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copyBtnActionPerformed
+        status = -1;
+        setVisible(false);
+    }//GEN-LAST:event_copyBtnActionPerformed
+
+    private void removeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeBtnActionPerformed
+        status = 1;
+        setVisible(false);
+    }//GEN-LAST:event_removeBtnActionPerformed
+
+    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
+        setVisible(false);
+    }//GEN-LAST:event_jButton6ActionPerformed
+
+    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
+        status = -2;
+        setVisible(false);
+    }//GEN-LAST:event_jButton7ActionPerformed
+
+    private class ImagePane extends JPanel {
+
+        BufferedImage img;
+        java.awt.Image scaled;
+
+        public ImagePane(BufferedImage img) {
+            this.img = img;
+        }
+
+        @Override
+        protected void paintComponent(Graphics g) {
+            if (img != null) {
+                g.drawImage(scaled, 0, 0, this);
+            } else {
+                super.paintComponent(g);
+            }
+        }
+
+        void setImage(BufferedImage img) {
+            this.img = img;
+            reScale();
+        }
+
+        void reScale() {
+            if (img != null) {
+                    scaled = img.getScaledInstance(scaledWidth, scaledHeight, java.awt.Image.SCALE_DEFAULT);
+            }
+        }
+    }
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JPanel controlPane;
+    private javax.swing.JButton copyBtn;
+    private javax.swing.JSplitPane dcSplit;
+    private javax.swing.JPanel diffPane;
+    private javax.swing.JButton jButton1;
+    private javax.swing.JButton jButton2;
+    private javax.swing.JButton jButton6;
+    private javax.swing.JButton jButton7;
+    private javax.swing.JPanel leftPane;
+    private javax.swing.JSplitPane lrSplit;
+    private javax.swing.JButton removeBtn;
+    private javax.swing.JPanel rightPane;
+    private javax.swing.JSplitPane tbSplit;
+    // End of variables declaration//GEN-END:variables
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/FilesystemImageLoader.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+
+import java.io.File;
+import org.jemmy.env.Environment;
+import org.jemmy.image.Image;
+import org.jemmy.image.ImageLoader;
+
+
+/**
+ * This is an implementation of ImageLoader which loads images from filesystem.
+ * @author mrkam
+ */
+public class FilesystemImageLoader implements ImageLoader {
+
+    private File imageRoot = null;
+
+    public static final String OUTPUT = AWTImage.class.getName() + ".OUTPUT";
+
+    public File getImageRoot() {
+        return imageRoot;
+    }
+
+    public Image load(String ID) {
+        String fullPath = ID + (ID.toLowerCase().endsWith(AWTImage.PNG_FILE) ? "" :
+                AWTImage.PNG_FILE);
+        if (imageRoot != null) {
+            fullPath = imageRoot.getAbsolutePath() + File.separator + ID;
+        }
+        Environment.getEnvironment().getOutput(FilesystemImageLoader.OUTPUT).println("Image loaded from " + fullPath);
+        return new AWTImage(PNGDecoder.decode(fullPath));
+    }
+
+    public void setImageRoot(File imageRoot) {
+        this.imageRoot = imageRoot;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/ImageFinder.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import org.jemmy.Point;
+
+import java.awt.image.BufferedImage;
+
+/**
+ * Interface for all classes performing image lookup.
+ *
+ * @author Alexandre Iline (alexandre.iline@sun.com)
+ */
+public interface ImageFinder {
+
+    /**
+     * Should return location if image lays inside an image represented by this object.
+     * @param image an image to search.
+     * @param index an ordinal image location index. If equal to 1, for example,
+     * second appropriate location will be found.
+     * @return Image location coordinates if image was found, null otherwise.
+     */
+    public Point findImage(BufferedImage image, int index);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/ImageTool.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import javax.imageio.ImageIO;
+
+
+/**
+ * Contains util methods to work with images.
+ *
+ * @author Alexandre Iline (alexandre.iline@sun.com)
+ */
+class ImageTool {
+
+    /**
+     * Increases image.
+     * @param image an image to enlarge.
+     * @param zoom A scale.
+     * @return a result image.
+     */
+    public static BufferedImage enlargeImage(BufferedImage image, int zoom) {
+        int wight = image.getWidth();
+        int height = image.getHeight();
+        BufferedImage result = new BufferedImage(wight * zoom,
+                height * zoom,
+                image.getType());
+        int rgb;
+        for (int x = 0; x < wight; x++) {
+            for (int y = 0; y < height; y++) {
+                rgb = image.getRGB(x, y);
+                for (int i = 0; i < zoom; i++) {
+                    for (int j = 0; j < zoom; j++) {
+                        result.setRGB(x * zoom + i,
+                                y * zoom + j,
+                                rgb);
+                    }
+                }
+            }
+        }
+        return (result);
+    }
+
+    /**
+     * Subtracts second image from first one.
+     * Could be used to save file difference for future analysis.
+     * @param minuend an image to subtract from.
+     * @param deduction an image to subtract.
+     * @return a result image.
+     */
+    public static BufferedImage subtractImage(BufferedImage minuend, BufferedImage deduction) {
+        return (subtractImage(minuend, deduction, 0, 0, null));
+    }
+
+    /**
+     * Subtracts second image from first one.
+     * Could be used to save file difference for future analysis.
+     * @param minuend an image to subtract from.
+     * @param deduction an image to subtract.
+     * @param highlight - a color to highlight the difference. If null,
+     * color difference is shown.
+     * @return a result image.
+     */
+    public static BufferedImage subtractImage(BufferedImage minuend, BufferedImage deduction, Color highlight) {
+        return (subtractImage(minuend, deduction, 0, 0, highlight));
+    }
+
+    /**
+     * Subtracts subimage from image.
+     * Could be used to save file difference for future analysis.
+     * @param minuend an image to subtract from.
+     * @param deduction an image to subtract.
+     * @param relativeX - deduction-in-minuend X coordinate
+     * @param relativeY - deduction-in-minuend Y coordinate
+     * @return a result image.
+     */
+    public static BufferedImage subtractImage(BufferedImage minuend, BufferedImage deduction, int relativeX, int relativeY) {
+        return subtractImage(minuend, deduction, relativeX, relativeY, null);
+    }
+
+    /**
+     * Subtracts subimage from image.
+     * Could be used to save file difference for future analysis.
+     * @param minuend an image to subtract from.
+     * @param deduction an image to subtract.
+     * @param relativeX - deduction-in-minuend X coordinate
+     * @param relativeY - deduction-in-minuend Y coordinate
+     * @param highlight - a color to highlight the difference. If null,
+     * color difference is shown.
+     * @return a result image.
+     */
+    public static BufferedImage subtractImage(BufferedImage minuend, BufferedImage deduction, int relativeX, int relativeY, Color highlight) {
+        int mWidth = minuend.getWidth();
+        int mHeight = minuend.getHeight();
+        int dWidth = deduction.getWidth();
+        int dHeight = deduction.getHeight();
+
+        int maxWidth = (mWidth > relativeX + dWidth) ? mWidth : (relativeX + dWidth);
+        int maxHeight = (mHeight > relativeY + dHeight) ? mHeight : (relativeY + dHeight);
+
+        BufferedImage result = new BufferedImage(maxWidth, maxHeight, BufferedImage.TYPE_INT_RGB);
+        int mColor, dColor;
+        for (int x = 0; x < maxWidth; x++) {
+            for (int y = 0; y < maxHeight; y++) {
+                if (x >= mWidth ||
+                        y >= mHeight) {
+                    mColor = 0;
+                } else {
+                    mColor = minuend.getRGB(x, y);
+                }
+                if (x >= dWidth + relativeX ||
+                        y >= dHeight + relativeY ||
+                        x < relativeX ||
+                        y < relativeY) {
+                    dColor = 0;
+                } else {
+                    dColor = deduction.getRGB(x - relativeX, y - relativeY);
+                }
+                result.setRGB(x, y, (mColor != dColor) ? subtractColor((highlight != null) ? highlight.getRGB() : 0, mColor, dColor) : 0);
+            }
+        }
+        return (result);
+    }
+
+    public static double distance(int rgb1, int rgb2) {
+        float [] buffer1 = new float[3];
+        float [] buffer2 = new float[3];
+        Color c1 = new Color(rgb1);
+        Color c2 = new Color(rgb2);
+        c1.getRGBColorComponents(buffer1);
+        c2.getRGBColorComponents(buffer2);
+        double distSquare = 0;
+        for (int i = 0; i < 3; i++) {
+            distSquare += (buffer1[i] - buffer2[i]) * (buffer1[i] - buffer2[i]);
+        }
+        return Math.sqrt(distSquare);
+    }
+
+    private static int subtractColor(int highlight, int m, int d) {
+        if (highlight == 0) {
+            float scale = (float) (distance(m, d) / Math.sqrt(3));
+            return new Color(scale, scale, scale).getRGB();
+        } else {
+            return highlight;
+        }
+    }
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) throws IOException {
+        if (args.length != 2) {
+            usage();
+            System.exit(1);
+        }
+        compare(new File(args[0]).getAbsoluteFile(), new File(args[1]).getAbsoluteFile());
+    }
+
+    private static void compare(File golden, File results) throws IOException {
+        if (golden.isDirectory()) {
+            File rfl;
+            for (File fl : golden.listFiles()) {
+                compare(fl, new File(results.getAbsolutePath() + File.separator + fl.getName()));
+            }
+            for (File fl : results.listFiles()) {
+                rfl = new File(golden.getAbsolutePath() + File.separator + fl.getName());
+                if (!rfl.exists()) {
+                    compare(rfl, fl);
+                }
+            }
+        } else {
+            DiffDialog dialog = new DiffDialog();
+            dialog.setImages(golden.exists() ? ImageIO.read(golden) : null, results.exists() ? ImageIO.read(results) : null);
+            dialog.setVisible(true);
+            switch (dialog.status) {
+                case -2:
+                    System.exit(0);
+                case -1:
+                    copy(results, golden);
+                    break;
+                case 1:
+                    golden.delete();
+                    break;
+            }
+        }
+    }
+
+    private static void usage() {
+        System.out.println("java -jar JemmyAWTInput.jar <golden image set> <test result image set>");
+    }
+
+    private static void copy(File results, File golden) throws FileNotFoundException, IOException {
+        if (golden.exists()) {
+            golden.delete();
+        }
+        FileInputStream from = new FileInputStream(results);
+        FileOutputStream to = new FileOutputStream(golden);
+        byte[] buffer = new byte[4096];
+        int bytesRead;
+
+        while ((bytesRead = from.read(buffer)) != -1) {
+            to.write(buffer, 0, bytesRead); // write
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/NaturalImageComparator.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+
+import org.jemmy.image.pixel.MaxDistanceComparator;
+
+
+/**
+ * Compares two images naturally
+ * (i.e. ignoring slight difference between pixel colors).
+ *
+ * @author KAM
+ */
+public class NaturalImageComparator extends BufferedImageComparator {
+
+    /**
+     * Creates comparator with the default sensitivity value = 0.02
+     * (around 5 in 0-255 color component value).
+     * @see #NaturalImageComparator(double)
+     */
+    public NaturalImageComparator() {
+        this(0.02);
+    }
+
+    /**
+     * Creates comparator with the specified sensitivity value
+     * @param sensitivity Maximum threshold for 3-D distance between colors
+     * in 3-D sRGB color space for pixels to be considered equal.
+     * Meaningful values are between 0 and approx 1.733. 0 means colors should
+     * be equal to pass the comparison, 1.733 (which is more than square root
+     * of 3) means that comparison will be passed even if the colors are
+     * completely different.
+     */
+    public NaturalImageComparator(double sensitivity) {
+        super(new MaxDistanceComparator(sensitivity));
+    }
+    public void setSensitivity(double sensitivity) {
+        ((MaxDistanceComparator)getRasterComparator()).setThreshold(sensitivity);
+    }
+    public double getSensitivity() {
+        return ((MaxDistanceComparator)getRasterComparator()).getThreshold();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/PNGDecoder.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,271 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import java.awt.Color;
+
+import java.awt.image.BufferedImage;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.FileInputStream;
+
+import org.jemmy.JemmyException;
+
+import java.util.zip.DataFormatException;
+import java.util.zip.Inflater;
+
+/**
+ * Allows to load PNG graphical file.
+ * @author Alexandre Iline
+ */
+public class PNGDecoder extends Object {
+
+    InputStream in;
+
+    /**
+     * Constructs a PNGDecoder object.
+     * @param in input stream to read PNG image from.
+     */
+    public PNGDecoder(InputStream in) {
+        this.in = in;
+    }
+
+    byte read() throws IOException {
+        byte b = (byte)in.read();
+        return(b);
+    }
+
+    int readInt() throws IOException {
+        byte b[] = read(4);
+        return(((b[0]&0xff)<<24) +
+               ((b[1]&0xff)<<16) +
+               ((b[2]&0xff)<<8) +
+               ((b[3]&0xff)));
+    }
+
+    byte[] read(int count) throws IOException {
+        byte[] result = new byte[count];
+        for(int i = 0; i < count; i++) {
+            result[i] = read();
+        }
+        return(result);
+    }
+
+    boolean compare(byte[] b1, byte[] b2) {
+        if(b1.length != b2.length) {
+            return(false);
+        }
+        for(int i = 0; i < b1.length; i++) {
+            if(b1[i] != b2[i]) {
+                return(false);
+            }
+        }
+        return(true);
+    }
+
+    void checkEquality(byte[] b1, byte[] b2) {
+        if(!compare(b1, b2)) {
+            throw(new JemmyException("Format error"));
+        }
+    }
+
+    /**
+     * Decodes image from an input stream passed into constructor.
+     * @return a BufferedImage object
+     * @throws IOException todo document
+     */
+    public BufferedImage decode() throws IOException {
+        return decode(true);
+    }
+
+    /**
+     * Decodes image from an input stream passed into constructor.
+     * @return a BufferedImage object
+     * @param closeStream requests method to close the stream after the image is read
+     * @throws IOException todo document
+     */
+    public BufferedImage decode(boolean closeStream) throws IOException {
+
+        byte[] id = read(12);
+        checkEquality(id, new byte[] {-119, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13});
+
+        byte[] ihdr = read(4);
+        checkEquality(ihdr, "IHDR".getBytes());
+
+        int width = readInt();
+        int height = readInt();
+
+        BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+
+        byte[] head = read(5);
+        int mode;
+        if(compare(head, new byte[]{1, 0, 0, 0, 0})) {
+            mode = PNGEncoder.BW_MODE;
+        } else if(compare(head, new byte[]{8, 0, 0, 0, 0})) {
+            mode = PNGEncoder.GREYSCALE_MODE;
+        } else if(compare(head, new byte[]{8, 2, 0, 0, 0})) {
+            mode = PNGEncoder.COLOR_MODE;
+        } else {
+            throw(new JemmyException("Format error"));
+        }
+
+        readInt();//!!crc
+
+        int size = readInt();
+
+        byte[] idat = read(4);
+        checkEquality(idat, "IDAT".getBytes());
+
+        byte[] data = read(size);
+
+
+        Inflater inflater = new Inflater();
+        inflater.setInput(data, 0, size);
+
+        int color;
+
+        try {
+            switch (mode) {
+            case PNGEncoder.BW_MODE:
+                {
+                    int bytes = (int)(width / 8);
+                    if((width % 8) != 0) {
+                        bytes++;
+                    }
+                    byte colorset;
+                    byte[] row = new byte[bytes];
+                    for (int y = 0; y < height; y++) {
+                        inflater.inflate(new byte[1]);
+                        inflater.inflate(row);
+                        for (int x = 0; x < bytes; x++) {
+                            colorset = row[x];
+                            for (int sh = 0; sh < 8; sh++) {
+                                if(x * 8 + sh >= width) {
+                                    break;
+                                }
+                                if((colorset & 0x80) == 0x80) {
+                                    result.setRGB(x * 8 + sh, y, Color.white.getRGB());
+                                } else {
+                                    result.setRGB(x * 8 + sh, y, Color.black.getRGB());
+                                }
+                                colorset <<= 1;
+                            }
+                        }
+                    }
+                }
+                break;
+            case PNGEncoder.GREYSCALE_MODE:
+                {
+                    byte[] row = new byte[width];
+                    for (int y = 0; y < height; y++) {
+                        inflater.inflate(new byte[1]);
+                        inflater.inflate(row);
+                        for (int x = 0; x < width; x++) {
+                            color = row[x];
+                            result.setRGB(x, y, (color << 16) + (color << 8) + color);
+                        }
+                    }
+                }
+                break;
+            case PNGEncoder.COLOR_MODE:
+                {
+                    byte[] row = new byte[width * 3];
+                    for (int y = 0; y < height; y++) {
+                        inflater.inflate(new byte[1]);
+                        inflater.inflate(row);
+                        for (int x = 0; x < width; x++) {
+                            result.setRGB(x, y,
+                                          ((row[x * 3 + 0]&0xff) << 16) +
+                                          ((row[x * 3 + 1]&0xff) << 8) +
+                                          ((row[x * 3 + 2]&0xff)));
+                        }
+                    }
+                }
+            }
+        } catch(DataFormatException e) {
+            throw(new JemmyException("ZIP error", e));
+        }
+
+        readInt();//!!crc
+        readInt();//0
+
+        byte[] iend = read(4);
+        checkEquality(iend, "IEND".getBytes());
+
+        readInt();//!!crc
+        if (closeStream) {
+            in.close();
+        }
+
+        return(result);
+    }
+
+    /**
+     * Decodes image from file.
+     * @param fileName a file to read image from
+     * @return a BufferedImage instance.
+     */
+    public static BufferedImage decode(String fileName) {
+        try {
+            return(new PNGDecoder(new FileInputStream(fileName)).decode());
+        } catch(IOException e) {
+            throw(new JemmyException("IOException during image reading", e));
+        }
+    }
+
+    /**
+     * Decodes image from input stream
+     * @param inputStream a file to read image from
+     * @param closeStream requests method to close the stream after the image is read
+     * @return a BufferedImage instance.
+     */
+    public static BufferedImage decode(InputStream inputStream, boolean closeStream) {
+        try {
+            return(new PNGDecoder(inputStream).decode(closeStream));
+        } catch(IOException e) {
+            throw(new JemmyException("IOException during image reading", e));
+        }
+    }
+
+    /**
+     * Decodes image from resource.
+     * @param loader ClassLoader to use to get the resource
+     * @param resource Image resource name
+     * @return a BufferedImage instance.
+     */
+    public static BufferedImage decode(ClassLoader loader, String resource) {
+        try {
+            InputStream resourceStream = loader.getResourceAsStream(resource);
+            if (resourceStream == null) {
+                throw new JemmyException("Resouce '" + resource + "' could not be found!");
+            }
+            return(new PNGDecoder(resourceStream).decode());
+        } catch(IOException e) {
+            throw(new JemmyException("IOException during image reading", e));
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/PNGEncoder.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,263 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import java.awt.AWTException;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+
+import java.awt.image.BufferedImage;
+
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+
+import java.util.zip.CRC32;
+import java.util.zip.Deflater;
+import java.util.zip.DeflaterOutputStream;
+import org.jemmy.control.ScreenArea;
+
+/**
+ * This class allows to encode BufferedImage into B/W, greyscale or true color PNG
+ * image format with maximum compression.<br>
+ * It also provides complete functionality for capturing full screen, part of
+ * screen or single component, encoding and saving captured image info PNG file.
+ * @author Adam Sotona
+ * @version 1.0
+ */
+public class PNGEncoder extends Object {
+
+    /** black and white image mode. */
+    public static final byte BW_MODE = 0;
+    /** grey scale image mode. */
+    public static final byte GREYSCALE_MODE = 1;
+    /** full color image mode. */
+    public static final byte COLOR_MODE = 2;
+
+    OutputStream out;
+    CRC32 crc;
+    byte mode;
+
+    public PNGEncoder(File file) throws FileNotFoundException {
+        this(new FileOutputStream(file));
+    }
+    /** public constructor of PNGEncoder class with greyscale mode by default.
+     * @param out output stream for PNG image format to write into
+     */
+    public PNGEncoder(OutputStream out) {
+        this(out, GREYSCALE_MODE);
+    }
+
+    /** public constructor of PNGEncoder class.
+     * @param out output stream for PNG image format to write into
+     * @param mode BW_MODE, GREYSCALE_MODE or COLOR_MODE
+     */
+    public PNGEncoder(OutputStream out, byte mode) {
+        crc=new CRC32();
+        this.out = out;
+        if (mode<0 || mode>2)
+            throw new IllegalArgumentException("Unknown color mode");
+        this.mode = mode;
+    }
+
+    void write(int i) throws IOException {
+        byte b[]={(byte)((i>>24)&0xff),(byte)((i>>16)&0xff),(byte)((i>>8)&0xff),(byte)(i&0xff)};
+        write(b);
+    }
+
+    void write(byte b[]) throws IOException {
+        out.write(b);
+        crc.update(b);
+    }
+
+    /** main encoding method (stays blocked till encoding is finished).
+     * @param image BufferedImage to encode
+     * @throws IOException IOException
+     */
+    public void encode(BufferedImage image) throws IOException {
+        encode(image, true);
+    }
+
+    /** main encoding method (stays blocked till encoding is finished).
+     * @param image BufferedImage to encode
+     * @param closeStream requests method to close the stream after the image is written
+     * @throws IOException IOException
+     */
+    public void encode(BufferedImage image, boolean closeStream) throws IOException {
+        int width = image.getWidth(null);
+        int height = image.getHeight(null);
+        final byte id[] = {-119, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13};
+        write(id);
+        crc.reset();
+        write("IHDR".getBytes());
+        write(width);
+        write(height);
+        byte head[]=null;
+        switch (mode) {
+            case BW_MODE: head=new byte[]{1, 0, 0, 0, 0}; break;
+            case GREYSCALE_MODE: head=new byte[]{8, 0, 0, 0, 0}; break;
+            case COLOR_MODE: head=new byte[]{8, 2, 0, 0, 0}; break;
+        }
+        write(head);
+        write((int) crc.getValue());
+        ByteArrayOutputStream compressed = new ByteArrayOutputStream(65536);
+        BufferedOutputStream bos = new BufferedOutputStream( new DeflaterOutputStream(compressed, new Deflater(9)));
+        int pixel;
+        int color;
+        int colorset;
+        switch (mode) {
+            case BW_MODE:
+                int rest=width%8;
+                int bytes=width/8;
+                for (int y=0;y<height;y++) {
+                    bos.write(0);
+                    for (int x=0;x<bytes;x++) {
+                        colorset=0;
+                        for (int sh=0; sh<8; sh++) {
+                            pixel=image.getRGB(x*8+sh,y);
+                            color=((pixel >> 16) & 0xff);
+                            color+=((pixel >> 8) & 0xff);
+                            color+=(pixel & 0xff);
+                            colorset<<=1;
+                            if (color>=3*128)
+                                colorset|=1;
+                        }
+                        bos.write((byte)colorset);
+                    }
+                    if (rest>0) {
+                        colorset=0;
+                        for (int sh=0; sh<width%8; sh++) {
+                            pixel=image.getRGB(bytes*8+sh,y);
+                            color=((pixel >> 16) & 0xff);
+                            color+=((pixel >> 8) & 0xff);
+                            color+=(pixel & 0xff);
+                            colorset<<=1;
+                            if (color>=3*128)
+                                colorset|=1;
+                        }
+                        colorset<<=8-rest;
+                        bos.write((byte)colorset);
+                    }
+                }
+                break;
+            case GREYSCALE_MODE:
+                for (int y=0;y<height;y++) {
+                    bos.write(0);
+                    for (int x=0;x<width;x++) {
+                        pixel=image.getRGB(x,y);
+                        color=((pixel >> 16) & 0xff);
+                        color+=((pixel >> 8) & 0xff);
+                        color+=(pixel & 0xff);
+                        bos.write((byte)(color/3));
+                    }
+                }
+                break;
+             case COLOR_MODE:
+                for (int y=0;y<height;y++) {
+                    bos.write(0);
+                    for (int x=0;x<width;x++) {
+                        pixel=image.getRGB(x,y);
+                        bos.write((byte)((pixel >> 16) & 0xff));
+                        bos.write((byte)((pixel >> 8) & 0xff));
+                        bos.write((byte)(pixel & 0xff));
+                    }
+                }
+                break;
+        }
+        bos.close();
+        write(compressed.size());
+        crc.reset();
+        write("IDAT".getBytes());
+        write(compressed.toByteArray());
+        write((int) crc.getValue());
+        write(0);
+        crc.reset();
+        write("IEND".getBytes());
+        write((int) crc.getValue());
+        out.flush();
+        if (closeStream) {
+            out.close();
+        }
+    }
+
+    /** Static method performing screen capture into PNG image format file with given fileName.
+     * @param rect Rectangle of screen to be captured
+     * @param fileName file name for screen capture PNG image file */
+    public static void captureScreen(Rectangle rect, String fileName) {
+        captureScreen(rect, fileName, GREYSCALE_MODE);
+    }
+
+    /** Static method performing screen capture into PNG image format file with given fileName.
+     * @param rect Rectangle of screen to be captured
+     * @param mode image color mode
+     * @param fileName file name for screen capture PNG image file */
+    public static void captureScreen(Rectangle rect, String fileName, byte mode) {
+        try {
+            BufferedImage capture=new Robot().createScreenCapture(rect);
+            BufferedOutputStream file=new BufferedOutputStream(new FileOutputStream(fileName));
+            PNGEncoder encoder=new PNGEncoder(file, mode);
+            encoder.encode(capture);
+        } catch (AWTException awte) {
+            awte.printStackTrace();
+        } catch (IOException ioe) {
+            ioe.printStackTrace();
+        }
+    }
+
+     /** Static method performing one component screen capture into PNG image format file with given fileName.
+      * @param comp Component to be captured
+      * @param fileName String image target filename */
+    public static void captureScreen(ScreenArea comp, String fileName) {
+        captureScreen(comp, fileName, GREYSCALE_MODE);
+    }
+
+    /** Static method performing one component screen capture into PNG image format file with given fileName.
+     * @param comp Component to be captured
+     * @param fileName String image target filename
+     * @param mode image color mode */
+    public static void captureScreen(ScreenArea comp, String fileName, byte mode) {
+        captureScreen(Utils.convert(comp.getScreenBounds()),
+            fileName, mode);
+    }
+
+
+    /** Static method performing whole screen capture into PNG image format file with given fileName.
+     * @param fileName String image target filename */
+    public static void captureScreen(String fileName) {
+        captureScreen(fileName, GREYSCALE_MODE);
+    }
+
+    /** Static method performing whole screen capture into PNG image format file with given fileName.
+     * @param fileName String image target filename
+     * @param mode image color mode */
+    public static void captureScreen(String fileName, byte mode) {
+        captureScreen(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()), fileName, mode);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/PNGImageLoader.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import java.awt.image.BufferedImage;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+
+/**
+ * Allowes to process PNF image format.
+ *
+ * @author Alexandre Iline (alexandre.iline@sun.com)
+ */
+class PNGImageLoader {
+
+    /**
+     * Loads an image from a PNG image file.
+     * @param in
+     * @throws IOException
+     */
+    public BufferedImage load(InputStream in) throws IOException {
+        return(new PNGDecoder(in).decode());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/PNGImageSaver.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import java.awt.image.BufferedImage;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+
+/**
+ * Allows to process PNG image format.
+ *
+ * @author Alexandre Iline (alexandre.iline@sun.com)
+ */
+class PNGImageSaver {
+
+    /**
+     * Saves an image into a PNG image file.
+     * @throws IOException
+     */
+    public void save(BufferedImage image, String fileName) throws IOException{
+        File f = new File(fileName);
+        File parent = f.getParentFile();
+        if (parent != null) {
+            parent.mkdirs();
+        }
+        new PNGEncoder(new BufferedOutputStream(new FileOutputStream(f)),
+                       PNGEncoder.COLOR_MODE).encode(image);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/ResizeImageComparator.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import org.jemmy.Dimension;
+import org.jemmy.env.Environment;
+import org.jemmy.env.TestOut;
+import org.jemmy.image.Image;
+import org.jemmy.image.ImageComparator;
+import org.jemmy.image.pixel.ResizeComparator;
+
+/**
+ * Comparator that makes image sizes equal to compare them with other comparator
+ * most of them work only for the images with equal dimensions.
+ *
+ * It is controlled by three parameters:
+ * <p>
+ * Resize Mode - defines way of resizing images that are being compared. One of the following constants:
+ * <ul>
+*     <li>{@linkplain ResizeMode#NO_RESIZE NO_RESIZE},</li>
+*     <li>{@linkplain ResizeMode#PROPORTIONAL_RESIZE PROPORTIONAL_RESIZE},</li>
+*     <li>{@linkplain ResizeMode#ARBITRARY_RESIZE ARBITRARY_RESIZE}.</li>
+ * </ul>
+ *
+ * Default value is {@linkplain ResizeMode#PROPORTIONAL_RESIZE}.
+ * <ul>
+ * <li>Resize Hint - defines the way of images scaling that is specified when
+ * {@linkplain java.awt.Image#getScaledInstance(int, int, int) Image.getScaledInstance()} method is invoked.
+ * One of the Image.SCALE_XXX is expected. Default value is {@linkplain java.awt.Image#SCALE_DEFAULT SCALE_DEFAULT}.</li>
+ * <li>Proportion Distortion Threshold - defines maximum proportion distortion that is used in
+ * {@linkplain ResizeMode#PROPORTIONAL_RESIZE PROPORTIONAL_RESIZE} mode to deal with cases when rounding and other
+ * problems could cause sizes to be not ideally proportional.
+ * <p>
+ * Threshold value is applied in the following way: {@code Math.abs(image.getSize() * scale
+ * - size) / image.getSize() > PROPORTION_DISTORTION_THRESHOLD}, where {@code image.getSize()}
+ * is both image dimensions and {@code size} is target width and height (which
+ * is defined as mininum of sizes of two images) and scale is the scale factor
+ * that scales the particular image to fit the width and height.
+ * <p>
+ * Default value is 0.02 so as much as 2% of width/height could differ (around 5
+ * in 0-255 color component values).</li>
+ * </ul>
+ *
+ * @author mrkam
+ */
+public class ResizeImageComparator extends ResizeComparator {
+
+    /**
+     * Identifies output where resize details are printed. Output is disabled
+     * by default.
+     *
+     * @see Environment#getOutput(java.lang.String)
+     */
+    public static final String OUTPUT = ResizeImageComparator.class.getName()
+            + ".OUTPUT";
+
+    static {
+        Environment.getEnvironment().setOutput(OUTPUT, TestOut.getNullOutput());
+    }
+    ResizeMode resizeMode;
+    int hint;
+    double propDistThreshold;
+
+    /**
+     * Resize Modes
+     *
+     * @see ResizeImageComparator#ResizeImageComparator(ResizeMode, ImageComparator)
+     * @see ResizeImageComparator#ResizeImageComparator(ResizeMode, double, int, ImageComparator)
+     */
+    public static enum ResizeMode {
+
+        /**
+         * Images are never resized. Original images are always compared.
+         */
+        NO_RESIZE,
+        /**
+         * Images are resized only if they have exactly or almost proportional
+         * sizes which is controlled by {@code proportionDistortion} parameter.
+         * If images have different proportions no resize is done and original
+         * images are compared.
+         *
+         * @see ResizeImageComparator#ResizeImageComparator(ResizeMode, ImageComparator)
+         */
+        PROPORTIONAL_RESIZE,
+        /**
+         * Images are always resized to match both width and height and then
+         * compared.
+         */
+        ARBITRARY_RESIZE
+    }
+
+    /**
+     * Creates ResizeImageComparator with default resize settings:
+     * <ul>
+     * <li>resize mode: {@linkplain ResizeMode#PROPORTIONAL_RESIZE ResizeMode.PROPORTIONAL_RESIZE}.</li>
+     * <li>proportion distortion threshold: 0.02.</li>
+     * <li>resize hint: {@linkplain java.awt.Image#SCALE_DEFAULT Image.SCALE_DEFAULT}.</li>
+     * </ul>
+     *
+     * @param subComparator comparator to compare images after resize.
+     * @see java.awt.Image#getScaledInstance(int, int, int)
+     * @see ResizeMode
+     * @see ResizeImageComparator
+     */
+    public ResizeImageComparator(ImageComparator subComparator) {
+        super(subComparator, ResizeComparator.Mode.LEFT);
+        this.resizeMode = ResizeMode.PROPORTIONAL_RESIZE;
+        this.hint = java.awt.Image.SCALE_DEFAULT;
+        this.propDistThreshold = 0.02;
+    }
+
+    /**
+     * Creates ResizeImageComparator with the specified resize mode and default
+     * settings for other parameters:
+     * <ul>
+     * <li>proportion distortion threshold: 0.02.</li>
+     * <li>resize hint: {@linkplain java.awt.Image#SCALE_DEFAULT Image.SCALE_DEFAULT}.</li>
+     * </ul>
+     *
+     * @param resizeMode resize mode for this comparator.
+     * @param subComparator comparator to compare images after resize.
+     * @see ResizeMode
+     * @see ResizeImageComparator
+     */
+    public ResizeImageComparator(ResizeMode resizeMode,
+            ImageComparator subComparator) {
+        this(subComparator);
+        this.resizeMode = resizeMode;
+    }
+
+    /**
+     * Creates ResizeImageComparator with the following settings:
+     * <ul>
+     * <li>resize mode: {@linkplain ResizeMode#PROPORTIONAL_RESIZE ResizeMode.PROPORTIONAL_RESIZE}.</li>
+     * <li>specified proportion distortion threshold.</li>
+     * <li>resize hint: {@linkplain java.awt.Image#SCALE_DEFAULT Image.SCALE_DEFAULT}.</li>
+     * </ul>
+     *
+     * @param propDistThreshold proportion distortion threshold.
+     * @param subComparator comparator to compare images after resize.
+     * @see ResizeImageComparator
+     */
+    public ResizeImageComparator(double propDistThreshold,
+            ImageComparator subComparator) {
+        this(subComparator);
+        this.propDistThreshold = propDistThreshold;
+    }
+
+    /**
+     * Creates ResizeImageComparator with specified settings.
+     *
+     * @param resizeMode Resize mode.
+     * @param propDistThreshold Proportion distortion threshold.
+     * @param hint Resize hint.
+     * @param subComparator comparator to compare images after resize.
+     * @see ResizeImageComparator
+     * @see ResizeMode
+     */
+    public ResizeImageComparator(ResizeMode resizeMode, double propDistThreshold,
+            int hint, ImageComparator subComparator) {
+        this(subComparator);
+        this.resizeMode = resizeMode;
+        this.hint = hint;
+        this.propDistThreshold = propDistThreshold;
+    }
+
+    @Override
+    public Image resize(Image image, Dimension size) {
+        Dimension isize = getSize(image);
+        double scalex = (double) size.width / isize.width;
+        double scaley = (double) size.height / isize.height;
+        switch (resizeMode) {
+            case NO_RESIZE:
+                return image;
+            case PROPORTIONAL_RESIZE:
+                if (Math.abs(scalex - scaley) > propDistThreshold) {
+                    return null;
+                }
+            case ARBITRARY_RESIZE:
+                BufferedImage res = new BufferedImage(size.width, size.height, ((AWTImage) image).getTheImage().getType());
+                java.awt.Image scaled = ((AWTImage) image).getTheImage().getScaledInstance(
+                        size.width, size.height, hint);
+                Graphics2D g = res.createGraphics();
+                g.drawImage(scaled, 0, 0, null);
+                g.dispose();
+                return new AWTImage(res);
+            default:
+                return null;
+        }
+    }
+    @Override
+    public String getID() {
+        return ResizeImageComparator.class.getName() + "("
+                + getSubComparator().getID() + ")";
+    }
+
+    @Override
+    public Dimension getSize(Image image) {
+        BufferedImage bi = ((AWTImage)image).getTheImage();
+        return new Dimension(bi.getWidth(), bi.getHeight());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/RoughImageComparator.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import org.jemmy.image.pixel.PixelEqualityRasterComparator;
+
+/**
+ * Compares two images roughly (i.e. not all of the pixel colors should match).
+ *
+ * @author shura
+ * @author mrkam
+ */
+public class RoughImageComparator extends BufferedImageComparator {
+
+    /**
+     * Creates a comparator with
+     * <code>roughness</code> allowed roughness.
+     *
+     * @param roughness Allowed comparision roughness.
+     */
+    public RoughImageComparator(double roughness) {
+        super(new PixelEqualityRasterComparator(roughness));
+    }
+    public void setRoughness(double roughness) {
+        ((PixelEqualityRasterComparator)getRasterComparator()).setThreshold(roughness);
+    }
+    public double getRoughness() {
+        return ((PixelEqualityRasterComparator)getRasterComparator()).getThreshold();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/RoughImageFinder.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import org.jemmy.Point;
+import java.awt.image.BufferedImage;
+
+/**
+ * Performs "rough" image search.
+ *
+ * @author shura
+ */
+public class RoughImageFinder implements ImageFinder {
+    double roughness = .0;
+    int bigWidth, bigHeight;
+    int[][] bigPixels;
+
+    /**
+     * Creates an instance allowing to find an image inside the one
+     * passed as parameter with some "roughness".
+     * @param area - Image to search in.
+     * @param roughness - Allowed
+     */
+    public RoughImageFinder(BufferedImage area, double roughness) {
+        this.roughness = roughness;
+        bigWidth  = area.getWidth();
+        bigHeight = area.getHeight();
+        bigPixels = new int[bigWidth][bigHeight];
+        for(int x = 0; x < bigWidth; x++) {
+            for(int y = 0; y < bigHeight; y++) {
+                bigPixels[x][y] = area.getRGB(x, y);
+            }
+        }
+    }
+
+    /**
+     * Performs "rough" search.
+     * @param image an image to search.
+     * @param index an ordinal image location index.
+     * @return Point where number of unmatching pixels less or equal to
+     * <code>image1.getWidth() * image1.getHeight() * roughness</code>
+     */
+    public Point findImage(BufferedImage image, int index) {
+        int smallWidth  = image.getWidth();
+        int smallHeight = image.getHeight();
+        int[][] smallPixels = new int[smallWidth][smallHeight];
+        for(int x = 0; x < smallWidth; x++) {
+            for(int y = 0; y < smallHeight; y++) {
+                smallPixels[x][y] = image.getRGB(x, y);
+            }
+        }
+        double maxRoughPixels = (double)(smallWidth * smallHeight) * roughness;
+        int count = 0;
+        for(int X = 0; X <= bigWidth - smallWidth; X++) {
+            for(int Y = 0; Y <= bigHeight - smallHeight; Y++) {
+                int roughPixels = 0;
+                for(int x = 0; x < smallWidth; x++) {
+                    for(int y = 0; y < smallHeight; y++) {
+                        if(smallPixels[x][y] != bigPixels[X + x][Y + y]) {
+                            roughPixels++;
+                            if(roughPixels > maxRoughPixels) {
+                                break;
+                            }
+                        }
+                    }
+                    if(roughPixels > maxRoughPixels) {
+                        break;
+                    }
+                }
+                if(roughPixels <= maxRoughPixels) {
+                    if(count == index) {
+                        return(new Point(X, Y));
+                    }
+                    count++;
+                }
+            }
+        }
+        return(null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/StrictImageComparator.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import org.jemmy.image.pixel.PixelEqualityRasterComparator;
+
+/**
+ * Compares two images strictly (i.e. all the pixel colors should match).
+ *
+ * @author shura
+ * @author mrkam
+ */
+public class StrictImageComparator extends BufferedImageComparator {
+
+    public StrictImageComparator() {
+        super(new PixelEqualityRasterComparator(0));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/StrictImageFinder.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+import org.jemmy.Point;
+import java.awt.image.BufferedImage;
+
+/**
+ * Performs "strict" (i.e. based on all pixels matching) image search.
+ *
+ * @author Alexandre Iline (alexandre.iline@sun.com)
+ */
+public class StrictImageFinder implements ImageFinder {
+    int bigWidth, bigHeight;
+    int[][] bigPixels;
+
+    /**
+     * Creates an instance searching subimages insige a parameter image.
+     * @param area - Image to search in.
+     */
+    public StrictImageFinder(BufferedImage area) {
+        bigWidth  = area.getWidth();
+        bigHeight = area.getHeight();
+        bigPixels = new int[bigWidth][bigHeight];
+        for(int x = 0; x < bigWidth; x++) {
+            for(int y = 0; y < bigHeight; y++) {
+                bigPixels[x][y] = area.getRGB(x, y);
+            }
+        }
+    }
+
+    /**
+     * Searchs for an image inside image passed into constructor.
+     * @param image an image to search.
+     * @param index an ordinal image location index. If equal to 1, for example,
+     * second appropriate location will be found.
+     * @return Left-up corner coordinates of image location.
+     */
+    public Point findImage(BufferedImage image, int index) {
+        int smallWidth  = image.getWidth();
+        int smallHeight = image.getHeight();
+        int[][] smallPixels = new int[smallWidth][smallHeight];
+        for(int x = 0; x < smallWidth; x++) {
+            for(int y = 0; y < smallHeight; y++) {
+                smallPixels[x][y] = image.getRGB(x, y);
+            }
+        }
+        boolean good;
+        int count = 0;
+        for(int X = 0; X <= bigWidth - smallWidth; X++) {
+            for(int Y = 0; Y <= bigHeight - smallHeight; Y++) {
+                good = true;
+                for(int x = 0; x < smallWidth; x++) {
+                    for(int y = 0; y < smallHeight; y++) {
+                        if(smallPixels[x][y] != bigPixels[X + x][Y + y]) {
+                            good = false;
+                            break;
+                        }
+                    }
+                    if(!good) {
+                        break;
+                    }
+                }
+                if(good) {
+                    if(count == index) {
+                        return(new Point(X, Y));
+                    }
+                    count++;
+                }
+            }
+        }
+        return(null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/Utils.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.image.awt;
+
+
+import org.jemmy.Dimension;
+import org.jemmy.Point;
+import org.jemmy.Rectangle;
+
+
+/**
+ *
+ * @author mrkam
+ */
+public class Utils {
+
+    public static java.awt.Rectangle convert(Rectangle r) {
+        return new java.awt.Rectangle(r.x, r.y, r.width, r.height);
+    }
+
+    public static Rectangle convert(java.awt.Rectangle r) {
+        return new Rectangle(r.x, r.y, r.width, r.height);
+    }
+
+    public static java.awt.Point convert(Point p) {
+        return new java.awt.Point(p.x, p.y);
+    }
+
+    public static Point convert(java.awt.Point p) {
+        return new Point(p.x, p.y);
+    }
+
+    public static java.awt.Dimension convert(Dimension d) {
+        return new java.awt.Dimension(d.width, d.height);
+    }
+
+    public static Dimension convert(java.awt.Dimension d) {
+        return new Dimension(d.width, d.height);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/image/awt/package.html	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+  <head>
+    <title>Image library</title>
+  </head>
+
+  <body>
+    <h1>Image library</h1>
+
+    Contains classes allowing to compare two images and
+    to find one image inside another.<br><br>
+
+    @since 9 Nov 2002
+
+    <hr>
+  </body>
+</html>
--- a/core/JemmyAWTInput/src/org/jemmy/image/package.html	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-  <head>
-    <title>Image library</title>
-  </head>
-
-  <body>
-    <h1>Image library</h1>
-
-    Contains classes allowing to compare two images and
-    to find one image inside another.<br><br>
-
-    @since 9 Nov 2002
-
-    <hr>
-  </body>
-</html>
--- a/core/JemmyAWTInput/src/org/jemmy/input/AWTMap.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.jemmy.JemmyException;
-import org.jemmy.interfaces.Keyboard.KeyboardButton;
-import org.jemmy.interfaces.Keyboard.KeyboardButtons;
-import org.jemmy.interfaces.Keyboard.KeyboardModifiers;
-import org.jemmy.interfaces.Modifier;
-import org.jemmy.interfaces.Mouse.MouseButton;
-import org.jemmy.interfaces.Mouse.MouseButtons;
-import org.jemmy.interfaces.Mouse.MouseModifiers;
-
-
-/**
- * Converts
- * @author mrkam
- */
-public class AWTMap {
-
-    private static Map<Integer, KeyboardButton> int2key = new HashMap<Integer, KeyboardButton>();
-    private static Map<Integer, Modifier> int2modifier = new HashMap<Integer, Modifier>();
-    private static Map<Integer, MouseButton> int2button = new HashMap<Integer, MouseButton>();
-    private static Map<KeyboardButton, Integer> key2int = new HashMap<KeyboardButton, Integer>();
-    private static Map<Modifier, Integer> modifier2int = new HashMap<Modifier, Integer>();
-    private static Map<MouseButton, Integer> button2int = new HashMap<MouseButton, Integer>();
-
-    static {
-        for (KeyboardButtons button : KeyboardButtons.values()) {
-            String name = button.name();
-            try {
-                int key = KeyEvent.VK_UNDEFINED;
-                if (name.length() == 2 && name.startsWith("D")) {
-                    // digit
-                    key = KeyEvent.class.getDeclaredField("VK_" + name.substring(1)).getInt(null);
-                } else {
-                    key = KeyEvent.class.getDeclaredField("VK_" + name).getInt(null);
-                }
-                int2key.put(key, button);
-                key2int.put(button, key);
-            } catch (NoSuchFieldException ex) {
-                throw new JemmyException("Unable to recognize key", ex, button);
-            } catch (SecurityException ex) {
-                throw new JemmyException("Unable to recognize key", ex, button);
-            } catch (IllegalArgumentException ex) {
-                throw new JemmyException("Unable to recognize key", ex, button);
-            } catch (IllegalAccessException ex) {
-                throw new JemmyException("Unable to recognize key", ex, button);
-            }
-        }
-        for (KeyboardModifiers modifier : KeyboardModifiers.values()) {
-            String name = modifier.name();
-            try {
-                int key = InputEvent.class.getDeclaredField(name).getInt(null);
-                int2modifier.put(key, modifier);
-                modifier2int.put(modifier, key);
-            } catch (NoSuchFieldException ex) {
-                throw new JemmyException("Unable to recognize modifier", ex, modifier);
-            } catch (SecurityException ex) {
-                throw new JemmyException("Unable to recognize modifier", ex, modifier);
-            } catch (IllegalArgumentException ex) {
-                throw new JemmyException("Unable to recognize modifier", ex, modifier);
-            } catch (IllegalAccessException ex) {
-                throw new JemmyException("Unable to recognize modifier", ex, modifier);
-            }
-        }
-        for (MouseModifiers modifier : MouseModifiers.values()) {
-            String name = modifier.name();
-            try {
-                int key = InputEvent.class.getDeclaredField(name).getInt(null);
-                int2modifier.put(key, modifier);
-                modifier2int.put(modifier, key);
-            } catch (NoSuchFieldException ex) {
-                throw new JemmyException("Unable to recognize modifier", ex, modifier);
-            } catch (SecurityException ex) {
-                throw new JemmyException("Unable to recognize modifier", ex, modifier);
-            } catch (IllegalArgumentException ex) {
-                throw new JemmyException("Unable to recognize modifier", ex, modifier);
-            } catch (IllegalAccessException ex) {
-                throw new JemmyException("Unable to recognize modifier", ex, modifier);
-            }
-        }
-        for (MouseButtons button : MouseButtons.values()) {
-            String name = button.name();
-            try {
-                int key = InputEvent.class.getDeclaredField(name + "_MASK").getInt(null);
-                int2button.put(key, button);
-                button2int.put(button, key);
-            } catch (NoSuchFieldException ex) {
-                throw new JemmyException("Unable to recognize button", ex, button);
-            } catch (SecurityException ex) {
-                throw new JemmyException("Unable to recognize button", ex, button);
-            } catch (IllegalArgumentException ex) {
-                throw new JemmyException("Unable to recognize button", ex, button);
-            } catch (IllegalAccessException ex) {
-                throw new JemmyException("Unable to recognize button", ex, button);
-            }
-        }
-    }
-
-    /**
-     * TODO Provide javadoc
-     * @param button todo document
-     * @return One of InputEvent.VK_* constants
-     * @see InputEvent
-     */
-    public int convert(KeyboardButton button) {
-        try {
-            return key2int.get(button);
-        } catch(Exception e) {
-            throw new JemmyException("Unable to recognize key", e, button);
-        }
-    }
-
-    public int convert(Modifier... modifiers) {
-        int result = 0;
-        for (Modifier modifier : modifiers) {
-            try {
-                result |= modifier2int.get(modifier);
-            } catch (Exception e) {
-                throw new JemmyException("Unable to recognize modifier", e, modifier);
-            }
-        }
-        return result;
-    }
-
-    public int convert(MouseButton button) {
-        try {
-            return button2int.get(button);
-        } catch (Exception e) {
-            throw new JemmyException("Unable to recognize mouse button", e, button);
-        }
-    }
-
-    public KeyboardButton convertKeyboardButton(int key) {
-        KeyboardButton res = int2key.get(key);
-        if (res == null) {
-            throw new JemmyException("Unable to recognize key", key);
-        }
-        return res;
-    }
-
-    public Modifier[] convertModifiers(int modifiers) {
-        List<Modifier> result = new ArrayList<Modifier>();
-        for (int key : int2modifier.keySet()) {
-            if ((key & modifiers) != 0) {
-                Modifier res = int2modifier.get(key);
-                if (res == null) {
-                    throw new JemmyException("Unable to recognize modifiers", modifiers);
-                }
-                result.add(res);
-            }
-        }
-        return result.toArray(new Modifier[result.size()]);
-    }
-
-    public MouseButton convertMouseButton(int button) {
-        MouseButton res = int2button.get(button);
-        if (res == null) {
-            throw new JemmyException("Unable to recognize mouse button", button);
-        }
-        return res;
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/input/AWTRobotInputFactory.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-import org.jemmy.JemmyException;
-import org.jemmy.control.Wrap;
-import org.jemmy.env.Environment;
-import org.jemmy.interfaces.ControlInterface;
-import org.jemmy.interfaces.ControlInterfaceFactory;
-import org.jemmy.interfaces.Drag;
-import org.jemmy.interfaces.Keyboard;
-import org.jemmy.interfaces.Mouse;
-import org.jemmy.interfaces.TypeControlInterface;
-import org.jemmy.operators.AWTScreen;
-import org.jemmy.operators.Screen;
-
-/**
- *
- * @author shura
- */
-public class AWTRobotInputFactory implements ControlInterfaceFactory {
-
-    /**
-     * Set this Environment property to true or false to run java.awt.Robot in
-     * other or the same JVM
-     */
-    public static final String OTHER_VM_PROPERTY = "awt.robot.othervm";
-
-    /**
-     * Set this Environment property to the name of the host where other JVM runs.
-     * 'localhost' by default
-     */
-    public static final String OTHER_VM_HOST_PROPERTY = "awt.robot.othervm.host";
-
-    /**
-     * Set this Environment property to override the port which is used to
-     * connect to other JVM
-     */
-    public static final String OTHER_VM_PORT_PROPERTY = "awt.robot.othervm.port";
-
-    /**
-     * Set this Environment property to to the maximum time of waiting for the
-     * client to connect to the JVM where Robot is running. It also waits the same
-     * amount of ms for the next connection after the previous terminates.
-     * Default is 15 min.
-     */
-    public static final String OTHER_VM_CONNECTION_TIMEOUT_PROPERTY
-            = "awt.robot.othervm.connection.timeout";
-
-    /**
-     * The name of the timeout that is used by default as the delay time for
-     * java.awt.Robot
-     * @see java.awt.Robot#setAutoDelay(int)
-     */
-    public static final String ROBOT_DELAY_TIMEOUT_NAME = "RobotDriver.DelayTimeout";
-
-    /**
-     * Set this Environment property to the maximum number of pixels between
-     * mouse positions during movement
-     */
-    public static final String ROBOT_MOUSE_SMOOTHNESS_PROPERTY = "awt.robot.mouse.smoothness";
-
-    /**
-     * Specifies whether to run java.awt.Robot in other JVM
-     * @param runInOtherJVM if true then java.awt.Robot will run in other JVM
-     */
-    public static void runInOtherJVM(boolean runInOtherJVM) {
-        RobotExecutor.get().setRunInOtherJVM(runInOtherJVM);
-    }
-
-    /**
-     * Returns runInOtherJVM setting
-     * @return if true then java.awt.Robot is running in other JVM
-     */
-    public static boolean isRunInOtherJVM() {
-        return RobotExecutor.get().isRunInOtherJVM();
-    }
-
-    /**
-     * Specifies mouse movements smoothness
-     * @param mouseSmoothness the maximum number of pixels between
-     * mouse positions during movement
-     * @see #ROBOT_MOUSE_SMOOTHNESS_PROPERTY
-     */
-    public static void setMouseSmoothness(int mouseSmoothness) {
-        if(mouseSmoothness <= 0) {
-            throw new IllegalArgumentException("Mouse smoothness should be greater than zero.");
-        }
-        RobotDriver.setMouseSmoothness(mouseSmoothness);
-    }
-
-    /**
-     * Gets the mouse movements smoothness
-     * @return the maximum number of pixels between
-     * mouse positions during movement
-     * @see #ROBOT_MOUSE_SMOOTHNESS_PROPERTY
-     */
-    public static int getMouseSmoothness() {
-        return RobotDriver.getMouseSmoothness();
-    }
-
-    static {
-        if(Screen.SCREEN == null) {
-            Screen.setSCREEN(new AWTScreen(Environment.getEnvironment()));
-        }
-    }
-
-    public AWTMap getAwtMap() {
-        return RobotExecutor.get().getAWTMap();
-    }
-
-    public void setAwtMap(AWTMap awtMap) {
-        RobotExecutor.get().setAWTMap(awtMap);
-    }
-
-    public <INTERFACE extends ControlInterface> INTERFACE create(Wrap<?> control, Class<INTERFACE> interfaceClass) {
-        if(Mouse.class.isAssignableFrom(interfaceClass)) {
-            return (INTERFACE) new MouseImpl(control);
-        } else if(Keyboard.class.isAssignableFrom(interfaceClass)) {
-            return (INTERFACE) new KeyboardImpl(control);
-        } else if(Drag.class.isAssignableFrom(interfaceClass)) {
-            return (INTERFACE) new DragImpl(control);
-        }
-        throw new JemmyException(AWTRobotInputFactory.class.getName() + " does not support " + interfaceClass.getName());
-    }
-
-    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE create(Wrap<?> control, Class<INTERFACE> interfaceClass, Class<TYPE> type) {
-        throw new JemmyException(AWTRobotInputFactory.class.getName() + " does not support " + interfaceClass.getName());
-    }
-
-    @Override
-    public String toString() {
-        return getClass().getName() + "[otherVM=" + isRunInOtherJVM() + ", mouseSmoothness=" + getMouseSmoothness() + "]";
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/input/ClassReference.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,210 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-
-/**
- *
- * Allows access to classes by reflection.
- *
- * @author Alexandre Iline (alexandre.iline@sun.com)
- */
-public class ClassReference {
-
-    private Class<?> cl;
-    private Object instance;
-
-    /**
-     * Constructor.
-     * @param o Object to work with.
-     */
-    public ClassReference(Object o) {
-        super();
-        instance = o;
-        cl = o.getClass();
-    }
-
-    /**
-     * Contructor.
-     * The object created by this constructor can be used
-     * to access static methods and fields only.
-     *
-     * @param className name of class
-     * @throws ClassNotFoundException todo document
-     */
-    public ClassReference(String className)
-            throws ClassNotFoundException {
-        super();
-        cl = Class.forName(className);
-        instance = null;
-    }
-
-    /**
-     * Executes class's <code>main(java.lang.String[])</code> method
-     * with a zero-length <code>java.lang.String</code> array
-     * as a parameter.
-     *
-     * @throws NoSuchMethodException when the method cannot be found.
-     * @throws InvocationTargetException when the invoked method throws an exception.
-     */
-    public void startApplication()
-            throws InvocationTargetException, NoSuchMethodException {
-        String[] params = new String[0];
-        startApplication(params);
-    }
-
-    /**
-     * Executes class's <code>main(java.lang.String[])</code> method.
-     *
-     * @param params The <code>java.lang.String</code> array to pass
-     * to <code>main(java.lang.String[])</code>.
-     * @throws NoSuchMethodException when the method cannot be found.
-     * @throws InvocationTargetException when the invoked method throws an exception.
-     */
-    public void startApplication(String[] params)
-            throws InvocationTargetException, NoSuchMethodException {
-        String[] real_params;
-        if (params == null) {
-            real_params = new String[0];
-        } else {
-            real_params = params;
-        }
-        String[][] methodParams = {real_params};
-        Class[] classes = {real_params.getClass()};
-        try {
-            invokeMethod("main", methodParams, classes);
-        } catch (IllegalAccessException e) {
-            e.printStackTrace();
-        } catch (IllegalStateException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Locates method by name and parameter types and executes it.
-     *
-     * @param method_name Name of method.
-     * @param params Method parameters.
-     * @param params_classes Method parameters types.
-     * @return the return value from an invocation of the Method.<br>
-     * If <code>method_name</code> method is void, <code>null</code> is returned.<br>
-     * If <code>method_name</code> method returns a primitive type, then
-     * return wrapper class instance.
-     * @throws InvocationTargetException when the invoked method throws an exception.
-     * @throws NoSuchMethodException when the method cannot be found.
-     * @throws IllegalAccessException when access to the class or method is lacking.
-     * @throws SecurityException if access to the package or method is denied.
-     */
-    public Object invokeMethod(String method_name, Object[] params, Class<?>[] params_classes)
-            throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
-        if (params == null) {
-            params = new Object[0];
-        }
-        if (params_classes == null) {
-            params_classes = new Class<?>[0];
-        }
-        Method method = cl.getMethod(method_name,
-                params_classes);
-        return (method.invoke(instance, params));
-    }
-
-    /**
-     * Locates constructor by parameter types and creates an instance.
-     *
-     * @param params An array of Method parameters.
-     * @param params_classes An array of Method parameter types.
-     * @return a new class instance.
-     * @throws InvocationTargetException when the invoked constructor throws an exception.
-     * @throws NoSuchMethodException when the constructor cannot be found.
-     * @throws IllegalAccessException when access to the class or constructor is lacking.
-     * @throws InstantiationException when the constructor is for an abstract class.
-     * @throws SecurityException if access to the package or constructor is denied.
-     */
-    public Object newInstance(Object[] params, Class[] params_classes)
-            throws InvocationTargetException, NoSuchMethodException,
-            IllegalAccessException, InstantiationException {
-        if (params == null) {
-            params = new Object[0];
-        }
-        if (params_classes == null) {
-            params_classes = new Class[0];
-        }
-        Constructor constructor = cl.getConstructor(params_classes);
-        return (constructor.newInstance(params));
-    }
-
-    /**
-     * Returns the field value.
-     * @param field_name The name of the field.
-     * @return the field value
-     * @see #setField
-     * @throws NoSuchFieldException when the field cannot be found.
-     * @throws IllegalAccessException when access to the class or constructor is lacking.
-     * @throws SecurityException if access to the package or field is denied.
-     */
-    public Object getField(String field_name)
-            throws NoSuchFieldException, IllegalAccessException {
-        return (cl.getField(field_name).get(instance));
-    }
-
-    /**
-     * Change a field's value.
-     *
-     * @param field_name The name of the field.
-     * @param newValue The fields new value.
-     * @see #getField
-     * @throws NoSuchFieldException when the field cannot be found.
-     * @throws IllegalAccessException when access to the class or constructor is lacking.
-     * @throws SecurityException if access to the package or field is denied.
-     */
-    public void setField(String field_name, Object newValue)
-            throws NoSuchFieldException, IllegalAccessException {
-        cl.getField(field_name).set(instance, newValue);
-    }
-
-    /**
-     * Returns all superclasses.
-     * @return an array of superclasses, starting with the reference class
-     * and ending with <code>java.lang.Object</code>.
-     */
-    public Class[] getClasses() {
-        Class cls = cl;
-        int count = 0;
-        do {
-            count++;
-            cls = cls.getSuperclass();
-        } while (cls != null);
-        Class[] result = new Class[count];
-        cls = cl;
-        for (int i = 0; i < count; i++) {
-            result[i] = cls;
-            cls = cls.getSuperclass();
-        }
-        return (result);
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/input/DragImpl.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-
-import java.awt.event.InputEvent;
-import org.jemmy.control.*;
-import org.jemmy.Point;
-import org.jemmy.action.Action;
-import org.jemmy.env.Environment;
-import org.jemmy.env.Timeout;
-import org.jemmy.interfaces.Mouse.MouseButton;
-import org.jemmy.interfaces.Drag;
-import org.jemmy.interfaces.Modifier;
-import org.jemmy.interfaces.Mouse;
-import org.jemmy.interfaces.Mouse.MouseButtons;
-import org.jemmy.interfaces.Showable;
-
-
-/**
- * @author shura
- */
-public class DragImpl implements Drag {
-
-    public static final int DND_POINTS = 10;
-
-    static {
-        Environment.getEnvironment().setTimeout(BEFORE_DRAG_TIMEOUT);
-        Environment.getEnvironment().setTimeout(BEFORE_DROP_TIMEOUT);
-        Environment.getEnvironment().setTimeout(IN_DRAG_TIMEOUT);
-    }
-
-    private Wrap<?> source;
-
-    public DragImpl(Wrap<?> source) {
-        this.source = source;
-    }
-
-    public void dnd(Point targetPoint) {
-        dnd(source, targetPoint);
-    }
-
-    public void dnd(Wrap target, Point targetPoint) {
-        dnd(source.getClickPoint(), target, targetPoint);
-    }
-
-    public void dnd(Point point, Wrap target, Point targetPoint) {
-        dnd(point, target, targetPoint, MouseButtons.BUTTON1);
-    }
-
-    public void dnd(Point point, Wrap target, Point targetPoint, MouseButton button) {
-        dnd(point, target, targetPoint, button, new Modifier[]{});
-    }
-
-    public void dnd(Point pointParam, final Wrap target, final Point targetPoint, final MouseButton button, final Modifier... modifiers) {
-        final Point point = pointParam == null ? source.getClickPoint() : pointParam;
-        source.getEnvironment().getExecutor().execute(target.getEnvironment(), false, new Action() {
-            public void run(Object... parameters) {
-                if(source.is(Showable.class)) ((Showable)source.as(Showable.class)).shower().show();
-                source.mouse().move(point);
-                source.mouse().press(button, modifiers);
-                source.getEnvironment().getTimeout(BEFORE_DRAG_TIMEOUT.getName()).sleep();
-                Point intermediatePoint = new Point();
-                int xDistance = target.getScreenBounds().x + targetPoint.x - source.getScreenBounds().x - point.x;
-                int yDistance = target.getScreenBounds().y + targetPoint.y - source.getScreenBounds().y - point.y;
-                int startX = point.x + source.getScreenBounds().x;
-                int startY = point.y + source.getScreenBounds().y;
-                int endX = startX + xDistance;
-                int endY = startY + yDistance;
-                for(int i = 0; i < DND_POINTS + 1; i++) {
-                    intermediatePoint.x = startX + xDistance * i / DND_POINTS - source.getScreenBounds().x;
-                    intermediatePoint.y = startY + yDistance * i / DND_POINTS - source.getScreenBounds().y;
-                    source.mouse().move(intermediatePoint);
-                    source.getEnvironment().getTimeout(IN_DRAG_TIMEOUT.getName()).sleep();
-                }
-                source.mouse().move(new Point(endX - source.getScreenBounds().x, endY - source.getScreenBounds().y));
-                //target.mouse().move(targetPoint);
-                source.getEnvironment().getTimeout(BEFORE_DROP_TIMEOUT.getName()).sleep();
-                target.mouse().release(button, modifiers);
-            }
-
-            @Override
-            public String toString() {
-                return "grag'n'drop from " + point + " to " + targetPoint + " of " + target.getClass() + " with mouse button " + button + " with " + modifiers + " modifiers";
-            }
-
-        }, button, modifiers);
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/input/KeyboardImpl.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-import org.jemmy.action.Action;
-import org.jemmy.control.Wrap;
-import org.jemmy.interfaces.Keyboard.KeyboardButton;
-import org.jemmy.interfaces.Keyboard.KeyboardModifier;
-import org.jemmy.interfaces.Keyboard;
-import org.jemmy.env.Environment;
-import org.jemmy.env.Timeout;
-import org.jemmy.interfaces.Focusable;
-import org.jemmy.interfaces.Modifier;
-
-/**
- * KeyDriver
- *
- * @author Alexandre Iline(alexandre.iline@sun.com)
- */
-public class KeyboardImpl implements Keyboard {
-
-    CharBindingMap<KeyboardButton, KeyboardModifier> map;
-    Environment env;
-    Wrap<?> target;
-    RobotDriver robotDriver;
-    private boolean detached;
-
-    public KeyboardImpl(Wrap<?> target) {
-        //TODO: super(target.getEnvironment().getTimeout(RobotDriver.ROBOT_DELAY_TIMEOUT_NAME));
-        robotDriver = new RobotDriver(target.getEnvironment());
-        this.env = target.getEnvironment();
-        this.map = target.getEnvironment().getBindingMap();
-        this.target = target;
-    }
-
-    static {
-        //TODO: Environment.getEnvironment().setTimeout(new Timeout(RobotDriver.ROBOT_DELAY_TIMEOUT_NAME, 10));
-        Environment.getEnvironment().setTimeout(new Timeout(PUSH.getName(), 100));
-        Environment.getEnvironment().setBindingMap(new DefaultCharBindingMap());
-    }
-
-    private void runAction(Action action) {
-        if(detached) {
-            target.getEnvironment().getExecutor().executeDetached(target.getEnvironment(), false, action);
-        } else {
-            target.getEnvironment().getExecutor().execute(target.getEnvironment(), false, action);
-        }
-    }
-
-    public Environment getEnvironment() {
-        return env;
-    }
-
-    public void pushKey(final KeyboardButton kbdButton, final Modifier modifiers[], final Timeout pushTime) {
-        runAction(new Action() {
-            public void run(Object... parameters) {
-                if(target.is(Focusable.class)) target.as(Focusable.class).focuser().focus();
-                pressKey(kbdButton, modifiers);
-                pushTime.sleep();
-                releaseKey(kbdButton, modifiers);
-            }
-            @Override
-            public String toString() {
-                return "push " + kbdButton + " key with " + modifiers + " modifiers";
-            }
-        });
-    }
-
-    @Override
-    public void typeChar(char keyChar, Timeout pushTime) {
-        pushKey(pushTime, map.getCharKey(keyChar), map.getCharModifiers(keyChar));
-    }
-
-    /**
-     * Press the keyboard key specified by kbdButton preceding with
-     * pressing of modifier buttons specified by modifiers
-     * @param kbdButton one of InputEvent.VK_* constants
-     * @param modifiers combination of InputEvent.*_DOWN_MASK constants
-     * @see java.awt.event.InputEvent
-     */
-    @Override
-    public void pressKey(final KeyboardButton kbdButton, final Modifier... modifiers) {
-        runAction(new Action() {
-            public void run(Object... parameters) {
-                robotDriver.pressKey(kbdButton, modifiers);
-            }
-            @Override
-            public String toString() {
-                return "press " + kbdButton + " key with " + modifiers + " modifiers";
-            }
-        });
-    }
-
-    /**
-     * Release the keyboard key specified by kbdButton and then release
-     * all the modifier keys specified by modifiers
-     * @param kbdButton one of InputEvent.VK_* constants
-     * @param modifiers combination of InputEvent.*_DOWN_MASK constants
-     * @see java.awt.event.InputEvent
-     */
-    @Override
-    public void releaseKey(final KeyboardButton kbdButton, final Modifier... modifiers) {
-        runAction(new Action() {
-            public void run(Object... parameters) {
-                robotDriver.releaseKey(kbdButton, modifiers);
-            }
-            @Override
-            public String toString() {
-                return "press " + kbdButton + " key with " + modifiers + " modifiers";
-            }
-        });
-    }
-
-    @Override
-    public void pressKey(KeyboardButton kbdButton) {
-        pressKey(kbdButton, new Modifier[]{});
-    }
-
-
-    @Override
-    public void releaseKey(KeyboardButton kbdButton) {
-        releaseKey(kbdButton, new Modifier[]{});
-    }
-
-
-    @Override
-    public void pushKey(KeyboardButton kbdButton, Modifier... modifiers) {
-        pushKey(kbdButton, modifiers, getEnvironment().getTimeout(PUSH.getName()));
-    }
-
-    @Override
-    public void pushKey(KeyboardButton kbdButton) {
-        pushKey(kbdButton, new Modifier[]{});
-    }
-
-    @Override
-    public void typeChar(char keyChar) {
-        typeChar(keyChar, getEnvironment().getTimeout(PUSH.getName()));
-    }
-
-    @Override
-    public Keyboard detached() {
-        detached = true;
-        return this;
-    }
-
-    @Override
-    public void pushKey(Timeout pushTime, KeyboardButton key, Modifier... modifiers) {
-        pushKey(key, modifiers, pushTime);
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/input/MouseImpl.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,232 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-import org.jemmy.Rectangle;
-import org.jemmy.Point;
-import java.util.Arrays;
-import org.jemmy.action.Action;
-import org.jemmy.control.Wrap;
-import org.jemmy.env.Environment;
-import org.jemmy.env.Timeout;
-import org.jemmy.interfaces.Modifier;
-import org.jemmy.interfaces.Mouse;
-import static org.jemmy.interfaces.Mouse.CLICK;
-import org.jemmy.interfaces.Showable;
-
-/**
- *
- * @author shura
- */
-public class MouseImpl implements Mouse {
-
-    private Wrap<?> target;
-    private RobotDriver robotDriver;
-    private boolean detached = false;
-
-    static {
-        if (Environment.getEnvironment().getTimeout(CLICK) == null) {
-            Environment.getEnvironment().setTimeout(MouseImpl.CLICK);
-        }
-    }
-
-    public MouseImpl(Wrap<?> target) {
-        this.target = target;
-        this.robotDriver = new RobotDriver(new Timeout("", 10));
-    }
-
-    public Mouse detached() {
-        this.detached = true;
-        return this;
-    }
-
-    private void runAction(Action action) {
-        if (detached) {
-            target.getEnvironment().getExecutor().executeDetached(target.getEnvironment(), false, action);
-        } else {
-            target.getEnvironment().getExecutor().execute(target.getEnvironment(), false, action);
-        }
-    }
-
-    @Override
-    public void press() {
-        press(MouseButtons.BUTTON1);
-    }
-
-    @Override
-    public void press(MouseButton button) {
-        press(button, new Modifier[]{});
-    }
-
-    @Override
-    public void press(final MouseButton button, final Modifier... modifiers) {
-        runAction(new Action() {
-
-            public void run(Object... parameters) {
-                robotDriver.pressMouse(button, modifiers);
-            }
-
-            @Override
-            public String toString() {
-                return "pressing mouse button " + button + " with " + modifiers + " modifiers";
-            }
-        });
-    }
-
-    public void release() {
-        release(MouseButtons.BUTTON1);
-    }
-
-    @Override
-    public void release(MouseButton button) {
-        release(button, new Modifier[]{});
-    }
-
-    @Override
-    public void release(final MouseButton button, final Modifier... modifiers) {
-        runAction(new Action() {
-
-            public void run(Object... parameters) {
-                robotDriver.releaseMouse(button, modifiers);
-            }
-
-            @Override
-            public String toString() {
-                return "releasing mouse button " + button + " with " + modifiers + " modifiers";
-            }
-        });
-    }
-
-    public void move() {
-        move(target.getClickPoint());
-    }
-
-    public void move(final Point p) {
-        runAction(new Action() {
-
-            public void run(Object... parameters) {
-                robotDriver.moveMouse(getAbsolute(target, p));
-            }
-
-            @Override
-            public String toString() {
-                return "moving mouse to " + p;
-            }
-        });
-    }
-
-    public void click() {
-        this.click(1);
-    }
-
-    public void click(int count) {
-        this.click(count, null);
-    }
-
-    /**
-     * @param count todo document
-     * @param p Point to click, if null {@linkplain Wrap#getClickPoint()
-     * Wrap.getClickPoint()} method is invoked to get the point to click.
-     */
-    public void click(int count, Point p) {
-        this.click(count, p, MouseButtons.BUTTON1);
-    }
-
-    /**
-     *
-     * @param count todo document
-     * @param p Point to click, if null {@linkplain Wrap#getClickPoint()
-     * Wrap.getClickPoint()} method is invoked to get the point to click.
-     * @param button todo document
-     */
-    @Override
-    public void click(int count, Point p, MouseButton button) {
-        click(count, p, button, new Modifier[] {});
-    }
-
-    /**
-     *
-     * @param count todo document
-     * @param p Point to click, if null {@linkplain Wrap#getClickPoint()
-     * Wrap.getClickPoint()} method is invoked to get the point to click.
-     * @param button todo document
-     * @param modifiers todo document
-     */
-    @Override
-    public void click(final int count, final Point p, final MouseButton button, final Modifier... modifiers) {
-        runAction(new Action() {
-
-            public void run(Object... parameters) {
-                if (target.is(Showable.class)) {
-                    target.as(Showable.class).shower().show();
-                }
-                robotDriver.clickMouse(getAbsolute(target,
-                        p == null ? target.getClickPoint() : p),
-                        count, button, target.getEnvironment().getTimeout(CLICK), modifiers);
-            }
-
-            @Override
-            public String toString() {
-                return "clicking " + button + " mouse button " + count + " times at " + p + " with " + Arrays.toString(modifiers) + " modifiers";
-            }
-        });
-    }
-
-    static Point getAbsolute(Wrap<?> target, Point p) {
-        Rectangle screenBounds = target.getScreenBounds();
-        return new Point(p.x + screenBounds.x, p.y + screenBounds.y);
-    }
-
-    private void turn(final Point p, final int amount, final Modifier... modifiers) {
-        runAction(new Action() {
-
-            public void run(Object... parameters) {
-                if (target.is(Showable.class)) {
-                    target.as(Showable.class).shower().show();
-                }
-                robotDriver.turnWheel(getAbsolute(target,
-                        p == null ? target.getClickPoint() : p),
-                        amount, modifiers);
-            }
-
-            @Override
-            public String toString() {
-                return "turning wheel to " + amount + " with " + Arrays.toString(modifiers) + " modifiers";
-            }
-        });
-    }
-
-    public void turnWheel(Point point, final int amount, Modifier... modifiers) {
-        turn(point, amount, modifiers);
-    }
-
-    public void turnWheel(Point point, final int amount) {
-        turn(point, amount, new Modifier[]{});
-    }
-
-    public void turnWheel(final int amount) {
-        turn(null, amount, new Modifier[]{});
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/input/RobotDriver.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,340 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-
-import org.jemmy.Point;
-import java.awt.event.InputEvent;
-import java.util.HashMap;
-import org.jemmy.Rectangle;
-import org.jemmy.env.Timeout;
-import org.jemmy.env.Environment;
-import org.jemmy.image.Image;
-import static org.jemmy.input.AWTRobotInputFactory.*;
-import org.jemmy.interfaces.Button;
-import org.jemmy.interfaces.Keyboard.KeyboardButton;
-import org.jemmy.interfaces.Keyboard.KeyboardButtons;
-import org.jemmy.interfaces.Keyboard.KeyboardModifiers;
-import org.jemmy.interfaces.Modifier;
-import org.jemmy.interfaces.Mouse.MouseButton;
-import org.jemmy.interfaces.Mouse.MouseButtons;
-import org.jemmy.interfaces.Mouse.MouseModifiers;
-
-
-/**
- * @author shura
- * @author mrkam
- *
- */
-public class RobotDriver {
-
-    private static boolean haveOldPos = false;
-    private static int smoothness;
-    private static double oldX;
-    private static double oldY;
-
-    static {
-        Environment.getEnvironment().setTimeout(
-                new Timeout(ROBOT_DELAY_TIMEOUT_NAME, 10));
-        Environment.getEnvironment().setPropertyIfNotSet(
-                AWTRobotInputFactory.ROBOT_MOUSE_SMOOTHNESS_PROPERTY,
-                Integer.toString(Integer.MAX_VALUE));
-        smoothness =  Integer.parseInt(
-                (String)Environment.getEnvironment().getProperty(
-                AWTRobotInputFactory.ROBOT_MOUSE_SMOOTHNESS_PROPERTY));
-    }
-
-    /**
-     * Sets mouse smoothness
-     * @param mouseSmoothness the maximum distance in pixels between
-     * mouse positions during movement
-     * @see #moveMouse(Point)
-     */
-    public static void setMouseSmoothness(int mouseSmoothness) {
-        smoothness = mouseSmoothness;
-    }
-
-    /**
-     * Gets mouse smoothness
-     * @return the maximum distance in pixels between
-     * mouse positions during movement
-     * @see #setMouseSmoothness(int)
-     * @see #moveMouse(Point)
-     */
-    public static int getMouseSmoothness() {
-        return smoothness;
-    }
-
-    /**
-     * Constructs a RobotDriver object.
-     * @param autoDelay Time for <code>Robot.setAutoDelay(long)</code> method.
-     */
-    public RobotDriver(Timeout autoDelay) {
-        RobotExecutor.get().setAutoDelay(autoDelay);
-    }
-
-    /**
-     * Constructs a RobotDriver object.
-     * @param env Environment with ROBOT_DELAY_TIMEOUT_NAME timeout
-     * @see AWTRobotInputFactory#ROBOT_DELAY_TIMEOUT_NAME
-     */
-    public RobotDriver(Environment env) {
-        this(env.getTimeout(ROBOT_DELAY_TIMEOUT_NAME));
-    }
-
-    /**
-     * Capture an image of specified rectangular area of screen
-     * @param screenRect area on screen that will be captured
-     * @return image of specified rectangular area of screen
-     */
-    public static Image createScreenCapture(Rectangle screenRect) {
-        return RobotExecutor.get().createScreenCapture(screenRect);
-    }
-
-    /**
-     * Presses mouse button specified by mouseButton preceding pressing of
-     * modifier keys or buttons specified by modifiers
-     * @param mouseButton One of MouseEvent.BUTTON*_MASK
-     * @param modifiers Combination of InputEvent.*_DOWN_MASK
-     * @see java.awt.event.InputEvent
-     * @see java.awt.event.MouseEvent
-     */
-    public void pressMouse(MouseButton mouseButton, Modifier... modifiers) {
-        pressModifiers(modifiers);
-        makeAnOperation("mousePress",
-                new Object[]{mouseButton},
-                new Class[]{MouseButton.class});
-    }
-
-    /**
-     * Releases mouse button specified by mouseButton then releasing
-     * modifier keys or buttons specified by modifiers
-     * @param mouseButton One of MouseEvent.BUTTON*_MASK
-     * @param modifiers Combination of InputEvent.*_DOWN_MASK
-     * @see java.awt.event.InputEvent
-     * @see java.awt.event.MouseEvent
-     */
-    public void releaseMouse(MouseButton mouseButton, Modifier... modifiers) {
-        makeAnOperation("mouseRelease",
-                new Object[]{mouseButton},
-                new Class[]{MouseButton.class});
-        releaseModifiers(modifiers);
-    }
-
-    /**
-     * Moves mouse to the specified mouse. When previous mouse location is
-     * remembered mouse moved smoothly between the points according to
-     * mouse smoothness parameter. Otherwise it jumps to the specified point
-     * @param point Position on the screen where to move mouse
-     * @see #setMouseSmoothness(int)
-     * @see #getMouseSmoothness()
-     */
-    public void moveMouse(Point point) {
-        double targetX = point.x;
-        double targetY = point.y;
-        if (haveOldPos && (oldX != targetX || oldY != targetY)) {
-            double currX = oldX;
-            double currY = oldY;
-            double hyp = Math.sqrt((targetX - currX) * (targetX - currX) +
-                    (targetY - currY) * (targetY - currY));
-            double steps = Math.ceil(hyp / Math.min(hyp, smoothness));
-            double vx = (targetX - currX) / steps;
-            double vy = (targetY - currY) / steps;
-            assert (long)vx * vx + (long)vy * vy <= (long)smoothness * smoothness;
-            while (Math.round(currX) != Math.round(targetX) ||
-                    Math.round(currY) != Math.round(targetY)) {
-                currX += vx;
-                currY += vy;
-                makeAnOperation("mouseMove", new Object[]{
-                            new Integer((int) Math.round(currX)),
-                            new Integer((int) Math.round(currY))},
-                        new Class[]{Integer.TYPE, Integer.TYPE});
-            }
-        } else {
-            makeAnOperation("mouseMove",
-                    new Object[]{new Integer(point.x), new Integer(point.y)},
-                    new Class[]{Integer.TYPE, Integer.TYPE});
-        }
-        haveOldPos = true;
-        oldX = targetX;
-        oldY = targetY;
-    }
-
-    /**
-     * Clicks the mouse button specified by mouseButton at the specified point
-     * specified number of times preceding it by pressing the modifiers key or
-     * buttons and ending by releasing them. The last click is as long as
-     * mouseClick timeout
-     * @param point Screen location where to click mouse
-     * @param clickCount Number of clicks
-     * @param mouseButton One of MouseEvent.BUTTON*_MASK
-     * @param modifiers Combination of InputEvent.*_DOWN_MASK
-     * @param mouseClick Timeout of the last click
-     * @see java.awt.event.InputEvent
-     * @see java.awt.event.MouseEvent
-     */
-    public void clickMouse(Point point, int clickCount, MouseButton mouseButton, Timeout mouseClick, Modifier... modifiers) {
-        pressModifiers(modifiers);
-        moveMouse(point);
-        makeAnOperation("mousePress", new Object[]{mouseButton}, new Class[]{MouseButton.class});
-        for (int i = 1; i < clickCount; i++) {
-            makeAnOperation("mouseRelease", new Object[]{mouseButton}, new Class[]{MouseButton.class});
-            makeAnOperation("mousePress", new Object[]{mouseButton}, new Class[]{MouseButton.class});
-        }
-        mouseClick.sleep();
-        makeAnOperation("mouseRelease", new Object[]{mouseButton}, new Class[]{MouseButton.class});
-        releaseModifiers(modifiers);
-    }
-
-    /**
-     * @deprecated Implementation doesn't seem to be correct as it ignores mouseButton and modifiers
-     * @param point todo document
-     * @param mouseButton One of MouseEvent.BUTTON*_MASK
-     * @param modifiers todo document
-     */
-    public void dragMouse(Point point, int mouseButton, int modifiers) {
-        moveMouse(point);
-    }
-
-    /**
-     * Performs drag and drop from startPoint to endPoint using specified
-     * mouseButton and modifiers to perform it.
-     * @param startPoint Screen coordinates of drag start point
-     * @param endPoint Screen coordinates of drag end point
-     * @param mouseButton One of MouseEvent.BUTTON*_MASK
-     * @param modifiers Combination of InputEvent.*_DOWN_MASK
-     * @param before Timeout between pressing mouse at the startPoint and
-     * mouse move
-     * @param after Timeout between mouse move to the endPoint and mouse
-     * release
-     */
-    public void dragNDrop(Point startPoint, Point endPoint, MouseButton mouseButton, Modifier modifiers[], Timeout before, Timeout after) {
-        moveMouse(startPoint);
-        pressMouse(mouseButton, modifiers);
-        before.sleep();
-        moveMouse(endPoint);
-        after.sleep();
-        releaseMouse(mouseButton, modifiers);
-    }
-
-    /**
-     * Presses a key.
-     * @param kbdButton Key code (<code>KeyEventVK_*</code> field.
-     * @param modifiers a combination of <code>InputEvent.*_MASK</code> fields.
-     */
-    public void pressKey(KeyboardButton kbdButton, Modifier... modifiers) {
-        pressModifiers(modifiers);
-        makeAnOperation("keyPress",
-                new Object[]{kbdButton},
-                new Class[]{KeyboardButton.class});
-    }
-
-    /**
-     * Releases a key.
-     * @param kbdButton Key code (<code>KeyEventVK_*</code> field.
-     * @param modifiers a combination of <code>InputEvent.*_MASK</code> fields.
-     */
-    public void releaseKey(KeyboardButton kbdButton, Modifier... modifiers) {
-        makeAnOperation("keyRelease",
-                new Object[]{kbdButton},
-                new Class[]{KeyboardButton.class});
-        releaseModifiers(modifiers);
-    }
-
-    /**
-     * Turns the wheel.
-     * @param p todo document
-     * @param amount Either positive or negative
-     * @param modifiers a combination of <code>InputEvent.*_MASK</code> fields.
-     */
-    public void turnWheel(Point p, int amount, Modifier... modifiers) {
-        pressModifiers(modifiers);
-        moveMouse(p);
-        java.awt.Robot r = null;
-        makeAnOperation("mouseWheel",
-                new Object[]{amount},
-                new Class[]{Integer.TYPE});
-        releaseModifiers(modifiers);
-    }
-
-    /**
-     * Performs a single operation.
-     * @param method a name of <code>java.awt.Robot</code> method.
-     * @param params method parameters
-     * @param paramClasses method parameters classes
-     */
-    public void makeAnOperation(final String method, final Object[] params, final Class[] paramClasses) {
-        RobotExecutor.get().makeAnOperation(method, params, paramClasses);
-    }
-
-    final static int SHIFT_MASK = InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK;
-    final static int ALT_GRAPH_MASK = InputEvent.ALT_GRAPH_DOWN_MASK | InputEvent.ALT_GRAPH_MASK;
-    final static int ALT_MASK = InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK;
-    final static int META_MASK = InputEvent.META_DOWN_MASK | InputEvent.META_MASK;
-    final static int CTRL_MASK = InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK;
-
-    /**
-     * Presses modifiers keys by robot.
-     * @param modifiers a combination of <code>InputEvent.*_MASK</code> fields.
-     */
-    protected void pressModifiers(Modifier... modifiers) {
-        for (Modifier modifier : modifiers) { // TODO: ALT_GRAPH_MASK?
-            if (modifier == KeyboardModifiers.ALT_DOWN_MASK) {
-                pressKey(KeyboardButtons.ALT);
-            } else if (modifier == KeyboardModifiers.CTRL_DOWN_MASK) {
-                pressKey(KeyboardButtons.CONTROL);
-            } else if (modifier == KeyboardModifiers.META_DOWN_MASK) {
-                pressKey(KeyboardButtons.META);
-            } else if (modifier == KeyboardModifiers.SHIFT_DOWN_MASK) {
-                pressKey(KeyboardButtons.SHIFT);
-            }
-        }
-    }
-
-    /**
-     * Releases modifiers keys by robot.
-     * @param modifiers a combination of <code>InputEvent.*_MASK</code> fields.
-     */
-    protected void releaseModifiers(Modifier... modifiers) {
-        for (Modifier modifier : modifiers) { // TODO: ALT_GRAPH_MASK?
-            if (modifier == KeyboardModifiers.ALT_DOWN_MASK) {
-                releaseKey(KeyboardButtons.ALT);
-            } else if (modifier == KeyboardModifiers.CTRL_DOWN_MASK) {
-                releaseKey(KeyboardButtons.CONTROL);
-            } else if (modifier == KeyboardModifiers.META_DOWN_MASK) {
-                releaseKey(KeyboardButtons.META);
-            } else if (modifier == KeyboardModifiers.SHIFT_DOWN_MASK) {
-                releaseKey(KeyboardButtons.SHIFT);
-            }
-        }
-    }
-    /**
-     * If java.awt.Robot is running in other JVM, it shutdowns that JVM
-     * @see AWTRobotInputFactory#runInOtherJVM(boolean)
-     */
-    public static void exit() {
-        RobotExecutor.get().exit();
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/input/RobotExecutor.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,603 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-
-import java.awt.EventQueue;
-import java.awt.image.BufferedImage;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OptionalDataException;
-import java.io.PrintWriter;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Modifier;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.jemmy.JemmyException;
-import org.jemmy.Rectangle;
-import org.jemmy.env.Environment;
-import org.jemmy.env.Timeout;
-import org.jemmy.image.AWTImage;
-import org.jemmy.image.Image;
-import org.jemmy.image.PNGDecoder;
-import org.jemmy.image.PNGEncoder;
-import org.jemmy.timing.State;
-import org.jemmy.timing.Waiter;
-import org.jemmy.interfaces.Keyboard.KeyboardButton;
-import org.jemmy.interfaces.Mouse.MouseButton;
-
-/**
- *
- * @author КАМ
- */
-class RobotExecutor {
-
-    private static RobotExecutor instance;
-    private AWTMap awtMap = null;
-
-    public static RobotExecutor get() {
-        if (instance == null) {
-            instance = new RobotExecutor();
-        }
-        return instance;
-    }
-
-    /**
-     * A reference to the robot instance.
-     */
-    protected ClassReference robotReference = null;
-    protected Timeout autoDelay;
-    private boolean inited = false;
-    private boolean runInOtherJVM = false;
-    private boolean ready = false;
-    private boolean connectionEstablished = false;
-    private ObjectOutputStream outputStream;
-    private ObjectInputStream inputStream;
-    private Socket socket;
-    private int connectionPort;
-    private String connectionHost;
-    public static final int CONNECTION_TIMEOUT = Integer.parseInt(
-            (String)Environment.getEnvironment().getProperty(
-            AWTRobotInputFactory.OTHER_VM_CONNECTION_TIMEOUT_PROPERTY,
-            Integer.toString(60000 * 15))); // 15 min
-
-    public RobotExecutor() {
-    }
-
-    void setAWTMap(AWTMap awtMap) {
-        this.awtMap = awtMap;
-    }
-
-    AWTMap getAWTMap() {
-        if (awtMap == null) {
-            awtMap = new AWTMap();
-        }
-        return awtMap;
-    }
-
-    private void ensureInited() {
-        if (!inited) {
-             runInOtherJVM = Boolean.parseBoolean((String)Environment.getEnvironment()
-                     .getProperty(AWTRobotInputFactory.OTHER_VM_PROPERTY,
-                     Boolean.toString(runInOtherJVM)));
-             inited = true;
-        }
-    }
-
-    public Image createScreenCapture(Rectangle screenRect) {
-         Object result = makeAnOperation("createScreenCapture", new Object[] {
-            new java.awt.Rectangle(screenRect.x, screenRect.y, screenRect.width,
-                    screenRect.height) },
-            new Class[] { java.awt.Rectangle.class });
-         if (result.getClass().isAssignableFrom(BufferedImage.class)) {
-             return new AWTImage(BufferedImage.class.cast(result));
-         } else {
-             throw new JemmyException("Screen capture (" + result
-                     + ") is not a BufferedImage");
-         }
-    }
-
-    public Object makeAnOperation(String method, Object[] params, Class[] paramClasses) {
-        ensureInited();
-        if (runInOtherJVM) {
-            return makeAnOperationRemotely(method, params, paramClasses);
-        } else {
-            return makeAnOperationLocally(method, params, paramClasses);
-        }
-    }
-
-    public void exit() {
-        ensureInited();
-        if (runInOtherJVM) {
-            ensureConnection();
-            try {
-                outputStream.writeObject("exit");
-                connectionEstablished = false;
-                deleteProperties();
-            } catch (IOException ex) {
-                throw new JemmyException("Failed to invoke exit", ex);
-            }
-        }
-    }
-
-    private Object makeAnOperationLocally(String method, Object[] params, Class[] paramClasses) {
-        if (robotReference == null) {
-            initRobot();
-        }
-        try {
-            convert(method, params, paramClasses);
-            Object result = robotReference.invokeMethod(method, params, paramClasses);
-            synchronizeRobot();
-            return result;
-        } catch (InvocationTargetException e) {
-            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
-        } catch (IllegalStateException e) {
-            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
-        } catch (NoSuchMethodException e) {
-            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
-        } catch (IllegalAccessException e) {
-            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
-        }
-    }
-
-    private int convert(Object obj) {
-        if (MouseButton.class.isAssignableFrom(obj.getClass())) {
-            return awtMap.convert((MouseButton)obj);
-        } else if (KeyboardButton.class.isAssignableFrom(obj.getClass())) {
-            return awtMap.convert((KeyboardButton)obj);
-        } else {
-            throw new JemmyException("Unable to recognize object", obj);
-        }
-    }
-
-    private static final Set<String> convertables = new HashSet<String>(Arrays.asList(new String[] {"mousePress", "mouseRelease", "keyPress", "keyRelease"}));
-
-    private void convert(String method, Object[] params, Class[] paramClasses) {
-        if (convertables.contains(method))
-            for (int i = 0; i < params.length; i++) {
-            params[i] = new Integer(convert(params[i]));
-            paramClasses[i] = Integer.TYPE;
-        }
-    }
-
-    public static void main(String[] args) {
-        System.setProperty("apple.awt.UIElement", "true");
-        if (args.length != 0 && args.length != 1) {
-            System.err.println("Usage: java ... [-D" +
-                    Environment.JEMMY_PROPERTIES_FILE_PROPERTY + "=" +
-                    "<.jemmy.properties full path>]" +
-                    " RobotExecutor [connectionPort]");
-            System.exit(-1);
-        }
-        if (args.length == 1) {
-            Environment.getEnvironment().setProperty(
-                    AWTRobotInputFactory.OTHER_VM_PORT_PROPERTY, args[0]);
-        }
-        RobotExecutor re = new RobotExecutor();
-        try {
-            re.server();
-        } catch (Exception ex) {
-            ex.printStackTrace(System.err);
-            System.err.flush();
-            System.exit(-1);
-        }
-    }
-
-    private File props;
-
-    private void deleteProperties() {
-        if (props != null) {
-            props.delete();
-            props = null;
-        }
-    }
-
-    private void prepareProperties() {
-        deleteProperties();
-        try {
-            props = File.createTempFile(".jemmy.othervm.", ".properties");
-            props.deleteOnExit();
-            PrintWriter fw = new PrintWriter(props);
-            for(Field f : AWTRobotInputFactory.class.getDeclaredFields()) {
-                if ((f.getModifiers() & Modifier.FINAL) != 0 &&
-                        (f.getModifiers() & Modifier.STATIC) != 0 &&
-                        f.getType().equals(String.class) &&
-                        f.getName().startsWith("OTHER_VM_") &&
-                        Environment.getEnvironment().getProperty((String)f.get(null)) != null) {
-                    fw.println(f.get(null) + "=" + Environment.getEnvironment().getProperty((String)f.get(null)));
-                }
-            }
-            fw.close();
-        } catch (IllegalArgumentException ex) {
-            throw new JemmyException("Failed to create temporary properties file: " + props.getAbsolutePath(), ex);
-        } catch (IllegalAccessException ex) {
-            throw new JemmyException("Failed to create temporary properties file: " + props.getAbsolutePath(), ex);
-        } catch (IOException ex) {
-            throw new JemmyException("Failed to create temporary properties file: " + props.getAbsolutePath(), ex);
-        }
-
-    }
-
-    private void startServer() {
-        try {
-            prepareProperties();
-            ProcessBuilder pb = new ProcessBuilder("java",
-                    //"-Xrunjdwp:transport=dt_socket,suspend=y,server=y,address=8000",
-                    "-cp", System.getProperty("java.class.path"),
-                    "-D" + Environment.JEMMY_PROPERTIES_FILE_PROPERTY +
-                    "=" + props.getAbsolutePath(),
-                    RobotExecutor.class.getName(),
-                    Integer.toString(connectionPort));
-            // TODO: Improve output
-//            System.out.println("Starting server");
-//            System.out.println("Command: " + pb.command());
-//            System.out.flush();
-            pb.redirectErrorStream(true);
-            final Process p = pb.start();
-            new Thread() {
-
-                @Override
-                public void run() {
-                    BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
-                    while (true) {
-                        try {
-                            String line = br.readLine();
-                            if (line == null) {
-                                break;
-                            }
-                            System.out.println("SERVER: " + line);
-                        } catch (IOException ex) {
-                            throw new JemmyException("Exception during other JVM output processing", ex);
-                        }
-                    }
-                }
-            }.start();
-        } catch (IOException ex) {
-            throw new JemmyException("Failed to start other JVM", ex);
-        }
-    }
-
-    public void ensureConnection() {
-        ensureInited();
-        if (runInOtherJVM && !connectionEstablished) {
-            initClientConnection();
-        }
-    }
-
-    private void initClientConnection() {
-        connectionHost = (String)Environment.getEnvironment().getProperty(
-             AWTRobotInputFactory.OTHER_VM_HOST_PROPERTY, "localhost");
-        connectionPort = Integer.parseInt((String)Environment.getEnvironment()
-             .getProperty(AWTRobotInputFactory.OTHER_VM_PORT_PROPERTY,
-             "53669"));
-        try {
-            try {
-                socket = new Socket(connectionHost, connectionPort);
-            } catch (IOException ex) {
-                if ("localhost".equalsIgnoreCase(connectionHost)
-                        || "127.0.0.1".equals(connectionHost)) {
-                    // TODO Improve check for localhost
-                    startServer();
-                    Environment.getEnvironment().getTimeout("");
-                    Timeout waitTime = new Timeout("connection wait time", 5 * 60000);
-                    socket = new Waiter(waitTime).ensureState(new State<Socket>() {
-                        Exception ex;
-                        public Socket reached() {
-                            Socket socket = null;
-                            try {
-                                socket = new Socket(connectionHost, connectionPort);
-                            } catch (UnknownHostException ex1) {
-                                ex = ex1;
-                            } catch (Exception ex1) {
-                                ex = ex1;
-                            }
-                            return socket;
-                        }
-
-                        @Override
-                        public String toString() {
-                            if (ex != null) {
-                                // TODO: Provide better mechanics for exception handling
-                                Logger.getLogger(RobotExecutor.class.getName())
-                                        .log(Level.INFO, null, ex);
-                            }
-                            return "Waiting for connection to be established " +
-                                    "with other JVM (" + connectionHost
-                                    + ":" + connectionPort + ", exception: " + ex + ")";
-                        }
-                    });
-                } else {
-                    throw new JemmyException("Failed to establish socket " +
-                            "connection with other JVM (" + connectionHost
-                            + ":" + connectionPort + ")", ex);
-                }
-            }
-            outputStream = new ObjectOutputStream(socket.getOutputStream());
-            inputStream = new ObjectInputStream(socket.getInputStream());
-
-            connectionEstablished = true;
-            ready = true;
-
-            System.out.println("Connection established!");
-            setAutoDelay(autoDelay);
-        } catch (IOException ex) {
-            throw new JemmyException("Failed to establish socket connection " +
-                    "with other JVM (" + connectionHost + ":" + connectionPort
-                    + ")", ex);
-        }
-    }
-
-    public synchronized Object getProperty(String name) {
-        ensureConnection();
-        try {
-            outputStream.writeObject("getProperty");
-            outputStream.writeObject(name);
-            Object result = inputStream.readObject();
-            String response = (String)(inputStream.readObject());
-            if (!"OK".equals(response)) {
-                throw new JemmyException("Remote operation didn't succeed");
-            }
-            return result;
-        } catch (ClassNotFoundException ex) {
-            throw new JemmyException("Socket communication with other JVM failed", ex);
-        } catch (OptionalDataException ex) {
-            throw new JemmyException("Socket communication with other JVM " +
-                    "failed: OptionalDataException eof = " + ex.eof + ", " +
-                    "length = " + ex.length, ex);
-        } catch (IOException ex) {
-            throw new JemmyException("Socket communication with other JVM failed", ex);
-        }
-    }
-
-    private synchronized Object makeAnOperationRemotely(String method, Object[] params, Class[] paramClasses) {
-        ensureConnection();
-        try {
-            outputStream.writeObject("makeAnOperation");
-            outputStream.writeObject(method);
-            outputStream.writeObject(params);
-            outputStream.writeObject(paramClasses);
-            Object result;
-            String response = (String)(inputStream.readObject());
-            if ("image".equals(response)) {
-                result = PNGDecoder.decode(inputStream, false);
-            } else {
-                if (!"OK".equals(response)) {
-                    throw new JemmyException("Remote operation didn't succeed");
-                }
-                result = inputStream.readObject();
-            }
-            return result;
-        } catch (ClassNotFoundException ex) {
-            throw new JemmyException("Socket communication with other JVM failed", ex);
-        } catch (OptionalDataException ex) {
-            throw new JemmyException("Socket communication with other JVM " +
-                    "failed: OptionalDataException eof = " + ex.eof + ", " +
-                    "length = " + ex.length, ex);
-        } catch (IOException ex) {
-            throw new JemmyException("Socket communication with other JVM failed", ex);
-        }
-    }
-
-    private void server() {
-        System.out.println("Robot ready!");
-        System.out.flush();
-        ServerSocket sc;
-        connectionPort = Integer.parseInt((String)Environment.getEnvironment()
-             .getProperty(AWTRobotInputFactory.OTHER_VM_PORT_PROPERTY,
-             "53669"));
-        while(true) {
-            Thread watchdog = new Thread("RobotExecutor.server watchdog") {
-
-                @Override
-                public void run() {
-                    try {
-                        Thread.sleep(CONNECTION_TIMEOUT);
-                        System.out.println("Exiting server as there is no " +
-                                "connection for " + CONNECTION_TIMEOUT / 60000.0
-                                + " minutes");
-                        System.out.flush();
-                        System.exit(0);
-                    } catch (InterruptedException ex) {
-                        // Ignoring exception as it is okay
-                    }
-                }
-
-            };
-            watchdog.start();
-            System.out.println("Waiting for incoming connection for up to "
-                    + CONNECTION_TIMEOUT / 60000.0 + " minutes");
-            try {
-                sc = new ServerSocket(connectionPort);
-                socket = sc.accept();
-                watchdog.interrupt();
-            } catch (IOException ex) {
-                throw new JemmyException("Can't establish connection with client", ex);
-            }
-            System.out.println("Connection established!");
-            try {
-                inputStream = new ObjectInputStream(socket.getInputStream());
-                outputStream = new ObjectOutputStream(socket.getOutputStream());
-                while(true) {
-                    String command = (String)inputStream.readObject();
-                    if ("exit".equals(command)) {
-                        System.exit(0);
-                    }
-                    if ("getProperty".equals(command)) {
-                        String property = (String)inputStream.readObject();
-                        outputStream.writeObject(Environment.getEnvironment().getProperty(property));
-                        outputStream.writeObject("OK");
-                    }
-                    if ("makeAnOperation".equals(command)) {
-                        String method = (String)inputStream.readObject();
-                        Object[] params = (Object[])inputStream.readObject();
-                        Class[] paramClasses = (Class[])inputStream.readObject();
-                        Object result = makeAnOperationLocally(method, params,
-                                paramClasses);
-                        if (result instanceof BufferedImage) {
-                            outputStream.writeObject("image");
-                            BufferedImage image = BufferedImage.class.cast(result);
-                            new PNGEncoder(outputStream, PNGEncoder.COLOR_MODE)
-                                    .encode(image, false);
-                        } else {
-                            outputStream.writeObject("OK");
-                            outputStream.writeObject(result);
-                        }
-                    }
-                }
-            } catch (ClassNotFoundException ex) {
-                throw new JemmyException("Socket communication with other " +
-                        "JVM failed", ex);
-            } catch (IOException ex) {
-                Logger.getLogger(RobotExecutor.class.getName())
-                        .log(Level.SEVERE, null, ex);
-            } finally {
-                if (socket != null) {
-                    try {
-                        socket.close();
-                    } catch (IOException ex) {
-                        Logger.getLogger(RobotExecutor.class.getName()).log(
-                                Level.SEVERE, "Exception during socket closing", ex);
-                    }
-                }
-                if (sc != null) {
-                    try {
-                        sc.close();
-                    } catch (IOException ex) {
-                        Logger.getLogger(RobotExecutor.class.getName()).log(
-                                Level.SEVERE, "Exception during server socket " +
-                                "closing", ex);
-                    }
-                }
-            }
-        }
-    }
-
-    private void initRobot() {
-        // need to init Robot in dispatch thread because it hangs on Linux
-        // (see http://www.netbeans.org/issues/show_bug.cgi?id=37476)
-        if (EventQueue.isDispatchThread()) {
-            doInitRobot();
-        } else {
-            try {
-                EventQueue.invokeAndWait(new Runnable() {
-
-                    public void run() {
-                        doInitRobot();
-                    }
-                });
-            } catch (InterruptedException ex) {
-                throw new JemmyException("Failed to initialize robot", ex);
-            } catch (InvocationTargetException ex) {
-                throw new JemmyException("Failed to initialize robot", ex);
-            }
-        }
-    }
-
-    private void doInitRobot() {
-        try {
-            ClassReference robotClassReverence = new ClassReference("java.awt.Robot");
-            robotReference = new ClassReference(robotClassReverence.newInstance(null, null));
-            if (awtMap == null) {
-                awtMap = new AWTMap();
-            }
-            setAutoDelay(autoDelay);
-            ready = true;
-        } catch (InvocationTargetException e) {
-            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
-        } catch (IllegalStateException e) {
-            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
-        } catch (NoSuchMethodException e) {
-            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
-        } catch (IllegalAccessException e) {
-            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
-        } catch (ClassNotFoundException e) {
-            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
-        } catch (InstantiationException e) {
-            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
-        }
-    }
-
-    /**
-     * Calls <code>java.awt.Robot.waitForIdle()</code> method.
-     */
-    protected void synchronizeRobot() {
-        ensureInited();
-        if (!runInOtherJVM) {
-            // TODO: It looks like this method is rudimentary
-            if (!EventQueue.isDispatchThread()) {
-                if (robotReference == null) {
-                    initRobot();
-                }
-                try {
-                    robotReference.invokeMethod("waitForIdle", null, null);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-    }
-
-    public void setAutoDelay(Timeout autoDelay) {
-        this.autoDelay = autoDelay;
-        if (ready) {
-            makeAnOperation("setAutoDelay", new Object[]{new Integer((int) ((autoDelay != null) ? autoDelay.getValue() : 0))}, new Class[]{Integer.TYPE});
-        }
-    }
-
-    public boolean isRunInOtherJVM() {
-        ensureInited();
-        return runInOtherJVM;
-    }
-
-    public void setRunInOtherJVM(boolean runInOtherJVM) {
-        if (inited && this.runInOtherJVM && this.connectionEstablished && !runInOtherJVM) {
-            shutdownConnection();
-        }
-        this.runInOtherJVM = runInOtherJVM;
-        inited = true;
-        ready = false;
-    }
-
-    private void shutdownConnection() {
-        try {
-            outputStream.writeObject("exit");
-            socket.close();
-            connectionEstablished = false;
-        } catch (IOException ex) {
-            throw new JemmyException("Failed to shutdown connection", ex);
-        }
-    }
-}
--- a/core/JemmyAWTInput/src/org/jemmy/input/Version.java	Tue Jan 08 15:44:49 2019 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.jemmy.input;
-
-/**
- *
- * @author shura
- */
-public class Version extends org.jemmy.Version {
-
-    public static final Version VERSION = new Version();
-
-    public Version() {
-        super(Version.class.getPackage().getName());
-    }
-
-    public static void main(String[] args) {
-        System.out.println("JemmyAWTInput version: " + VERSION.getVersion());
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/input/awt/AWTMap.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.input.awt;
+
+
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.jemmy.JemmyException;
+import org.jemmy.interfaces.Keyboard.KeyboardButton;
+import org.jemmy.interfaces.Keyboard.KeyboardButtons;
+import org.jemmy.interfaces.Keyboard.KeyboardModifiers;
+import org.jemmy.interfaces.Modifier;
+import org.jemmy.interfaces.Mouse.MouseButton;
+import org.jemmy.interfaces.Mouse.MouseButtons;
+import org.jemmy.interfaces.Mouse.MouseModifiers;
+
+
+/**
+ * Converts
+ * @author mrkam
+ */
+public class AWTMap {
+
+    private static Map<Integer, KeyboardButton> int2key = new HashMap<Integer, KeyboardButton>();
+    private static Map<Integer, Modifier> int2modifier = new HashMap<Integer, Modifier>();
+    private static Map<Integer, MouseButton> int2button = new HashMap<Integer, MouseButton>();
+    private static Map<KeyboardButton, Integer> key2int = new HashMap<KeyboardButton, Integer>();
+    private static Map<Modifier, Integer> modifier2int = new HashMap<Modifier, Integer>();
+    private static Map<MouseButton, Integer> button2int = new HashMap<MouseButton, Integer>();
+
+    static {
+        for (KeyboardButtons button : KeyboardButtons.values()) {
+            String name = button.name();
+            try {
+                int key = KeyEvent.VK_UNDEFINED;
+                if (name.length() == 2 && name.startsWith("D")) {
+                    // digit
+                    key = KeyEvent.class.getDeclaredField("VK_" + name.substring(1)).getInt(null);
+                } else {
+                    key = KeyEvent.class.getDeclaredField("VK_" + name).getInt(null);
+                }
+                int2key.put(key, button);
+                key2int.put(button, key);
+            } catch (NoSuchFieldException ex) {
+                throw new JemmyException("Unable to recognize key", ex, button);
+            } catch (SecurityException ex) {
+                throw new JemmyException("Unable to recognize key", ex, button);
+            } catch (IllegalArgumentException ex) {
+                throw new JemmyException("Unable to recognize key", ex, button);
+            } catch (IllegalAccessException ex) {
+                throw new JemmyException("Unable to recognize key", ex, button);
+            }
+        }
+        for (KeyboardModifiers modifier : KeyboardModifiers.values()) {
+            String name = modifier.name();
+            try {
+                int key = InputEvent.class.getDeclaredField(name).getInt(null);
+                int2modifier.put(key, modifier);
+                modifier2int.put(modifier, key);
+            } catch (NoSuchFieldException ex) {
+                throw new JemmyException("Unable to recognize modifier", ex, modifier);
+            } catch (SecurityException ex) {
+                throw new JemmyException("Unable to recognize modifier", ex, modifier);
+            } catch (IllegalArgumentException ex) {
+                throw new JemmyException("Unable to recognize modifier", ex, modifier);
+            } catch (IllegalAccessException ex) {
+                throw new JemmyException("Unable to recognize modifier", ex, modifier);
+            }
+        }
+        for (MouseModifiers modifier : MouseModifiers.values()) {
+            String name = modifier.name();
+            try {
+                int key = InputEvent.class.getDeclaredField(name).getInt(null);
+                int2modifier.put(key, modifier);
+                modifier2int.put(modifier, key);
+            } catch (NoSuchFieldException ex) {
+                throw new JemmyException("Unable to recognize modifier", ex, modifier);
+            } catch (SecurityException ex) {
+                throw new JemmyException("Unable to recognize modifier", ex, modifier);
+            } catch (IllegalArgumentException ex) {
+                throw new JemmyException("Unable to recognize modifier", ex, modifier);
+            } catch (IllegalAccessException ex) {
+                throw new JemmyException("Unable to recognize modifier", ex, modifier);
+            }
+        }
+        for (MouseButtons button : MouseButtons.values()) {
+            String name = button.name();
+            try {
+                int key = InputEvent.class.getDeclaredField(name + "_MASK").getInt(null);
+                int2button.put(key, button);
+                button2int.put(button, key);
+            } catch (NoSuchFieldException ex) {
+                throw new JemmyException("Unable to recognize button", ex, button);
+            } catch (SecurityException ex) {
+                throw new JemmyException("Unable to recognize button", ex, button);
+            } catch (IllegalArgumentException ex) {
+                throw new JemmyException("Unable to recognize button", ex, button);
+            } catch (IllegalAccessException ex) {
+                throw new JemmyException("Unable to recognize button", ex, button);
+            }
+        }
+    }
+
+    /**
+     * TODO Provide javadoc
+     * @param button todo document
+     * @return One of InputEvent.VK_* constants
+     * @see InputEvent
+     */
+    public int convert(KeyboardButton button) {
+        try {
+            return key2int.get(button);
+        } catch(Exception e) {
+            throw new JemmyException("Unable to recognize key", e, button);
+        }
+    }
+
+    public int convert(Modifier... modifiers) {
+        int result = 0;
+        for (Modifier modifier : modifiers) {
+            try {
+                result |= modifier2int.get(modifier);
+            } catch (Exception e) {
+                throw new JemmyException("Unable to recognize modifier", e, modifier);
+            }
+        }
+        return result;
+    }
+
+    public int convert(MouseButton button) {
+        try {
+            return button2int.get(button);
+        } catch (Exception e) {
+            throw new JemmyException("Unable to recognize mouse button", e, button);
+        }
+    }
+
+    public KeyboardButton convertKeyboardButton(int key) {
+        KeyboardButton res = int2key.get(key);
+        if (res == null) {
+            throw new JemmyException("Unable to recognize key", key);
+        }
+        return res;
+    }
+
+    public Modifier[] convertModifiers(int modifiers) {
+        List<Modifier> result = new ArrayList<Modifier>();
+        for (int key : int2modifier.keySet()) {
+            if ((key & modifiers) != 0) {
+                Modifier res = int2modifier.get(key);
+                if (res == null) {
+                    throw new JemmyException("Unable to recognize modifiers", modifiers);
+                }
+                result.add(res);
+            }
+        }
+        return result.toArray(new Modifier[result.size()]);
+    }
+
+    public MouseButton convertMouseButton(int button) {
+        MouseButton res = int2button.get(button);
+        if (res == null) {
+            throw new JemmyException("Unable to recognize mouse button", button);
+        }
+        return res;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/JemmyAWTInput/src/org/jemmy/input/awt/AWTRobotInputFactory.java	Mon Jun 03 11:12:19 2019 -0700
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.jemmy.input.awt;
+
+import org.jemmy.JemmyException;
+import org.jemmy.control.Wrap;
+import org.jemmy.env.Environment;
+import org.jemmy.interfaces.ControlInterface;
+import org.jemmy.interfaces.ControlInterfaceFactory;
+import org.jemmy.interfaces.Drag;
+import org.jemmy.interfaces.Keyboard;
+import org.jemmy.interfaces.Mouse;
+import org.jemmy.interfaces.TypeControlInterface;
+import org.jemmy.operators.awt.AWTScreen;
+import org.jemmy.operators.Screen;
+
+/**
+ *
+ * @author shura
+ */
+public class AWTRobotInputFactory implements ControlInterfaceFactory {
+
+    /**
+     * Set this Environment property to true or false to run java.awt.Robot in
+     * other or the same JVM
+     */
+    public static final String OTHER_VM_PROPERTY = "awt.robot.othervm";
+
+    /**
+     * Set this Environment property to the name of the host where other JVM runs.
+     * 'localhost' by default
+     */
+    public static final String OTHER_VM_HOST_PROPERTY = "awt.robot.othervm.host";
+
+    /**
+     * Set this Environment property to override the port which is used to
+     * connect to other JVM
+     */
+    public static final String OTHER_VM_PORT_PROPERTY = "awt.robot.othervm.port";
+
+    /**
+     * Set this Environment property to to the maximum time of waiting for the
+     * client to connect to the JVM where Robot is running. It also waits the same
+     * amount of ms for the next connection after the previous terminates.
+     * Default is 15 min.
+     */
+    public static final String OTHER_VM_CONNECTION_TIMEOUT_PROPERTY
+            = "awt.robot.othervm.connection.timeout";
+
+    /**
+     * The name of the timeout that is used by default as the delay time for
+     * java.awt.Robot
+     * @see java.awt.Robot#setAutoDelay(int)
+     */
+    public static final String ROBOT_DELAY_TIMEOUT_NAME = "RobotDriver.DelayTimeout";
+
+    /**
+     * Set this Environment property to the maximum number of pixels between
+     * mouse positions during movement
+     */
+    public static final String ROBOT_MOUSE_SMOOTHNESS_PROPERTY = "awt.robot.mouse.smoothness";
+
+    /**
+     * Specifies whether to run java.awt.Robot in other JVM
+     * @param runInOtherJVM if true then java.awt.Robot will run in other JVM
+     */
+    public static void runInOtherJVM(boolean runInOtherJVM) {
+        RobotExecutor.get().setRunInOtherJVM(runInOtherJVM);
+    }
+
+    /**
+     * Returns runInOtherJVM setting
+     * @return if true then java.awt.Robot is running in other JVM
+     */
+    public static boolean isRunInOtherJVM() {
+        return RobotExecutor.get().isRunInOtherJVM();
+    }
+
+    /**
+     * Specifies mouse movements smoothness
+     * @param mouseSmoothness the maximum number of pixels between
+     * mouse positions during movement
+     * @see #ROBOT_MOUSE_SMOOTHNESS_PROPERTY
+     */
+    public static void setMouseSmoothness(int mouseSmoothness) {
+        if(mouseSmoothness <= 0) {
+            throw new IllegalArgumentException("Mouse smoothness should be greater than zero.");
+        }
+        RobotDriver.setMouseSmoothness(mouseSmoothness);
+    }
+
+    /**
+     * Gets the mouse movements smoothness
+     * @return the maximum number of pixels between
+     * mouse positions during movement
+     * @see #ROBOT_MOUSE_SMOOTHNESS_PROPERTY
+     */
+    public static int getMouseSmoothness() {
+        return RobotDriver.getMouseSmoothness();
+    }
+
+    static {
+        if(Screen.SCREEN == null) {
+            Screen.setSCREEN(new AWTScreen(Environment.getEnvironment()));
+        }
+    }
+