/hg/gfx-test: Updated all callbacks classes to use CommonCallbac...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Mon Aug 6 03:34:41 PDT 2012


changeset f5a7ad12f58d in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=f5a7ad12f58d
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Aug 06 12:37:20 2012 +0200

	Updated all callbacks classes to use CommonCallbacks abstract class as theirs ancestor.
	Added new classes containing callback methods used during rendering quadratic curves.


diffstat:

 ChangeLog                                                 |  24 ++++
 Makefile                                                  |   2 +
 src/org/gfxtest/callbacks/CommonCallbacks.java            |  80 +++++++++++++++
 src/org/gfxtest/callbacks/CommonCircleDrawCallbacks.java  |  20 +--
 src/org/gfxtest/callbacks/CommonCurveDrawCallbacks.java   |  19 +--
 src/org/gfxtest/callbacks/CommonEllipseDrawCallbacks.java |  22 +--
 src/org/gfxtest/callbacks/CommonLineDrawCallbacks.java    |  19 +--
 src/org/gfxtest/callbacks/CubicCurveDrawCallback.java     |  68 ------------
 src/org/gfxtest/callbacks/CubicCurveDrawCallbacks.java    |  76 ++++++++++++++
 src/org/gfxtest/callbacks/PolygonDrawCallbacks.java       |  26 +---
 src/org/gfxtest/callbacks/PolylineDrawCallbacks.java      |  26 +---
 src/org/gfxtest/callbacks/QudraticCurveDrawCallbacks.java |  72 +++++++++++++
 src/org/gfxtest/callbacks/RectangleDrawCallbacks.java     |  26 +---
 src/org/gfxtest/framework/PrintTest.java                  |   5 +
 src/org/gfxtest/testsuites/PrintTestPaths.java            |   4 +-
 15 files changed, 313 insertions(+), 176 deletions(-)

diffs (truncated from 788 to 500 lines):

diff -r c1e86da11351 -r f5a7ad12f58d ChangeLog
--- a/ChangeLog	Wed Aug 01 10:48:19 2012 +0200
+++ b/ChangeLog	Mon Aug 06 12:37:20 2012 +0200
@@ -1,3 +1,27 @@
+2012-08-06  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/callbacks/CommonCallbacks.java:
+	Added this abstract class which should be an ancestor of all callback classes.
+	* src/org/gfxtest/callbacks/CommonCircleDrawCallbacks.java:
+	* src/org/gfxtest/callbacks/CommonCurveDrawCallbacks.java:
+	* src/org/gfxtest/callbacks/CommonEllipseDrawCallbacks.java:
+	* src/org/gfxtest/callbacks/CommonLineDrawCallbacks.java:
+	* src/org/gfxtest/callbacks/PolygonDrawCallbacks.java:
+	* src/org/gfxtest/callbacks/PolylineDrawCallbacks.java:
+	* src/org/gfxtest/callbacks/RectangleDrawCallbacks.java:
+	Updated to use CommonCallbacks abstract class as theirs ancestor.
+	* src/org/gfxtest/callbacks/QudraticCurveDrawCallbacks.java:
+	Added new classes containing callback methods used during rendering
+	quadratic curves.
+	* src/org/gfxtest/callbacks/CubicCurveDrawCallback.java:
+	* src/org/gfxtest/callbacks/CubicCurveDrawCallbacks.java:
+	Renamed to be more consistent with other callback classes.
+	* src/org/gfxtest/framework/PrintTest.java:
+	Added new constant.
+	* src/org/gfxtest/testsuites/PrintTestPaths.java:
+	Changed import directive.
+	* Makefile: Updated - added new classes to compile.
+
 2012-08-01  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/testsuites/PrintTestPaths.java:
