/*
* 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 6689025
* @summary Tests that transformed Paints are rendered correctly
* @author Dmitri.Trembovetski@sun.com: area=Graphics
*/
public class TransformedPaintTest {
private static enum PaintType {
};
int w, int h)
{
// make sure that the blue color doesn't show up when filling a
// w by h rect
w++; h++;
switch (type) {
case GRADIENT: return
case LINEAR_GRADIENT: return
new float[] { 0.0f, 0.999f, 1.0f },
case RADIAL_GRADIENT: return
new float[] { 0.0f, 0.999f, 1.0f },
case TEXTURE: {
return new TexturePaint(bi, r);
}
}
}
{
g.setPaint(p);
// first, no transform
// translation only
g.translate(w, 0);
g.translate(-w, 0);
// complex transform
}
int ystep = h / paintTypes;
int y = 0;
y += ystep;
}
}
try {
} catch (IOException ex) {}
throw new RuntimeException("Test failed, blue color found");
}
}
}
}
private void runTest() {
return;
}
do {
} while (vi.contentsLost());
}
final BufferedImage bi =
protected void paintComponent(Graphics g) {
super.paintComponent(g);
}
};
f.add(p);
f.pack();
f.setVisible(true);
}
{
final TransformedPaintTest t = new TransformedPaintTest();
if (show) {
public void run() {
showFrame(t);
}
});
} else {
t.runTest();
}
}
}