author | mcimadamore |
Wed, 31 Aug 2011 16:11:28 +0100 | |
changeset 10452 | c8f32009b413 |
parent 7006 | 05505fff1342 |
permissions | -rw-r--r-- |
7006
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
1 |
/* |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
2 |
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
4 |
* |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
8 |
* |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
13 |
* accompanied this code). |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
14 |
* |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
18 |
* |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
21 |
* questions. |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
22 |
*/ |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
23 |
|
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
24 |
/* |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
25 |
* @test |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
26 |
* @bug 4358979 |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
27 |
* @summary Tests RadialGradientPaint encoding |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
28 |
* @author Sergey Malenkov |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
29 |
*/ |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
30 |
|
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
31 |
import java.awt.Color; |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
32 |
import java.awt.RadialGradientPaint; |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
33 |
import java.awt.geom.AffineTransform; |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
34 |
import java.awt.geom.Point2D; |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
35 |
|
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
36 |
import static java.awt.MultipleGradientPaint.ColorSpaceType.LINEAR_RGB; |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
37 |
import static java.awt.MultipleGradientPaint.CycleMethod.REFLECT; |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
38 |
|
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
39 |
public final class java_awt_RadialGradientPaint extends AbstractTest<RadialGradientPaint> { |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
40 |
public static void main(String[] args) { |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
41 |
new java_awt_RadialGradientPaint().test(true); |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
42 |
} |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
43 |
|
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
44 |
protected RadialGradientPaint getObject() { |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
45 |
float[] f = { 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f }; |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
46 |
Color[] c = { Color.BLUE, Color.GREEN, Color.RED, Color.BLUE, Color.GREEN, Color.RED }; |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
47 |
return new RadialGradientPaint(f[0], f[1], f[2], f, c); |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
48 |
} |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
49 |
|
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
50 |
protected RadialGradientPaint getAnotherObject() { |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
51 |
return null; /* TODO: could not update property |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
52 |
float[] f = { 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f }; |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
53 |
Color[] c = { Color.RED, Color.GREEN, Color.BLUE, Color.RED, Color.GREEN, Color.BLUE }; |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
54 |
return new RadialGradientPaint( |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
55 |
new Point2D.Float(f[0], f[1]), 100.0f, |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
56 |
new Point2D.Float(f[2], f[3]), |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
57 |
f, c, REFLECT, LINEAR_RGB, |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
58 |
new AffineTransform(f));*/ |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
59 |
} |
05505fff1342
4358979: javax.swing.border should have a DashedBorder
malenkov
parents:
diff
changeset
|
60 |
} |