diff -r c1e86da11351 -r f5a7ad12f58d Makefile
--- a/Makefile	Wed Aug 01 10:48:19 2012 +0200
+++ b/Makefile	Mon Aug 06 12:37:20 2012 +0200
@@ -96,11 +96,13 @@
 	$(CLASSES)/$(FRAMEWORK_DIR)/ImageFactory.class \
 	$(CLASSES)/$(FRAMEWORK_DIR)/PostScriptToPngConverter.class \
 	$(CLASSES)/$(FRAMEWORK_DIR)/PrintJobWatcher.class \
+	$(CLASSES)/$(CALLBACKS_DIR)/CommonCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/CommonCircleDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/CommonCurveDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/CommonEllipseDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/CommonLineDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/CubicCurveDrawCallbacks.class \
+	$(CLASSES)/$(CALLBACKS_DIR)/QuadraticCurveDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/HorizontalLineDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/VerticalLineDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/DiagonalLineDrawCallbacks.class \
diff -r c1e86da11351 -r f5a7ad12f58d src/org/gfxtest/callbacks/CommonCallbacks.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/gfxtest/callbacks/CommonCallbacks.java	Mon Aug 06 12:37:20 2012 +0200
@@ -0,0 +1,80 @@
+/*
+  Java gfx-test framework
+
+   Copyright (C) 2012  Red Hat
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.
+ */
+
+package org.gfxtest.callbacks;
+
+import java.awt.Graphics2D;
+
+
+
+import org.gfxtest.framework.TestImage;
+
+/**
+ * Base class for all callbacks classes .
+ * 
+ * @author Pavel Tisnovsky
+ */
+public abstract class CommonCallbacks
+{
+    /**
+     * Image to which circles are to be drawn.
+     */
+    protected TestImage image;
+
+    /**
+     * Graphics canvas.
+     */
+    protected Graphics2D graphics;
+
+    /**
+     * Setup phase.
+     * 
+     * @param image
+     *            image to which circles are to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     */
+    public abstract void setup(TestImage image, Graphics2D graphics);
+
+    /**
+     * Cleanup phase.
+     */
+    public abstract void cleanup();
+}
diff -r c1e86da11351 -r f5a7ad12f58d src/org/gfxtest/callbacks/CommonCircleDrawCallbacks.java
--- a/src/org/gfxtest/callbacks/CommonCircleDrawCallbacks.java	Wed Aug 01 10:48:19 2012 +0200
+++ b/src/org/gfxtest/callbacks/CommonCircleDrawCallbacks.java	Mon Aug 06 12:37:20 2012 +0200
@@ -56,26 +56,17 @@
  * 
  * @author Pavel Tisnovsky
  */
