/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/
/*
@test
@bug 6988428
@summary Tests whether shape is always set
@author anthony.petrov@oracle.com: area=awt.toplevel
@run main ShapeNotSetSometimes
*/
public class ShapeNotSetSometimes {
private int[][] pointsToCheck;
public void run() {
}
});
}
private void initializeGUI() {
backgroundFrame = new BackgroundFrame();
backgroundFrame.setUndecorated(true);
backgroundFrame.setVisible(true);
Area a;
shape_name = "Rounded-corners";
a = new Area();
shape = a;
pointsToCheck = new int[][] {
// inside shape
{106, 86}, {96, 38}, {76, 107}, {180, 25}, {24, 105},
{196, 77}, {165, 50}, {14, 113}, {89, 132}, {167, 117},
// outside shape
{165, 196}, {191, 163}, {146, 185}, {61, 170}, {148, 171},
{82, 172}, {186, 11}, {199, 141}, {13, 173}, {187, 3}
};
window.setUndecorated(true);
window.setVisible(true);
System.out.println("Checking " + window.getClass().getSuperclass().getName() + " with " + shape_name + " shape (" + window.getShape() + ")...");
}
super.paint(g);
}
}
super.paint(g);
}
}
for(int i = 0; i < 100; i++) {
new ShapeNotSetSometimes().doTest();
}
}
public void run() {
}
});
robot.waitForIdle();
try {
} catch (InterruptedException e) {
// ignore this one
}
// check transparency
final int COUNT_TARGET = 10;
// checking outside points only
int x = pointsToCheck[i][0];
int y = pointsToCheck[i][1];
boolean inside = i < COUNT_TARGET;
"expected background color " + BACKGROUND_COLOR);
throw new RuntimeException("Test failed. The shape has not been applied.");
}
}
public void run() {
}
});
}
}