< prev index next >

test/javax/swing/SwingUtilities/8032219/DrawRect.java

Print this page


   1 /*
   2  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  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 sun.swing.SwingUtilities2;
  25 
  26 import java.awt.Color;
  27 import java.awt.Graphics2D;
  28 import java.awt.Rectangle;
  29 import java.awt.image.BufferedImage;
  30 import java.io.File;
  31 import java.io.IOException;
  32 
  33 import javax.imageio.ImageIO;
  34 
  35 /**
  36  * @test
  37  * @bug 8032219
  38  * @author Sergey Bylokhov

  39  */
  40 public final class DrawRect {
  41 
  42     private static final int size = 50;
  43 
  44     private static final Rectangle[] rects = {
  45             new Rectangle(0, 0, 1, 1),
  46             new Rectangle(0, 0, 1, 2),
  47             new Rectangle(0, 0, 2, 1),
  48             new Rectangle(10, 10, 10, 10),
  49             new Rectangle(10, 10, -1, -1),
  50             new Rectangle(-1, -1, 10, 10),
  51             new Rectangle(-1, -1, -10, -10),
  52             new Rectangle(0, 0, size, size),
  53     };
  54 
  55     private static final Rectangle[] vlines = {new Rectangle(0, 0, 0, 0),
  56             new Rectangle(0, 0, 0, 1),
  57             new Rectangle(0, 0, 0, -1),
  58             new Rectangle(1, 1, 0, 1),


   1 /*
   2  * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  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 sun.swing.SwingUtilities2;
  25 
  26 import java.awt.Color;
  27 import java.awt.Graphics2D;
  28 import java.awt.Rectangle;
  29 import java.awt.image.BufferedImage;
  30 import java.io.File;
  31 import java.io.IOException;
  32 
  33 import javax.imageio.ImageIO;
  34 
  35 /**
  36  * @test
  37  * @bug 8032219
  38  * @author Sergey Bylokhov
  39  * @modules java.desktop/sun.swing
  40  */
  41 public final class DrawRect {
  42 
  43     private static final int size = 50;
  44 
  45     private static final Rectangle[] rects = {
  46             new Rectangle(0, 0, 1, 1),
  47             new Rectangle(0, 0, 1, 2),
  48             new Rectangle(0, 0, 2, 1),
  49             new Rectangle(10, 10, 10, 10),
  50             new Rectangle(10, 10, -1, -1),
  51             new Rectangle(-1, -1, 10, 10),
  52             new Rectangle(-1, -1, -10, -10),
  53             new Rectangle(0, 0, size, size),
  54     };
  55 
  56     private static final Rectangle[] vlines = {new Rectangle(0, 0, 0, 0),
  57             new Rectangle(0, 0, 0, 1),
  58             new Rectangle(0, 0, 0, -1),
  59             new Rectangle(1, 1, 0, 1),


< prev index next >