-public abstract class CommonCircleDrawCallbacks
+public abstract class CommonCircleDrawCallbacks extends CommonCallbacks
 {
     /**
-     * Image to which circles are to be drawn.
-     */
-    protected TestImage image;
-
-    /**
-     * Graphics canvas.
-     */
-    protected Graphics2D graphics;
-
-    /**
-     * Setup phase.
+     * Setup phase. @see CommonCallbacks#setup(TestImage, Graphics2D)
      * 
      * @param image
      *            image to which circles are to be drawn
      * @param graphics2d
      *            graphics canvas
      */
+    @Override
     public void setup(TestImage image, Graphics2D graphics)
     {
         this.image = image;
@@ -92,7 +83,7 @@
      * @param y
      *            vertical coordinate of a circle center
      * @param radius
-     *            circle radius
+     *            circle radius (might be different for each rendered circle)
      * @param maxRadius
      *            maximum allowable circle radius
      * @param colorIndex 
@@ -101,8 +92,9 @@
     public abstract void iterationCallBack(int x, int y, int radius, int maxRadius, int colorIndex);
 
     /**
-     * Cleanup phase.
+     * Cleanup phase. {@see CommonCallbacks#cleanup()}
      */
+    @Override
     public void cleanup()
     {
         return;
diff -r c1e86da11351 -r f5a7ad12f58d src/org/gfxtest/callbacks/CommonCurveDrawCallbacks.java
--- a/src/org/gfxtest/callbacks/CommonCurveDrawCallbacks.java	Wed Aug 01 10:48:19 2012 +0200
+++ b/src/org/gfxtest/callbacks/CommonCurveDrawCallbacks.java	Mon Aug 06 12:37:20 2012 +0200
@@ -53,29 +53,21 @@
 
 /**
  * Class representing set of callback methods called for each rendered curve.
+ * This class should be inherited for each curve type (quadratic, cubic...)
  * 
  * @author Pavel Tisnovsky
  */
-public abstract class CommonCurveDrawCallbacks
+public abstract class CommonCurveDrawCallbacks extends CommonCallbacks
 {
     /**
-     * Image to which curve are to be drawn.
-     */
-    protected TestImage image;
-
-    /**
-     * Graphics canvas.
-     */
-    protected Graphics2D graphics;
-
-    /**
-     * Setup phase.
+     * Setup phase. @see CommonCallbacks#setup(TestImage, Graphics2D)
      * 
      * @param image
      *            image to which curves are to be drawn
      * @param graphics2d
      *            graphics canvas
      */
+    @Override
     public void setup(TestImage image, Graphics2D graphics)
     {
         this.image = image;
@@ -85,8 +77,9 @@
     }
 
     /**
-     * Cleanup phase.
+     * Cleanup phase. {@see CommonCallbacks#cleanup()}
      */
+    @Override
     public void cleanup()
     {
         return;
diff -r c1e86da11351 -r f5a7ad12f58d src/org/gfxtest/callbacks/CommonEllipseDrawCallbacks.java
--- a/src/org/gfxtest/callbacks/CommonEllipseDrawCallbacks.java	Wed Aug 01 10:48:19 2012 +0200
+++ b/src/org/gfxtest/callbacks/CommonEllipseDrawCallbacks.java	Mon Aug 06 12:37:20 2012 +0200
@@ -56,26 +56,17 @@
  * 
  * @author Pavel Tisnovsky
  */
-public abstract class CommonEllipseDrawCallbacks
+public abstract class CommonEllipseDrawCallbacks extends CommonCallbacks
 {
     /**
-     * Image to which ellipses are to be drawn.
-     */
-    protected TestImage image;
-
-    /**
-     * Graphics canvas.
-     */
-    protected Graphics2D graphics;
-
-    /**
-     * Setup phase.
+     * Setup phase. @see CommonCallbacks#setup(TestImage, Graphics2D)
      * 
      * @param image
      *            image to which ellipse are to be drawn
      * @param graphics2d
      *            graphics canvas
      */
+    @Override
     public void setup(TestImage image, Graphics2D graphics)
     {
         this.image = image;
@@ -92,7 +83,7 @@
      * @param y
      *            vertical coordinate of an ellipse center
      * @param radius
-     *            ellipse radius
+     *            ellipse radius (should be different for each rendered ellipse)
      * @param maxRadius
      *            maximum allowable ellipse radius (radius of major axe)
      * @param colorIndex 
@@ -101,11 +92,12 @@
     public abstract void iterationCallBack(int x, int y, int radius, int maxRadius, int colorIndex);
 
     /**
-     * Cleanup phase.
+     * Cleanup phase. {@see CommonCallbacks#cleanup()}
      */
+    @Override
     public void cleanup()
     {
         return;
     }
-    
+
 }
diff -r c1e86da11351 -r f5a7ad12f58d src/org/gfxtest/callbacks/CommonLineDrawCallbacks.java
--- a/src/org/gfxtest/callbacks/CommonLineDrawCallbacks.java	Wed Aug 01 10:48:19 2012 +0200
+++ b/src/org/gfxtest/callbacks/CommonLineDrawCallbacks.java	Mon Aug 06 12:37:20 2012 +0200
@@ -53,29 +53,21 @@
 
 /**
  * Class representing set of callback methods called for each rendered line.
+ * Should be subclassed so this class is abstract.
  * 
  * @author Pavel Tisnovsky
  */
-public abstract class CommonLineDrawCallbacks
+public abstract class CommonLineDrawCallbacks extends CommonCallbacks
 {
     /**
-     * Image to which lines are to be drawn.
-     */
-    protected TestImage image;
-
-    /**
-     * Graphics canvas.
-     */
-    protected Graphics2D graphics;
-
-    /**
-     * Setup phase.
+     * Setup phase. @see CommonCallbacks#setup(TestImage, Graphics2D)
      * 
      * @param image
      *            image to which lines are to be drawn
      * @param graphics2d
      *            graphics canvas
      */
+    @Override
     public void setup(TestImage image, Graphics2D graphics)
     {
         this.image = image;
@@ -85,8 +77,9 @@
     }
 
     /**
-     * Cleanup phase.
+     * Cleanup phase. {@see CommonCallbacks#cleanup()} 
      */
+    @Override
     public void cleanup()
     {
         return;
diff -r c1e86da11351 -r f5a7ad12f58d src/org/gfxtest/callbacks/CubicCurveDrawCallback.java
--- a/src/org/gfxtest/callbacks/CubicCurveDrawCallback.java	Wed Aug 01 10:48:19 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-  Java gfx-test framework
-
-   Copyright (C) 2012  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea 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 for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
- */
-
-package org.gfxtest.callbacks;
-
-
-
-/**
- * Class representing set of callback methods called for each rendered
- * cubic curve.
- * 
- * @author Pavel Tisnovsky
- */
-public abstract class CubicCurveDrawCallback extends CommonCurveDrawCallbacks
-{
-    /**
-     * Called for each rendered cubic curve.
-     * 
-     * @param x1
-     *            the first point's x coordinate.
-     * @param y1
-     *            the first point's y coordinate.
-     * @param x2
-     *            the second point's x coordinate.
-     * @param y2
-     *            the second point's y coordinate.
-     * @param index
-     *            curve index
-     */
-    public abstract void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index);
-}
diff -r c1e86da11351 -r f5a7ad12f58d src/org/gfxtest/callbacks/CubicCurveDrawCallbacks.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/gfxtest/callbacks/CubicCurveDrawCallbacks.java	Mon Aug 06 12:37:20 2012 +0200
@@ -0,0 +1,76 @@
+/*
+  Java gfx-test framework
+
+   Copyright (C) 2012  Red Hat
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.
+ */
+
+package org.gfxtest.callbacks;
+
+
+
+/**
+ * Class representing set of callback methods called for each rendered
+ * cubic curve.
+ * 
+ * @author Pavel Tisnovsky
+ */
+public abstract class CubicCurveDrawCallbacks extends CommonCurveDrawCallbacks
+{
+    /**
+     * Called for each rendered cubic curve.
+     * 
+     * @param x1
+     *            the first point's x coordinate.
+     * @param y1
+     *            the first point's y coordinate.
+     * @param x2
+     *            the second point's x coordinate.
+     * @param y2
+     *            the second point's y coordinate.
+     * @param x3
+     *            third point's x coordinate.
+     * @param y3
+     *            third point's y coordinate.
+     * @param x4
+     *            fourth point's x coordinate.
+     * @param y4
+     *            fourth point's y coordinate.
+     * @param index
+     *            curve index
+     */
+    public abstract void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index);
+}
diff -r c1e86da11351 -r f5a7ad12f58d src/org/gfxtest/callbacks/PolygonDrawCallbacks.java
--- a/src/org/gfxtest/callbacks/PolygonDrawCallbacks.java	Wed Aug 01 10:48:19 2012 +0200
+++ b/src/org/gfxtest/callbacks/PolygonDrawCallbacks.java	Mon Aug 06 12:37:20 2012 +0200
@@ -57,26 +57,17 @@
  * 
  * @author Pavel Tisnovsky
  */
-public abstract class PolygonDrawCallbacks
+public abstract class PolygonDrawCallbacks extends CommonCallbacks
 {



More information about the distro-pkg-dev mailing list