< prev index next >
src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -1856,11 +1856,11 @@
// of subsequent rendering calls. In either case, this relaxed
// test should not be significantly less accurate than the
// optimal test for most transforms and so the conservative
// answer should not cause too much extra work.
- double d[] = {
+ double[] d = {
x, y,
x+width, y,
x, y+height,
x+width, y+height
};
@@ -1903,11 +1903,11 @@
} else if (usrClip instanceof Rectangle2D) {
clipState = CLIP_RECTANGULAR;
clipRegion = devClip.getIntersection((Rectangle2D) usrClip);
} else {
PathIterator cpi = usrClip.getPathIterator(null);
- int box[] = new int[4];
+ int[] box = new int[4];
ShapeSpanIterator sr = LoopPipe.getFillSSI(this);
try {
sr.setOutputArea(devClip);
sr.appendPath(cpi);
sr.getPathBox(box);
@@ -1990,11 +1990,11 @@
if (clip instanceof Rectangle2D &&
(tx.getType() & NON_RECTILINEAR_TRANSFORM_MASK) == 0)
{
Rectangle2D rect = (Rectangle2D) clip;
- double matrix[] = new double[4];
+ double[] matrix = new double[4];
matrix[0] = rect.getX();
matrix[1] = rect.getY();
matrix[2] = matrix[0] + rect.getWidth();
matrix[3] = matrix[1] + rect.getHeight();
tx.transform(matrix, 0, matrix, 0, 2);
@@ -2349,11 +2349,11 @@
} finally {
surfaceData.markDirty();
}
}
- public void drawPolyline(int xPoints[], int yPoints[], int nPoints) {
+ public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
try {
drawpipe.drawPolyline(this, xPoints, yPoints, nPoints);
} catch (InvalidPipeException e) {
try {
revalidateAll();
@@ -2366,11 +2366,11 @@
} finally {
surfaceData.markDirty();
}
}
- public void drawPolygon(int xPoints[], int yPoints[], int nPoints) {
+ public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) {
try {
drawpipe.drawPolygon(this, xPoints, yPoints, nPoints);
} catch (InvalidPipeException e) {
try {
revalidateAll();
@@ -2383,11 +2383,11 @@
} finally {
surfaceData.markDirty();
}
}
- public void fillPolygon(int xPoints[], int yPoints[], int nPoints) {
+ public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) {
try {
fillpipe.fillPolygon(this, xPoints, yPoints, nPoints);
} catch (InvalidPipeException e) {
try {
revalidateAll();
@@ -2584,11 +2584,11 @@
new Rectangle(img.getMinX(), img.getMinY(),
img.getWidth(), img.getHeight());
Rectangle result = null;
try {
- double p[] = new double[8];
+ double[] p = new double[8];
p[0] = p[2] = compClip.getLoX();
p[4] = p[6] = compClip.getHiX();
p[1] = p[5] = compClip.getLoY();
p[3] = p[7] = compClip.getHiY();
@@ -3014,11 +3014,11 @@
} finally {
surfaceData.markDirty();
}
}
- public void drawChars(char data[], int offset, int length, int x, int y) {
+ public void drawChars(char[] data, int offset, int length, int x, int y) {
if (data == null) {
throw new NullPointerException("char data is null");
}
if (offset < 0 || length < 0 || offset + length > data.length) {
@@ -3047,19 +3047,19 @@
} finally {
surfaceData.markDirty();
}
}
- public void drawBytes(byte data[], int offset, int length, int x, int y) {
+ public void drawBytes(byte[] data, int offset, int length, int x, int y) {
if (data == null) {
throw new NullPointerException("byte data is null");
}
if (offset < 0 || length < 0 || offset + length > data.length) {
throw new ArrayIndexOutOfBoundsException("bad offset/length");
}
/* Byte data is interpreted as 8-bit ASCII. Re-use drawChars loops */
- char chData[] = new char[length];
+ char[] chData = new char[length];
for (int i = length; i-- > 0; ) {
chData[i] = (char)(data[i+offset] & 0xff);
}
if (font.hasLayoutAttributes()) {
if (data.length == 0) {
< prev index next >