< prev index next >

test/jdk/java/awt/GradientPaint/LinearColorSpaceGradientTest.java

Print this page




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.*;
  25 import java.awt.MultipleGradientPaint.*;
  26 import java.awt.geom.*;
  27 import java.awt.image.*;
  28 
  29 /**
  30  * @test
  31  * @key headful
  32  * @bug 8023483
  33  * @summary tests wether the colorspace-parameter is applied correctly when
  34  *          creating a gradient.
  35  * @author ceisserer
  36  */
  37 public class LinearColorSpaceGradientTest extends Frame {
  38     BufferedImage srcImg;
  39     Image dstImg;
  40 
  41     public LinearColorSpaceGradientTest() {
  42         srcImg = createSrcImage();
  43         dstImg = getGraphicsConfiguration().createCompatibleVolatileImage(20,
  44                 20);
  45     }
  46 
  47     protected void renderToVI(BufferedImage src, Image dst) {
  48         Graphics2D g = (Graphics2D) dst.getGraphics();
  49 
  50         g.setColor(Color.WHITE);
  51         g.fillRect(0, 0, dst.getWidth(null), dst.getHeight(null));
  52 
  53         AffineTransform at = new AffineTransform();




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.*;
  25 import java.awt.MultipleGradientPaint.*;
  26 import java.awt.geom.*;
  27 import java.awt.image.*;
  28 
  29 /**
  30  * @test
  31  * @key headful
  32  * @bug 8023483
  33  * @summary tests whether the colorspace-parameter is applied correctly when
  34  *          creating a gradient.
  35  * @author ceisserer
  36  */
  37 public class LinearColorSpaceGradientTest extends Frame {
  38     BufferedImage srcImg;
  39     Image dstImg;
  40 
  41     public LinearColorSpaceGradientTest() {
  42         srcImg = createSrcImage();
  43         dstImg = getGraphicsConfiguration().createCompatibleVolatileImage(20,
  44                 20);
  45     }
  46 
  47     protected void renderToVI(BufferedImage src, Image dst) {
  48         Graphics2D g = (Graphics2D) dst.getGraphics();
  49 
  50         g.setColor(Color.WHITE);
  51         g.fillRect(0, 0, dst.getWidth(null), dst.getHeight(null));
  52 
  53         AffineTransform at = new AffineTransform();


< prev index next >