< prev index next >
src/java.desktop/share/classes/java/awt/geom/RoundRectIterator.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -88,11 +88,11 @@
// For each array:
// 4 values for each point {v0, v1, v2, v3}:
// point = (x + v0 * w + v1 * arcWidth,
// y + v2 * h + v3 * arcHeight);
- private static double ctrlpts[][] = {
+ private static double[][] ctrlpts = {
{ 0.0, 0.0, 0.0, 0.5 },
{ 0.0, 0.0, 1.0, -0.5 },
{ 0.0, 0.0, 1.0, -acv,
0.0, acv, 1.0, 0.0,
0.0, 0.5, 1.0, 0.0 },
@@ -108,11 +108,11 @@
{ 0.0, acv, 0.0, 0.0,
0.0, 0.0, 0.0, acv,
0.0, 0.0, 0.0, 0.5 },
{},
};
- private static int types[] = {
+ private static int[] types = {
SEG_MOVETO,
SEG_LINETO, SEG_CUBICTO,
SEG_LINETO, SEG_CUBICTO,
SEG_LINETO, SEG_CUBICTO,
SEG_LINETO, SEG_CUBICTO,
@@ -139,11 +139,11 @@
*/
public int currentSegment(float[] coords) {
if (isDone()) {
throw new NoSuchElementException("roundrect iterator out of bounds");
}
- double ctrls[] = ctrlpts[index];
+ double[] ctrls = ctrlpts[index];
int nc = 0;
for (int i = 0; i < ctrls.length; i += 4) {
coords[nc++] = (float) (x + ctrls[i + 0] * w + ctrls[i + 1] * aw);
coords[nc++] = (float) (y + ctrls[i + 2] * h + ctrls[i + 3] * ah);
}
@@ -173,11 +173,11 @@
*/
public int currentSegment(double[] coords) {
if (isDone()) {
throw new NoSuchElementException("roundrect iterator out of bounds");
}
- double ctrls[] = ctrlpts[index];
+ double[] ctrls = ctrlpts[index];
int nc = 0;
for (int i = 0; i < ctrls.length; i += 4) {
coords[nc++] = (x + ctrls[i + 0] * w + ctrls[i + 1] * aw);
coords[nc++] = (y + ctrls[i + 2] * h + ctrls[i + 3] * ah);
}
< prev index next >