8211693: Convert C-style array declarations in client demos and jdk.accessibility

Reviewed-by: serb
This commit is contained in:
Tagir F. Valeev 2018-10-09 18:25:57 -07:00
parent cd597d1dfd
commit e71caa9aae
75 changed files with 426 additions and 425 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -160,28 +160,28 @@ public abstract class Destinations extends Option.Enable {
public static class CompatImg extends Destinations {
int transparency;
public static String ShortNames[] = {
public static String[] ShortNames = {
"compatimg",
"opqcompatimg",
"bmcompatimg",
"transcompatimg",
};
public static String ShortDescriptions[] = {
public static String[] ShortDescriptions = {
"Default",
"Opaque",
"Bitmask",
"Translucent",
};
public static String LongDescriptions[] = {
public static String[] LongDescriptions = {
"Default Compatible Image",
"Opaque Compatible Image",
"Bitmask Compatible Image",
"Translucent Compatible Image",
};
public static String ModifierNames[] = {
public static String[] ModifierNames = {
"CompatImage()",
"CompatImage(Opaque)",
"CompatImage(Bitmask)",
@ -282,7 +282,7 @@ public abstract class Destinations extends Option.Enable {
int type;
Image img;
public static String ShortNames[] = {
public static String[] ShortNames = {
"custom",
"IntXrgb",
"IntArgb",
@ -299,7 +299,7 @@ public abstract class Destinations extends Option.Enable {
"ByteIndexed",
};
public static String Descriptions[] = {
public static String[] Descriptions = {
"Custom Image",
"32-bit XRGB Packed Image",
"32-bit ARGB Packed Image",

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -187,7 +187,7 @@ public class J2DBench {
System.exit(exitcode);
}
public static void main(String argv[]) {
public static void main(String[] argv) {
init();
TestEnvironment.init();
Result.init();
@ -310,8 +310,8 @@ public class J2DBench {
if (argv[i].indexOf(":") >= 0) {
String values[] = argv[i].split(":");
int intVals[] = new int[3];
String[] values = argv[i].split(":");
int[] intVals = new int[3];
for(int j=0; j<values.length; j++) {
try {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -123,8 +123,8 @@ public abstract class Option extends Node implements Modifier {
public static final int On = 1;
public static final int Both = 2;
private static final String valnames[] = {"Off", "On", "Both"};
private static final Boolean valuelist[][] = {
private static final String[] valnames = {"Off", "On", "Both"};
private static final Boolean[][] valuelist = {
BooleanIterator.FalseList,
BooleanIterator.TrueList,
BooleanIterator.FalseTrueList,
@ -420,10 +420,10 @@ public abstract class Option extends Node implements Modifier {
public static class ObjectList extends Option {
int size;
String optionnames[];
Object optionvalues[];
String abbrevnames[];
String descnames[];
String[] optionnames;
Object[] optionvalues;
String[] abbrevnames;
String[] descnames;
int defaultenabled;
int enabled;
JPanel jp;
@ -431,10 +431,10 @@ public abstract class Option extends Node implements Modifier {
int numrows;
public ObjectList(Group parent, String nodeName, String description,
String optionnames[],
Object optionvalues[],
String abbrevnames[],
String descnames[],
String[] optionnames,
Object[] optionvalues,
String[] abbrevnames,
String[] descnames,
int defaultenabled)
{
this(parent, nodeName, description,
@ -448,10 +448,10 @@ public abstract class Option extends Node implements Modifier {
public ObjectList(Group parent, String nodeName, String description,
int size,
String optionnames[],
Object optionvalues[],
String abbrevnames[],
String descnames[],
String[] optionnames,
Object[] optionvalues,
String[] abbrevnames,
String[] descnames,
int defaultenabled)
{
super(parent, nodeName, description);
@ -463,20 +463,20 @@ public abstract class Option extends Node implements Modifier {
this.enabled = this.defaultenabled = defaultenabled;
}
private static String[] trim(String list[], int size) {
private static String[] trim(String[] list, int size) {
if (list.length == size) {
return list;
}
String newlist[] = new String[size];
String[] newlist = new String[size];
System.arraycopy(list, 0, newlist, 0, size);
return newlist;
}
private static Object[] trim(Object list[], int size) {
private static Object[] trim(Object[] list, int size) {
if (list.length == size) {
return list;
}
Object newlist[] = new Object[size];
Object[] newlist = new Object[size];
System.arraycopy(list, 0, newlist, 0, size);
return newlist;
}
@ -604,7 +604,7 @@ public abstract class Option extends Node implements Modifier {
public static class IntList extends ObjectList {
public IntList(Group parent, String nodeName, String description,
int values[], String abbrevnames[], String descnames[],
int[] values, String[] abbrevnames, String[] descnames,
int defaultenabled)
{
super(parent, nodeName, description,
@ -612,16 +612,16 @@ public abstract class Option extends Node implements Modifier {
abbrevnames, descnames, defaultenabled);
}
private static String[] makeNames(int intvalues[]) {
String names[] = new String[intvalues.length];
private static String[] makeNames(int[] intvalues) {
String[] names = new String[intvalues.length];
for (int i = 0; i < intvalues.length; i++) {
names[i] = Integer.toString(intvalues[i]);
}
return names;
}
private static Object[] makeValues(int intvalues[]) {
Object values[] = new Object[intvalues.length];
private static Object[] makeValues(int[] intvalues) {
Object[] values = new Object[intvalues.length];
for (int i = 0; i < intvalues.length; i++) {
values[i] = new Integer(intvalues[i]);
}
@ -631,20 +631,20 @@ public abstract class Option extends Node implements Modifier {
public static class ObjectChoice extends Option {
int size;
String optionnames[];
Object optionvalues[];
String abbrevnames[];
String descnames[];
String[] optionnames;
Object[] optionvalues;
String[] abbrevnames;
String[] descnames;
int defaultselected;
int selected;
JPanel jp;
JComboBox jcombo;
public ObjectChoice(Group parent, String nodeName, String description,
String optionnames[],
Object optionvalues[],
String abbrevnames[],
String descnames[],
String[] optionnames,
Object[] optionvalues,
String[] abbrevnames,
String[] descnames,
int defaultselected)
{
this(parent, nodeName, description,
@ -658,10 +658,10 @@ public abstract class Option extends Node implements Modifier {
public ObjectChoice(Group parent, String nodeName, String description,
int size,
String optionnames[],
Object optionvalues[],
String abbrevnames[],
String descnames[],
String[] optionnames,
Object[] optionvalues,
String[] abbrevnames,
String[] descnames,
int defaultselected)
{
super(parent, nodeName, description);
@ -673,20 +673,20 @@ public abstract class Option extends Node implements Modifier {
this.selected = this.defaultselected = defaultselected;
}
private static String[] trim(String list[], int size) {
private static String[] trim(String[] list, int size) {
if (list.length == size) {
return list;
}
String newlist[] = new String[size];
String[] newlist = new String[size];
System.arraycopy(list, 0, newlist, 0, size);
return newlist;
}
private static Object[] trim(Object list[], int size) {
private static Object[] trim(Object[] list, int size) {
if (list.length == size) {
return list;
}
Object newlist[] = new Object[size];
Object[] newlist = new Object[size];
System.arraycopy(list, 0, newlist, 0, size);
return newlist;
}
@ -799,21 +799,21 @@ public abstract class Option extends Node implements Modifier {
}
public static class BooleanIterator implements Modifier.Iterator {
private Boolean list[];
private Boolean[] list;
private int index;
public static final Boolean FalseList[] = { Boolean.FALSE };
public static final Boolean TrueList[] = { Boolean.TRUE };
public static final Boolean
FalseTrueList[] = { Boolean.FALSE, Boolean.TRUE };
public static final Boolean
TrueFalseList[] = { Boolean.TRUE, Boolean.FALSE };
public static final Boolean[] FalseList = { Boolean.FALSE };
public static final Boolean[] TrueList = { Boolean.TRUE };
public static final Boolean[]
FalseTrueList = { Boolean.FALSE, Boolean.TRUE };
public static final Boolean[]
TrueFalseList = { Boolean.TRUE, Boolean.FALSE };
public BooleanIterator(boolean v) {
this(v ? TrueList : FalseList);
}
public BooleanIterator(Boolean list[]) {
public BooleanIterator(Boolean[] list) {
this.list = list;
}
@ -834,7 +834,7 @@ public abstract class Option extends Node implements Modifier {
}
public static class SwitchIterator implements Modifier.Iterator {
private Object list[];
private Object[] list;
private int enabled;
private int index;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -70,7 +70,7 @@ public class Result {
resultoptroot = new Group(TestEnvironment.globaloptroot,
"results", "Result Options");
String workStrings[] = {
String[] workStrings = {
"units",
"kilounits",
"megaunits",
@ -80,7 +80,7 @@ public class Result {
"megaops",
"autoops",
};
String workDescriptions[] = {
String[] workDescriptions = {
"Test Units",
"Thousands of Test Units",
"Millions of Test Units",
@ -90,7 +90,7 @@ public class Result {
"Millions of Operations",
"Auto-scaled Operations",
};
Integer workObjects[] = {
Integer[] workObjects = {
new Integer(WORK_UNITS),
new Integer(WORK_THOUSANDS),
new Integer(WORK_MILLIONS),
@ -105,21 +105,21 @@ public class Result {
workStrings, workObjects,
workStrings, workDescriptions,
0);
String timeStrings[] = {
String[] timeStrings = {
"sec",
"msec",
"usec",
"nsec",
"autosec",
};
String timeDescriptions[] = {
String[] timeDescriptions = {
"Seconds",
"Milliseconds",
"Microseconds",
"Nanoseconds",
"Auto-scaled seconds",
};
Integer timeObjects[] = {
Integer[] timeObjects = {
new Integer(TIME_SECONDS),
new Integer(TIME_MILLIS),
new Integer(TIME_MICROS),
@ -131,15 +131,15 @@ public class Result {
timeStrings, timeObjects,
timeStrings, timeDescriptions,
0);
String rateStrings[] = {
String[] rateStrings = {
"unitspersec",
"secsperunit",
};
String rateDescriptions[] = {
String[] rateDescriptions = {
"Work units per Time",
"Time units per Work",
};
Boolean rateObjects[] = {
Boolean[] rateObjects = {
Boolean.FALSE,
Boolean.TRUE,
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -51,7 +51,7 @@ public class ResultSet {
static Hashtable ignoreprops;
// Preferred props - will be listed even if undefined
static String preferredkeys[] = {
static String[] preferredkeys = {
"java.version",
"java.runtime.version",
"java.class.version",
@ -69,7 +69,7 @@ public class ResultSet {
};
// Ignored props - will not be copied to results file
static String ignoredkeys[] = {
static String[] ignoredkeys = {
"user.dir",
"user.home",
"user.timezone",

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -468,7 +468,7 @@ public class HTMLSeriesReporter {
/**
* main
*/
public static void main(String args[]) {
public static void main(String[] args) {
String resDir = ".";
ArrayList results = new ArrayList();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -284,7 +284,7 @@ public class IIOComparator {
String key = (String)e.nextElement();
keylist.add(key);
}
String keys[] = new String[keylist.size()];
String[] keys = new String[keylist.size()];
keylist.copyInto(keys);
if (special) {
sort2(keys);
@ -294,7 +294,7 @@ public class IIOComparator {
return keys;
}
public static void sort(String strs[]) {
public static void sort(String[] strs) {
for (int i = 1; i < strs.length; i++) {
for (int j = i; j > 0; j--) {
if (strs[j].compareTo(strs[j-1]) >= 0) {
@ -307,7 +307,7 @@ public class IIOComparator {
}
}
public static void sort2(String strs[]) {
public static void sort2(String[] strs) {
for (int i = 1; i < strs.length; i++) {
for (int j = i; j > 0; j--) {
if (compare(strs[j-1], strs[j])) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -91,12 +91,12 @@ public class J2DAnalyzer {
"are best of all result sets in that group");
}
public static void main(String argv[]) {
public static void main(String[] argv) {
boolean gavehelp = false;
boolean graph = false;
boolean ignoreuncontested = true;
if (argv.length > 0 && argv[0].equalsIgnoreCase("-html")) {
String newargs[] = new String[argv.length-1];
String[] newargs = new String[argv.length-1];
System.arraycopy(argv, 1, newargs, 0, newargs.length);
HTMLSeriesReporter.main(newargs);
return;
@ -144,15 +144,15 @@ public class J2DAnalyzer {
}
int numsets = results.size();
double totalscore[] = new double[numsets];
int numwins[] = new int[numsets];
int numties[] = new int[numsets];
int numloss[] = new int[numsets];
int numtests[] = new int[numsets];
double bestscore[] = new double[numsets];
double worstscore[] = new double[numsets];
double bestspread[] = new double[numsets];
double worstspread[] = new double[numsets];
double[] totalscore = new double[numsets];
int[] numwins = new int[numsets];
int[] numties = new int[numsets];
int[] numloss = new int[numsets];
int[] numtests = new int[numsets];
double[] bestscore = new double[numsets];
double[] worstscore = new double[numsets];
double[] bestspread = new double[numsets];
double[] worstspread = new double[numsets];
for (int i = 0; i < numsets; i++) {
bestscore[i] = Double.NEGATIVE_INFINITY;
worstscore[i] = Double.POSITIVE_INFINITY;
@ -166,7 +166,7 @@ public class J2DAnalyzer {
while (enum_.hasMoreElements()) {
keyvector.add(enum_.nextElement());
}
String keys[] = new String[keyvector.size()];
String[] keys = new String[keyvector.size()];
keyvector.copyInto(keys);
sort(keys);
enum_ = ResultHolder.commonkeys.keys();
@ -647,7 +647,7 @@ public class J2DAnalyzer {
}
private String makeKey(boolean prunecommon) {
String keys[] = new String[options.size()];
String[] keys = new String[options.size()];
Enumeration enum_ = options.keys();
int i = 0;
while (enum_.hasMoreElements()) {
@ -811,7 +811,7 @@ public class J2DAnalyzer {
return ret;
}
public static void sort(String strs[]) {
public static void sort(String[] strs) {
for (int i = 1; i < strs.length; i++) {
for (int j = i; j > 0; j--) {
if (strs[j].compareTo(strs[j-1]) >= 0) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -102,7 +102,7 @@ public class XMLHTMLReporter {
*/
private static void addGroup(String testName) {
String testNameSplit[] = testName.replace('.', '_').split("_");
String[] testNameSplit = testName.replace('.', '_').split("_");
String group = testNameSplit[0];
for(int i=1; i<LEVEL; i++) {
group = group + "." + testNameSplit[i];
@ -119,7 +119,7 @@ public class XMLHTMLReporter {
*/
private static String getDisplayGroupName(String group) {
String groupSplit[] = group.replace('.', '_').split("_");
String[] groupSplit = group.replace('.', '_').split("_");
StringBuffer groupName = new StringBuffer();
String tempName = null;
@ -142,7 +142,7 @@ public class XMLHTMLReporter {
*/
private static String getGroup(String testName) {
String testNameSplit[] = testName.replace('.', '_').split("_");
String[] testNameSplit = testName.replace('.', '_').split("_");
String group = testNameSplit[0];
for(int i=1; i<LEVEL; i++) {
group = group + "." + testNameSplit[i];
@ -200,7 +200,7 @@ public class XMLHTMLReporter {
while (enum_.hasMoreElements()) {
keyvector.add(enum_.nextElement());
}
String keys[] = new String[keyvector.size()];
String[] keys = new String[keyvector.size()];
keyvector.copyInto(keys);
J2DAnalyzer.sort(keys);
@ -323,7 +323,7 @@ public class XMLHTMLReporter {
while (baseEnum_.hasMoreElements()) {
baseKeyvector.add(baseEnum_.nextElement());
}
String baseKeys[] = new String[baseKeyvector.size()];
String[] baseKeys = new String[baseKeyvector.size()];
baseKeyvector.copyInto(baseKeys);
J2DAnalyzer.sort(baseKeys);
@ -337,7 +337,7 @@ public class XMLHTMLReporter {
while (targetEnum_.hasMoreElements()) {
targetKeyvector.add(targetEnum_.nextElement());
}
String targetKeys[] = new String[targetKeyvector.size()];
String[] targetKeys = new String[targetKeyvector.size()];
targetKeyvector.copyInto(targetKeys);
J2DAnalyzer.sort(targetKeys);
@ -797,7 +797,7 @@ public class XMLHTMLReporter {
"</font></td></tr>");
testResultsScoreBuffer.append(testResultsStartBuffer);
String tableTags[] = null;
String[] tableTags = null;
for(int i=0; i<testCaseList.length; i++) {
@ -1350,7 +1350,7 @@ public class XMLHTMLReporter {
/**
* main
*/
public static void main(String args[]) {
public static void main(String[] args) {
String resDir = ".";
String baseXML = null;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -126,7 +126,7 @@ public abstract class GraphicsTests extends Test {
"Huge Shapes (4000x4000)",
}, 0xa);
if (hasGraphics2D) {
String rulenames[] = {
String[] rulenames = {
"Clear",
"Src",
"Dst",
@ -140,8 +140,8 @@ public abstract class GraphicsTests extends Test {
"DstAtop",
"Xor",
};
String ruledescs[] = new String[rulenames.length];
Object rules[] = new Object[rulenames.length];
String[] ruledescs = new String[rulenames.length];
Object[] rules = new Object[rulenames.length];
int j = 0;
int defrule = 0;
for (int i = 0; i < rulenames.length; i++) {
@ -181,7 +181,7 @@ public abstract class GraphicsTests extends Test {
ruledescs, (1 << defrule));
((Option.ObjectList) compRules).setNumRows(4);
Transform xforms[] = {
Transform[] xforms = {
Identity.instance,
FTranslate.instance,
Scale2x2.instance,
@ -189,8 +189,8 @@ public abstract class GraphicsTests extends Test {
ShearX.instance,
ShearY.instance,
};
String xformnames[] = new String[xforms.length];
String xformdescs[] = new String[xforms.length];
String[] xformnames = new String[xforms.length];
String[] xformdescs = new String[xforms.length];
for (int i = 0; i < xforms.length; i++) {
xformnames[i] = xforms[i].getShortName();
xformdescs[i] = xforms[i].getDescription();
@ -214,7 +214,7 @@ public abstract class GraphicsTests extends Test {
new Option.Toggle(groptroot, "clip",
"Render through a complex clip shape",
Option.Toggle.Off);
String rhintnames[] = {
String[] rhintnames = {
"Default", "Speed", "Quality",
};
renderHint =

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -116,11 +116,11 @@ public abstract class ImageTests extends GraphicsTests {
static Option doTouchSrc;
static Option interpolation;
static String transNodeNames[] = {
static String[] transNodeNames = {
null, "opaque", "bitmask", "translucent",
};
static String transDescriptions[] = {
static String[] transDescriptions = {
null, "Opaque", "Bitmask", "Translucent",
};
@ -220,7 +220,7 @@ public abstract class ImageTests extends GraphicsTests {
new RasterOpFilter(false);
new RasterOpFilter(true);
String interpolationnames[] = {"Nearest neighbor", "Bilinear",
String[] interpolationnames = {"Nearest neighbor", "Bilinear",
"Bicubic",};
interpolation =
new ObjectList(imgtestOptRoot, "interpolation",
@ -369,7 +369,7 @@ public abstract class ImageTests extends GraphicsTests {
int type;
boolean unmanaged;
static int Transparencies[] = {
static int[] Transparencies = {
Transparency.TRANSLUCENT, // "custom",
Transparency.OPAQUE, // "IntXrgb",
Transparency.TRANSLUCENT, // "IntArgb",
@ -433,7 +433,7 @@ public abstract class ImageTests extends GraphicsTests {
public Image makeImage(TestEnvironment env, int w, int h) {
if (icm == null) {
int cmap[] = new int[256];
int[] cmap = new int[256];
// Workaround for transparency rendering bug in earlier VMs
// Can only render transparency if first cmap entry is 0x0
// This bug is fixed in 1.4.2 (Mantis)
@ -462,7 +462,7 @@ public abstract class ImageTests extends GraphicsTests {
static Color translucentGreen = makeAlphaColor(Color.green, 128);
static Color translucentYellow = makeAlphaColor(Color.yellow, 64);
static Color colorsets[][] = new Color[][] {
static Color[][] colorsets = new Color[][] {
null,
{
Color.blue, Color.red,
@ -838,8 +838,8 @@ public abstract class ImageTests extends GraphicsTests {
ictx.bufImgOp = new ConvolveOp(kernel, edge, null);
} else if (op.startsWith("lookup")) {
if (op.endsWith("byte")) {
byte invert[] = new byte[256];
byte ordered[] = new byte[256];
byte[] invert = new byte[256];
byte[] ordered = new byte[256];
for (int j = 0; j < 256 ; j++) {
invert[j] = (byte)(255-j);
ordered[j] = (byte)j;
@ -856,8 +856,8 @@ public abstract class ImageTests extends GraphicsTests {
null);
}
} else { // (op.endsWith("short"))
short invert[] = new short[256];
short ordered[] = new short[256];
short[] invert = new short[256];
short[] ordered = new short[256];
for (int j = 0; j < 256 ; j++) {
invert[j] = (short)((255-j) * 255);
ordered[j] = (short)(j * 255);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -133,7 +133,7 @@ public abstract class PixelTests extends Test {
BufferedImage bimg;
WritableRaster ras;
DataBuffer db;
int pixeldata[];
int[] pixeldata;
Object elemdata;
}
@ -172,14 +172,14 @@ public abstract class PixelTests extends Test {
}
public static class BufImg extends Option.Enable {
public static int rgbvals[] = {
public static int[] rgbvals = {
0x00000000,
0xff0000ff,
0x8000ff00,
0xffffffff
};
static int cmap[] = {
static int[] cmap = {
0xff000000, // 0: opaque black
0xffffffff, // 1: opaque white
@ -333,7 +333,7 @@ public abstract class PixelTests extends Test {
public void runTest(Object context, int numReps) {
Raster ras = ((Context) context).ras;
int pixeldata[] = ((Context) context).pixeldata;
int[] pixeldata = ((Context) context).pixeldata;
do {
ras.getPixel(numReps&7, 0, pixeldata);
} while (--numReps > 0);
@ -347,7 +347,7 @@ public abstract class PixelTests extends Test {
public void runTest(Object context, int numReps) {
WritableRaster ras = ((Context) context).ras;
int pixeldata[] = ((Context) context).pixeldata;
int[] pixeldata = ((Context) context).pixeldata;
do {
ras.setPixel(numReps&7, 0, pixeldata);
} while (--numReps > 0);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -83,8 +83,8 @@ public abstract class RenderTests extends GraphicsTests {
static final int NUM_RANDOMCOLORS = 4096;
static final int NUM_RANDOMCOLORMASK = (NUM_RANDOMCOLORS - 1);
static Color randAlphaColors[];
static Color randOpaqueColors[];
static Color[] randAlphaColors;
static Color[] randOpaqueColors;
static {
randOpaqueColors = new Color[NUM_RANDOMCOLORS];
@ -161,7 +161,7 @@ public abstract class RenderTests extends GraphicsTests {
new Option.Toggle(renderoptroot, "antialias",
"Render shapes antialiased",
Option.Toggle.Off);
String strokeStrings[] = {
String[] strokeStrings = {
"width0",
"width1",
"width5",
@ -171,7 +171,7 @@ public abstract class RenderTests extends GraphicsTests {
"dash5_20",
"dash20_50",
};
String strokeDescriptions[] = {
String[] strokeDescriptions = {
"Solid Thin lines",
"Solid Width 1 lines",
"Solid Width 5 lines",
@ -181,7 +181,7 @@ public abstract class RenderTests extends GraphicsTests {
"Dashed Width 5 lines",
"Dashed Width 20 lines",
};
BasicStroke strokeObjects[] = {
BasicStroke[] strokeObjects = {
new BasicStroke(0f),
new BasicStroke(1f),
new BasicStroke(5f),
@ -272,7 +272,7 @@ public abstract class RenderTests extends GraphicsTests {
public static class Context extends GraphicsTests.Context {
int colorindex;
Color colorlist[];
Color[] colorlist;
}
public RenderTests(Group parent, String nodeName, String description) {
@ -410,7 +410,7 @@ public abstract class RenderTests extends GraphicsTests {
int y = rctx.initY;
Graphics g = rctx.graphics;
g.translate(rctx.orgX, rctx.orgY);
Color rCArray[] = rctx.colorlist;
Color[] rCArray = rctx.colorlist;
int ci = rctx.colorindex;
if (rctx.animate) {
do {
@ -455,7 +455,7 @@ public abstract class RenderTests extends GraphicsTests {
int y = rctx.initY;
Graphics g = rctx.graphics;
g.translate(rctx.orgX, rctx.orgY);
Color rCArray[] = rctx.colorlist;
Color[] rCArray = rctx.colorlist;
int ci = rctx.colorindex;
if (rctx.animate) {
do {
@ -500,7 +500,7 @@ public abstract class RenderTests extends GraphicsTests {
int y = rctx.initY;
Graphics g = rctx.graphics;
g.translate(rctx.orgX, rctx.orgY);
Color rCArray[] = rctx.colorlist;
Color[] rCArray = rctx.colorlist;
int ci = rctx.colorindex;
if (rctx.animate) {
do {
@ -536,7 +536,7 @@ public abstract class RenderTests extends GraphicsTests {
int y = rctx.initY;
Graphics g = rctx.graphics;
g.translate(rctx.orgX, rctx.orgY);
Color rCArray[] = rctx.colorlist;
Color[] rCArray = rctx.colorlist;
int ci = rctx.colorindex;
if (rctx.animate) {
do {
@ -583,7 +583,7 @@ public abstract class RenderTests extends GraphicsTests {
int y = rctx.initY;
Graphics g = rctx.graphics;
g.translate(rctx.orgX, rctx.orgY);
Color rCArray[] = rctx.colorlist;
Color[] rCArray = rctx.colorlist;
int ci = rctx.colorindex;
if (rctx.animate) {
do {
@ -626,7 +626,7 @@ public abstract class RenderTests extends GraphicsTests {
int y = rctx.initY;
Graphics g = rctx.graphics;
g.translate(rctx.orgX, rctx.orgY);
Color rCArray[] = rctx.colorlist;
Color[] rCArray = rctx.colorlist;
int ci = rctx.colorindex;
if (rctx.animate) {
do {
@ -680,7 +680,7 @@ public abstract class RenderTests extends GraphicsTests {
int y = rctx.initY;
Graphics g = rctx.graphics;
g.translate(rctx.orgX, rctx.orgY);
Color rCArray[] = rctx.colorlist;
Color[] rCArray = rctx.colorlist;
int ci = rctx.colorindex;
if (rctx.animate) {
do {
@ -733,11 +733,11 @@ public abstract class RenderTests extends GraphicsTests {
int size = rctx.size;
int x = rctx.initX;
int y = rctx.initY;
int hexaX[] = new int[6];
int hexaY[] = new int[6];
int[] hexaX = new int[6];
int[] hexaY = new int[6];
Graphics g = rctx.graphics;
g.translate(rctx.orgX, rctx.orgY);
Color rCArray[] = rctx.colorlist;
Color[] rCArray = rctx.colorlist;
int ci = rctx.colorindex;
do {
hexaX[0] = x;
@ -798,11 +798,11 @@ public abstract class RenderTests extends GraphicsTests {
int size = rctx.size - 1;
int x = rctx.initX;
int y = rctx.initY;
int hexaX[] = new int[6];
int hexaY[] = new int[6];
int[] hexaX = new int[6];
int[] hexaY = new int[6];
Graphics g = rctx.graphics;
g.translate(rctx.orgX, rctx.orgY);
Color rCArray[] = rctx.colorlist;
Color[] rCArray = rctx.colorlist;
int ci = rctx.colorindex;
do {
hexaX[0] = x;
@ -868,7 +868,7 @@ public abstract class RenderTests extends GraphicsTests {
CubicCurve2D curve = cctx.curve;
Graphics2D g2d = (Graphics2D) cctx.graphics;
g2d.translate(cctx.orgX, cctx.orgY);
Color rCArray[] = cctx.colorlist;
Color[] rCArray = cctx.colorlist;
int ci = cctx.colorindex;
do {
curve.setCurve(x, y+size/2.0,
@ -922,7 +922,7 @@ public abstract class RenderTests extends GraphicsTests {
CubicCurve2D curve = cctx.curve;
Graphics2D g2d = (Graphics2D) cctx.graphics;
g2d.translate(cctx.orgX, cctx.orgY);
Color rCArray[] = cctx.colorlist;
Color[] rCArray = cctx.colorlist;
int ci = cctx.colorindex;
do {
curve.setCurve(x, y+size/2.0,
@ -970,7 +970,7 @@ public abstract class RenderTests extends GraphicsTests {
Ellipse2D ellipse = cctx.ellipse;
Graphics2D g2d = (Graphics2D) cctx.graphics;
g2d.translate(cctx.orgX, cctx.orgY);
Color rCArray[] = cctx.colorlist;
Color[] rCArray = cctx.colorlist;
int ci = cctx.colorindex;
do {
if (rCArray != null) {
@ -1012,7 +1012,7 @@ public abstract class RenderTests extends GraphicsTests {
Ellipse2D ellipse = cctx.ellipse;
Graphics2D g2d = (Graphics2D) cctx.graphics;
g2d.translate(cctx.orgX, cctx.orgY);
Color rCArray[] = cctx.colorlist;
Color[] rCArray = cctx.colorlist;
int ci = cctx.colorindex;
do {
if (rCArray != null) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -57,7 +57,7 @@ public class EnableButton extends JButton implements ActionListener {
private Group group;
private int type;
public static final String icons[] = {
public static final String[] icons = {
"Set",
"Clear",
"Invert",

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -791,7 +791,7 @@ public class FileChooserDemo extends JPanel implements ActionListener {
}
}
public static void main(String s[]) {
public static void main(String[] s) {
try {
SwingUtilities.invokeAndWait(new Runnable() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -116,16 +116,16 @@ public final class Font2DTest extends JPanel
private JTextArea userTextArea;
private JDialog printDialog;
private JDialog fontInfoDialog;
private LabelV2 fontInfos[] = new LabelV2[2];
private LabelV2[] fontInfos = new LabelV2[2];
private JFileChooser filePromptDialog = null;
private ButtonGroup printCBGroup;
private JRadioButton printModeCBs[] = new JRadioButton[3];
private JRadioButton[] printModeCBs = new JRadioButton[3];
/// Status bar
private final LabelV2 statusBar;
private int fontStyles [] = {Font.PLAIN, Font.BOLD, Font.ITALIC, Font.BOLD | Font.ITALIC};
private int[] fontStyles = {Font.PLAIN, Font.BOLD, Font.ITALIC, Font.BOLD | Font.ITALIC};
/// Text filename
private String tFileName;
@ -289,7 +289,7 @@ public final class Font2DTest extends JPanel
parent.setJMenuBar( mb );
String fontList[] =
String[] fontList =
GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
for ( int i = 0; i < fontList.length; i++ )
@ -422,7 +422,7 @@ public final class Font2DTest extends JPanel
/// RangeMenu object signals using this function
/// when Unicode range has been changed and text needs to be redrawn
public void fireRangeChanged() {
int range[] = rm.getSelectedRange();
int[] range = rm.getSelectedRange();
fp.setTextToDraw( fp.RANGE_TEXT, range, null, null );
if(canDisplayCheck) {
setupFontList(range[0], range[1]);
@ -445,7 +445,7 @@ public final class Font2DTest extends JPanel
/// Updates the information about the selected font
public void fireUpdateFontInfo() {
if ( showFontInfoCBMI.getState() ) {
String infos[] = fp.getFontInfo();
String[] infos = fp.getFontInfo();
for ( int i = 0; i < fontInfos.length; i++ )
fontInfos[i].setText( infos[i] );
fontInfoDialog.pack();
@ -533,7 +533,7 @@ public final class Font2DTest extends JPanel
private String[] parseUserText( String orig ) {
int length = orig.length();
StringTokenizer perLine = new StringTokenizer( orig, "\n" );
String textLines[] = new String[ perLine.countTokens() ];
String[] textLines = new String[ perLine.countTokens() ];
int lineNumber = 0;
while ( perLine.hasMoreElements() ) {
@ -583,14 +583,15 @@ public final class Font2DTest extends JPanel
/// Then breaks the text into String array, delimited at every line break
private void readTextFile( String fileName ) {
try {
String fileText, textLines[];
String fileText;
String[] textLines;
BufferedInputStream bis =
new BufferedInputStream( new FileInputStream( fileName ));
int numBytes = bis.available();
if (numBytes == 0) {
throw new Exception("Text file " + fileName + " is empty");
}
byte byteData[] = new byte[ numBytes ];
byte[] byteData = new byte[ numBytes ];
bis.read( byteData, 0, numBytes );
bis.close();
@ -648,7 +649,7 @@ public final class Font2DTest extends JPanel
BufferedOutputStream bos =
new BufferedOutputStream( new FileOutputStream( fileName ));
/// Prepend title and the option that is only obtainable here
int range[] = rm.getSelectedRange();
int[] range = rm.getSelectedRange();
String completeOptions =
( "Font2DTest Option File\n" +
displayGridCBMI.getState() + "\n" +
@ -656,7 +657,7 @@ public final class Font2DTest extends JPanel
showFontInfoCBMI.getState() + "\n" +
rm.getSelectedItem() + "\n" +
range[0] + "\n" + range[1] + "\n" + curOptions + tFileName);
byte toBeWritten[] = completeOptions.getBytes( "UTF-16" );
byte[] toBeWritten = completeOptions.getBytes( "UTF-16" );
bos.write( toBeWritten, 0, toBeWritten.length );
bos.close();
}
@ -714,7 +715,7 @@ public final class Font2DTest extends JPanel
BufferedInputStream bis =
new BufferedInputStream( new FileInputStream( fileName ));
int numBytes = bis.available();
byte byteData[] = new byte[ numBytes ];
byte[] byteData = new byte[ numBytes ];
bis.read( byteData, 0, numBytes );
bis.close();
if ( numBytes < 2 ||
@ -744,7 +745,7 @@ public final class Font2DTest extends JPanel
int antialiasOpt = Integer.parseInt(perLine.nextToken());
int fractionalOpt = Integer.parseInt(perLine.nextToken());
int lcdContrast = Integer.parseInt(perLine.nextToken());
String userTextOpt[] = { "Font2DTest!" };
String[] userTextOpt = { "Font2DTest!" };
String dialogEntry = "Font2DTest!";
if (textToUseOpt == fp.USER_TEXT ) {
int numLines = perLine.countTokens(), lineNumber = 0;
@ -1016,7 +1017,7 @@ public final class Font2DTest extends JPanel
}
/// Main function
public static void main(String argv[]) {
public static void main(String[] argv) {
if(argv.length > 0) {
if(argv[0].equalsIgnoreCase("-disablecandisplaycheck") ||

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -95,14 +95,14 @@ import static java.awt.RenderingHints.*;
public final class FontPanel extends JPanel implements AdjustmentListener {
/// Drawing Option Constants
private final String STYLES[] =
private final String[] STYLES =
{ "plain", "bold", "italic", "bold italic" };
private final int NONE = 0;
private final int SCALE = 1;
private final int SHEAR = 2;
private final int ROTATE = 3;
private final String TRANSFORMS[] =
private final String[] TRANSFORMS =
{ "with no transforms", "with scaling", "with Shearing", "with rotation" };
private final int DRAW_STRING = 0;
@ -112,7 +112,7 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
private final int TL_DRAW = 4;
private final int GV_OUTLINE = 5;
private final int TL_OUTLINE = 6;
private final String METHODS[] = {
private final String[] METHODS = {
"drawString", "drawChars", "drawBytes", "drawGlyphVector",
"TextLayout.draw", "GlyphVector.getOutline", "TextLayout.getOutline" };
@ -120,9 +120,9 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
public final int ALL_GLYPHS = 1;
public final int USER_TEXT = 2;
public final int FILE_TEXT = 3;
private final String MS_OPENING[] =
private final String[] MS_OPENING =
{ " Unicode ", " Glyph Code ", " lines ", " lines " };
private final String MS_CLOSING[] =
private final String[] MS_CLOSING =
{ "", "", " of User Text ", " of LineBreakMeasurer-reformatted Text " };
/// General Graphics Variable
@ -153,10 +153,10 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
private Object lcdContrast = getDefaultLCDContrast();
private int drawMethod = DRAW_STRING;
private int textToUse = RANGE_TEXT;
private String userText[] = null;
private String fileText[] = null;
private int drawRange[] = { 0x0000, 0x007f };
private String fontInfos[] = new String[2];
private String[] userText = null;
private String[] fileText = null;
private int[] drawRange = { 0x0000, 0x007f };
private String[] fontInfos = new String[2];
private boolean showGrid = true;
/// Parent Font2DTest panel
@ -271,8 +271,8 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
fc.repaint();
}
public void setTextToDraw( int i, int range[],
String textSet[], String fileData[] ) {
public void setTextToDraw( int i, int[] range,
String[] textSet, String[] fileData ) {
textToUse = i;
if ( textToUse == RANGE_TEXT )
@ -377,8 +377,8 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
String name, float size, int style,
int transform, int g2transform,
int text, int method, int aa, int fm,
int contrast, String user[] ) {
int range[] = { start, end };
int contrast, String[] user ) {
int[] range = { start, end };
/// Since repaint call has a low priority, these functions will finish
/// before the actual repainting is done
@ -458,7 +458,7 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
private String backupStatusString = null;
/// Error constants
private final String ERRORS[] = {
private final String[] ERRORS = {
"ERROR: drawBytes cannot handle characters beyond 0x00FF. Select different range or draw methods.",
"ERROR: Cannot fit text with the current font size. Resize the window or use smaller font size.",
"ERROR: Cannot print with the current font size. Use smaller font size.",
@ -480,7 +480,7 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
/// Creates an invisble pointer by giving it bogus image
/// Possibly find a workaround for this...
Toolkit tk = Toolkit.getDefaultToolkit();
byte bogus[] = { (byte) 0 };
byte[] bogus = { (byte) 0 };
blankCursor =
tk.createCustomCursor( tk.createImage( bogus ), new Point(0, 0), "" );
@ -545,8 +545,8 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
public void modeSpecificDrawChar( Graphics2D g2, int charCode,
int baseX, int baseY ) {
GlyphVector gv;
int oneGlyph[] = { charCode };
char charArray[] = Character.toChars( charCode );
int[] oneGlyph = { charCode };
char[] charArray = Character.toChars( charCode );
FontRenderContext frc = g2.getFontRenderContext();
AffineTransform oldTX = g2.getTransform();
@ -563,7 +563,7 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
// we need to convert back to user space to be able to
// calculate the shift as baseX is in user space.
try {
double pt[] = new double[4];
double[] pt = new double[4];
pt[0] = r2d2.getX();
pt[1] = r2d2.getY();
pt[2] = r2d2.getX()+r2d2.getWidth();
@ -597,7 +597,7 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
case DRAW_BYTES:
if ( charCode > 0xff )
throw new CannotDrawException( DRAW_BYTES_ERROR );
byte oneByte[] = { (byte) charCode };
byte[] oneByte = { (byte) charCode };
g2.drawBytes( oneByte, 0, 1, 0, 0 );
break;
case DRAW_GLYPHV:
@ -644,7 +644,7 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
break;
case DRAW_BYTES:
try {
byte lineBytes[] = line.getBytes( "ISO-8859-1" );
byte[] lineBytes = line.getBytes( "ISO-8859-1" );
g2.drawBytes( lineBytes, 0, lineBytes.length, 0, 0 );
}
catch ( Exception e ) {
@ -934,7 +934,7 @@ public final class FontPanel extends JPanel implements AdjustmentListener {
oneLine.isLeftToRight() ?
canvasInset_X : ( (float) w - oneLine.getAdvance() - canvasInset_X );
float fmData[] = {0, oneLine.getAscent(), 0, oneLine.getDescent(), 0, oneLine.getLeading()};
float[] fmData = {0, oneLine.getAscent(), 0, oneLine.getDescent(), 0, oneLine.getLeading()};
if (g2Transform != NONE) {
AffineTransform at = getAffineTransform(g2Transform);
at.transform( fmData, 0, fmData, 0, 3);

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -161,7 +161,7 @@ public final class CloningFeature extends JPanel implements Runnable {
return;
}
Component cmps[] = dg.clonePanels[0].getComponents();
Component[] cmps = dg.clonePanels[0].getComponents();
for (int i = 0; i < cmps.length && thread != null; i++) {
if ((dp = (DemoPanel) cmps[i]).tools == null) {
continue;

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -76,7 +76,7 @@ public class DemoGroup extends JPanel
private final EmptyBorder emptyB = new EmptyBorder(5, 5, 5, 5);
private final BevelBorder bevelB = new BevelBorder(BevelBorder.LOWERED);
private String groupName;
public JPanel clonePanels[];
public JPanel[] clonePanels;
public JTabbedPane tabbedPane;
public DemoGroup(String name, DemoInstVarsAccessor demoInstVars) {
@ -234,9 +234,9 @@ public class DemoGroup extends JPanel
Tools t = dp.tools;
t.setVisible(isValid());
t.issueRepaint = issueRepaint;
JToggleButton b[] = { t.toggleB, t.aliasB, t.renderB,
JToggleButton[] b = { t.toggleB, t.aliasB, t.renderB,
t.textureB, t.compositeB };
JCheckBox cb[] = { c.toolBarCB, c.aliasCB, c.renderCB,
JCheckBox[] cb = { c.toolBarCB, c.aliasCB, c.renderCB,
c.textureCB, c.compositeCB };
for (int j = 0; j < b.length; j++) {
if (c.obj != null && c.obj.equals(cb[j])) {
@ -334,7 +334,7 @@ public class DemoGroup extends JPanel
panel.revalidate();
}
public static void main(String args[]) {
public static void main(String[] args) {
class DemoInstVarsAccessorImpl extends DemoInstVarsAccessorImplBase {
private volatile JCheckBoxMenuItem ccthreadCB;

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -74,8 +74,8 @@ public class DemoPanel extends JPanel {
}
if (obj instanceof CustomControlsContext) {
ccc = (CustomControlsContext) obj;
Component cmps[] = ccc.getControls();
String cons[] = ccc.getConstraints();
Component[] cmps = ccc.getControls();
String[] cons = ccc.getConstraints();
for (int i = 0; i < cmps.length; i++) {
add(cmps[i], cons[i]);
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -157,7 +157,7 @@ public class Intro extends JPanel {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
final Intro intro = new Intro();
WindowListener l = new WindowAdapter() {
@ -497,7 +497,7 @@ public class Intro extends JPanel {
Font f3 = new Font(Font.SERIF, Font.PLAIN, 72);
public Director(Surface surf) {
Object partsInfo[][][] = {
Object[][][] partsInfo = {
{ { "J - scale text on gradient", "0" },
{ new GpE(GpE.BURI, myBlack, myBlue, 0, 20),
new TxE("J", f1, TxE.SCI, myYellow, 2, 20) } },
@ -677,7 +677,7 @@ public class Intro extends JPanel {
private int type;
private double rIncr, sIncr;
private double sx, sy, rotate;
private Shape shapes[], txShapes[];
private Shape[] shapes, txShapes;
private int sw;
private int numRev;
private Paint paint;
@ -1610,7 +1610,7 @@ public class Intro extends JPanel {
static final Font font2 = new Font(Font.SERIF, Font.PLAIN, 24);
private final FontMetrics fm1;
private final FontMetrics fm2;
private static final String table[][] = { { "Graphics", "Antialiased rendering",
private static final String[][] table = { { "Graphics", "Antialiased rendering",
"Bezier paths",
"Transforms", "Compositing", "Stroking parameters" },
{ "Text", "Extended font support",
@ -1622,7 +1622,7 @@ public class Intro extends JPanel {
"RenderableImage interface" },
{ "Color", "ICC profile support", "Color conversion",
"Arbitrary color spaces" } };
private String list[];
private String[] list;
private int beginning, ending;
private int strH;
private int endIndex, listIndex;
@ -1687,7 +1687,7 @@ public class Intro extends JPanel {
*/
static class Contributors implements Part {
private static final String members[] = {
private static final String[] members = {
"Brian Lichtenwalter", "Jeannette Hung",
"Thanh Nguyen", "Jim Graham", "Jerry Evans",
"John Raley", "Michael Peirce", "Robert Kim",

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -678,7 +678,7 @@ public class J2Ddemo extends JPanel implements ItemListener, ActionListener, Dem
}
public static void main(final String args[]) {
public static void main(final String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -125,7 +125,7 @@ public class MemoryMonitor extends JPanel {
private Font font = new Font(Font.SERIF, Font.PLAIN, 11);
private Runtime r = Runtime.getRuntime();
private int columnInc;
private int pts[];
private int[] pts;
private int ptNum;
private int ascent, descent;
private Rectangle graphOutlineRect = new Rectangle();
@ -247,7 +247,7 @@ public class MemoryMonitor extends JPanel {
pts = new int[graphW];
ptNum = 0;
} else if (pts.length != graphW) {
int tmp[] = null;
int[] tmp = null;
if (ptNum < graphW) {
tmp = new int[ptNum];
System.arraycopy(pts, 0, tmp, 0, tmp.length);
@ -337,7 +337,7 @@ public class MemoryMonitor extends JPanel {
}
}
public static void main(String s[]) {
public static void main(String[] s) {
final MemoryMonitor demo = new MemoryMonitor();
WindowListener l = new WindowAdapter() {

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -224,7 +224,7 @@ public final class TextureChooser extends JPanel {
}
}
public static void main(String s[]) {
public static void main(String[] s) {
Frame f = new Frame("J2D Demo - TextureChooser");
f.addWindowListener(new WindowAdapter() {

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -45,7 +45,7 @@ import static java.awt.Color.*;
@SuppressWarnings("serial")
public class Arcs extends AnimatingSurface {
private static String types[] = { "Arc2D.OPEN", "Arc2D.CHORD", "Arc2D.PIE" };
private static String[] types = { "Arc2D.OPEN", "Arc2D.CHORD", "Arc2D.PIE" };
private static final int CLOSE = 0;
private static final int OPEN = 1;
private static final int FORWARD = 0;
@ -159,7 +159,7 @@ public class Arcs extends AnimatingSurface {
g2.fill(at.createTransformedShape(pieArc));
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Arcs());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -74,8 +74,8 @@ public class BezierAnim extends AnimatingControlsSurface {
protected BasicStroke dashed = new BasicStroke(10.0f,
BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 10, new float[] { 5 },
0);
private float animpts[] = new float[NUMPTS * 2];
private float deltas[] = new float[NUMPTS * 2];
private float[] animpts = new float[NUMPTS * 2];
private float[] deltas = new float[NUMPTS * 2];
protected Paint fillPaint, drawPaint;
protected boolean doFill = true;
protected boolean doDraw = true;
@ -173,7 +173,7 @@ public class BezierAnim extends AnimatingControlsSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new BezierAnim());
}
@ -194,21 +194,21 @@ public class BezierAnim extends AnimatingControlsSurface {
tp2 = new TexturePaint(bi, new Rectangle(0, 0, 2, 1));
}
BezierAnim demo;
static Paint drawPaints[] = { new Color(0, 0, 0, 0), BLUE, new Color(0,
static Paint[] drawPaints = { new Color(0, 0, 0, 0), BLUE, new Color(0,
0, 255, 126),
BLUE, tp2 };
static String drawName[] = { "No Draw", "Blue", "Blue w/ Alpha",
static String[] drawName = { "No Draw", "Blue", "Blue w/ Alpha",
"Blue Dash", "Texture" };
static Paint fillPaints[] = { new Color(0, 0, 0, 0), GREEN, new Color(0,
static Paint[] fillPaints = { new Color(0, 0, 0, 0), GREEN, new Color(0,
255, 0, 126),
tp1, new GradientPaint(0, 0, RED, 30, 30, YELLOW) };
String fillName[] = { "No Fill", "Green", "Green w/ Alpha", "Texture",
String[] fillName = { "No Fill", "Green", "Green w/ Alpha", "Texture",
"Gradient" };
JMenu fillMenu, drawMenu;
JMenuItem fillMI[] = new JMenuItem[fillPaints.length];
JMenuItem drawMI[] = new JMenuItem[drawPaints.length];
PaintedIcon fillIcons[] = new PaintedIcon[fillPaints.length];
PaintedIcon drawIcons[] = new PaintedIcon[drawPaints.length];
JMenuItem[] fillMI = new JMenuItem[fillPaints.length];
JMenuItem[] drawMI = new JMenuItem[drawPaints.length];
PaintedIcon[] fillIcons = new PaintedIcon[fillPaints.length];
PaintedIcon[] drawIcons = new PaintedIcon[drawPaints.length];
Font font = new Font(Font.SERIF, Font.PLAIN, 10);
@SuppressWarnings("LeakingThisInConstructor")

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -52,7 +52,7 @@ import static java.awt.geom.PathIterator.*;
@SuppressWarnings("serial")
public class Curves extends Surface {
private static Color colors[] = { BLUE, GREEN, RED };
private static Color[] colors = { BLUE, GREEN, RED };
public Curves() {
setBackground(WHITE);
@ -136,7 +136,7 @@ public class Curves extends Surface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Curves());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -44,12 +44,12 @@ import static java.awt.Color.*;
@SuppressWarnings("serial")
public final class Ellipses extends AnimatingSurface {
private static Color colors[] = {
private static Color[] colors = {
BLUE, CYAN, GREEN, MAGENTA, ORANGE, PINK, RED,
YELLOW, LIGHT_GRAY, WHITE };
private Ellipse2D.Float[] ellipses;
private double esize[];
private float estroke[];
private double[] esize;
private float[] estroke;
private double maxSize;
public Ellipses() {
@ -102,7 +102,7 @@ public final class Ellipses extends AnimatingSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Ellipses());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -141,7 +141,7 @@ public class Areas extends ControlsSurface {
g2.draw(area);
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Areas());
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -61,7 +61,7 @@ public class ClipAnim extends AnimatingControlsSurface {
big.fillRect(0, 0, 3, 3);
texturePaint = new TexturePaint(bi, new Rectangle(0, 0, 5, 5));
}
private AnimVal animval[] = new AnimVal[3];
private AnimVal[] animval = new AnimVal[3];
protected boolean doObjects = true;
private Font originalFont = new Font(Font.SERIF, Font.PLAIN, 12);
private Font font;
@ -158,7 +158,7 @@ public class ClipAnim extends AnimatingControlsSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new ClipAnim());
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -171,7 +171,7 @@ public class Intersection extends AnimatingControlsSurface {
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Intersection());
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -161,7 +161,7 @@ public class Text extends ControlsSurface {
g2.draw(shape);
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new Text());
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -53,7 +53,7 @@ public class BullsEye extends Surface {
@Override
public void render(int w, int h, Graphics2D g2) {
Color reds[] = { RED.darker(), RED };
Color[] reds = { RED.darker(), RED };
for (int N = 0; N < 18; N++) {
float i = (N + 2) / 2.0f;
float x = (5 + i * (w / 2 / 10));
@ -70,7 +70,7 @@ public class BullsEye extends Surface {
}
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new BullsEye());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -65,7 +65,7 @@ import java2d.Surface;
public class ColorConvert extends Surface {
private static Image img;
private static Color colors[] = { red, pink, orange,
private static Color[] colors = { red, pink, orange,
yellow, green, magenta, cyan, blue };
public ColorConvert() {
@ -123,7 +123,7 @@ public class ColorConvert extends Surface {
g2.drawImage(dstImg, w / 2 + 10, 20, w / 2 - 20, h - 30, null);
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new ColorConvert());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -50,7 +50,7 @@ import java2d.AnimatingSurface;
@SuppressWarnings("serial")
public class Rotator3D extends AnimatingSurface {
private Objects3D objs[] = new Objects3D[3];
private Objects3D[] objs = new Objects3D[3];
private static final int[][][] polygons = {
// Solid cube
{ { 5, 1, 15, 13, 21, 23, 15 },
@ -142,7 +142,7 @@ public class Rotator3D extends AnimatingSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Rotator3D());
}
@ -170,8 +170,8 @@ public class Rotator3D extends AnimatingSurface {
private double ix = 3.0, iy = 3.0;
private double[][] rotPts;
private int[][] scrPts;
private int xx[] = new int[20];
private int yy[] = new int[20];
private int[] xx = new int[20];
private int[] yy = new int[20];
private double x, y;
private int p, j;
private int colour;

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -61,11 +61,11 @@ import java2d.Surface;
@SuppressWarnings("serial")
public class ACimages extends Surface {
private static final String s[] = { "box", "fight", "magnify",
private static final String[] s = { "box", "fight", "magnify",
"boxwave", "globe", "snooze",
"tip", "thumbsup", "dukeplug" };
private static Image imgs[] = new Image[s.length];
private static Color colors[] = { BLUE, CYAN, GREEN,
private static Image[] imgs = new Image[s.length];
private static Color[] colors = { BLUE, CYAN, GREEN,
MAGENTA, ORANGE, PINK, RED, YELLOW, LIGHT_GRAY };
public ACimages() {
@ -121,7 +121,7 @@ public class ACimages extends Surface {
}
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new ACimages());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -64,7 +64,7 @@ import java2d.AnimatingSurface;
@SuppressWarnings("serial")
public class ACrules extends AnimatingSurface {
private static String compNames[] = {
private static String[] compNames = {
"Src",
"SrcOver",
"SrcIn",
@ -77,17 +77,17 @@ public class ACrules extends AnimatingSurface {
"DstOut",
"DstAtop",
"Xor", };
private static final AlphaComposite compObjs[] = {
private static final AlphaComposite[] compObjs = {
Src, SrcOver, SrcIn, SrcOut, SrcAtop, Clear,
Dst, DstOver, DstIn, DstOut, DstAtop, Xor, };
private static final int NUM_RULES = compObjs.length;
private static final int HALF_NUM_RULES = NUM_RULES / 2;
private int fadeIndex;
private static float fadeValues[][] = {
private static float[][] fadeValues = {
{ 1.0f, -0.1f, 0.0f, 1.0f, 0.0f, 1.0f },
{ 0.0f, 0.1f, 1.0f, 1.0f, -0.1f, 0.0f },
{ 1.0f, 0.0f, 1.0f, 0.0f, 0.1f, 1.0f }, };
private static String fadeNames[] = {
private static String[] fadeNames = {
"Src => transparent, Dest opaque",
"Src => opaque, Dest => transparent",
"Src opaque, Dest => opaque", };
@ -257,7 +257,7 @@ public class ACrules extends AnimatingSurface {
return bi;
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new ACrules());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -107,18 +107,18 @@ public final class FadeAnim extends AnimatingControlsSurface {
texturePaint = new TexturePaint(bi, new Rectangle(0, 0, w, h));
}
private static BasicStroke bs = new BasicStroke(6);
private static Font fonts[] = {
private static Font[] fonts = {
new Font(Font.SERIF, Font.PLAIN, 64),
new Font(Font.SERIF, Font.BOLD | Font.ITALIC, 24),
new Font(Font.MONOSPACED, Font.BOLD, 36),
new Font(Font.SANS_SERIF, Font.BOLD | Font.ITALIC, 48),
new Font(Font.SANS_SERIF, Font.PLAIN, 52) };
private static String strings[] = {
private static String[] strings = {
"Alpha", "Composite", "Src", "SrcOver",
"SrcIn", "SrcOut", "Clear", "DstOver", "DstIn" };
private static String imgs[] = {
private static String[] imgs = {
"jumptojavastrip.png", "duke.png", "star7.png" };
private static Paint paints[] = {
private static Paint[] paints = {
RED, BLUE, GREEN, MAGENTA,
ORANGE, PINK, CYAN, texturePaint,
YELLOW, LIGHT_GRAY, WHITE };
@ -276,7 +276,7 @@ public final class FadeAnim extends AnimatingControlsSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new FadeAnim());
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -125,7 +125,7 @@ public class AllFonts extends AnimatingControlsSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new AllFonts());
}
@ -135,9 +135,9 @@ public class AllFonts extends AnimatingControlsSurface {
AllFonts demo;
JSlider slider;
int fsize[] = { 8, 14, 18, 24 };
JMenuItem menuitem[] = new JMenuItem[fsize.length];
Font font[] = new Font[fsize.length];
int[] fsize = { 8, 14, 18, 24 };
JMenuItem[] menuitem = new JMenuItem[fsize.length];
Font[] font = new Font[fsize.length];
@SuppressWarnings("LeakingThisInConstructor")
public DemoControls(AllFonts demo) {

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -184,7 +184,7 @@ public class AttributedStr extends Surface {
}
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new AttributedStr());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -55,8 +55,8 @@ import java2d.AnimatingSurface;
@SuppressWarnings("serial")
public class Highlighting extends AnimatingSurface {
private static String text[] = { "HIGHLIGHTING", "OpenJDK" };
private static Color colors[] = { CYAN, LIGHT_GRAY };
private static String[] text = { "HIGHLIGHTING", "OpenJDK" };
private static Color[] colors = { CYAN, LIGHT_GRAY };
private static Font smallF = new Font("Monospaced", Font.PLAIN, 8);
private int[] curPos;
private TextLayout[] layouts;
@ -129,7 +129,7 @@ public class Highlighting extends AnimatingSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Highlighting());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -109,7 +109,7 @@ public class Outline extends Surface {
g2.fill(sha);
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new Outline());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -90,7 +90,7 @@ public class Tree extends AnimatingSurface {
static double Twidth = 0.6;
static double Rwidth = 0.6;
static double FontHeight = 0.75;
static Color colors[] = { BLUE,
static Color[] colors = { BLUE,
RED.darker(),
GREEN.darker() };
@ -123,7 +123,7 @@ public class Tree extends AnimatingSurface {
g2d.setTransform(new AffineTransform());
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Tree());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -91,7 +91,7 @@ public class DukeAnim extends AnimatingSurface implements ImageObserver {
return isShowing();
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new DukeAnim());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -66,12 +66,12 @@ import javax.swing.event.ChangeListener;
public class ImageOps extends ControlsSurface implements ChangeListener {
protected JSlider slider1, slider2;
private static final String imgName[] = { "bld.jpg", "boat.png" };
private static final BufferedImage img[] = new BufferedImage[imgName.length];
private static final String opsName[] = {
private static final String[] imgName = { "bld.jpg", "boat.png" };
private static final BufferedImage[] img = new BufferedImage[imgName.length];
private static final String[] opsName = {
"Threshold", "RescaleOp", "Invert", "Yellow Invert", "3x3 Blur",
"3x3 Sharpen", "3x3 Edge", "5x5 Edge" };
private static final BufferedImageOp biop[] =
private static final BufferedImageOp[] biop =
new BufferedImageOp[opsName.length];
private static int rescaleFactor = 128;
private static float rescaleOffset = 0;
@ -82,8 +82,8 @@ public class ImageOps extends ControlsSurface implements ChangeListener {
thresholdOp(low, high);
int i = 1;
biop[i++] = new RescaleOp(1.0f, 0, null);
byte invert[] = new byte[256];
byte ordered[] = new byte[256];
byte[] invert = new byte[256];
byte[] ordered = new byte[256];
for (int j = 0; j < 256; j++) {
invert[j] = (byte) (256 - j);
ordered[j] = (byte) j;
@ -91,8 +91,8 @@ public class ImageOps extends ControlsSurface implements ChangeListener {
biop[i++] = new LookupOp(new ByteLookupTable(0, invert), null);
byte[][] yellowInvert = new byte[][] { invert, invert, ordered };
biop[i++] = new LookupOp(new ByteLookupTable(0, yellowInvert), null);
int dim[][] = { { 3, 3 }, { 3, 3 }, { 3, 3 }, { 5, 5 } };
float data[][] = { { 0.1f, 0.1f, 0.1f, // 3x3 blur
int[][] dim = { { 3, 3 }, { 3, 3 }, { 3, 3 }, { 5, 5 } };
float[][] data = { { 0.1f, 0.1f, 0.1f, // 3x3 blur
0.1f, 0.2f, 0.1f,
0.1f, 0.1f, 0.1f },
{ -1.0f, -1.0f, -1.0f, // 3x3 sharpen
@ -134,7 +134,7 @@ public class ImageOps extends ControlsSurface implements ChangeListener {
}
public static void thresholdOp(int low, int high) {
byte threshold[] = new byte[256];
byte[] threshold = new byte[256];
for (int j = 0; j < 256; j++) {
if (j > high) {
threshold[j] = (byte) 255;
@ -180,7 +180,7 @@ public class ImageOps extends ControlsSurface implements ChangeListener {
repaint();
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new ImageOps());
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -176,7 +176,7 @@ public class JPEGFlip extends Surface {
g2.drawLine(0, hh, w, hh);
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new JPEGFlip());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -51,7 +51,7 @@ public class WarpImage extends AnimatingSurface {
private static Image img;
private static final int FORWARD = 0;
private static final int BACK = 1;
private Point2D pts[];
private Point2D[] pts;
private int direction = FORWARD;
private int pNum;
private int x, y;
@ -73,7 +73,7 @@ public class WarpImage extends AnimatingSurface {
CubicCurve2D cc = new CubicCurve2D.Float(
w * .2f, h * .5f, w * .4f, 0, w * .6f, h, w * .8f, h * .5f);
PathIterator pi = cc.getPathIterator(null, 0.1);
Point2D tmp[] = new Point2D[200];
Point2D[] tmp = new Point2D[200];
int i = 0;
while (!pi.isDone()) {
float[] coords = new float[6];
@ -128,7 +128,7 @@ public class WarpImage extends AnimatingSurface {
this);
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new WarpImage());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -53,8 +53,8 @@ import java2d.Surface;
@SuppressWarnings("serial")
public class Caps extends Surface {
private static int cap[] = { CAP_BUTT, CAP_ROUND, CAP_SQUARE };
private static String desc[] = { "Butt Cap", "Round Cap", "Square Cap" };
private static int[] cap = { CAP_BUTT, CAP_ROUND, CAP_SQUARE };
private static String[] desc = { "Butt Cap", "Round Cap", "Square Cap" };
public Caps() {
setBackground(WHITE);
@ -75,7 +75,7 @@ public class Caps extends Surface {
}
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new Caps());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -76,11 +76,11 @@ public class Dash extends Surface {
int x = 0;
int y = h - 34;
BasicStroke bs[] = new BasicStroke[6];
BasicStroke[] bs = new BasicStroke[6];
float j = 1.1f;
for (int i = 0; i < bs.length; i++, j += 1.0f) {
float dash[] = { j };
float[] dash = { j };
BasicStroke b = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f);
g2.setStroke(b);
@ -128,7 +128,7 @@ public class Dash extends Surface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Dash());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -113,7 +113,7 @@ public class Joins extends ControlsSurface {
g2.draw(bs.createStrokedShape(p));
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new Joins());
}
@ -121,12 +121,12 @@ public class Joins extends ControlsSurface {
class DemoControls extends CustomControls implements ActionListener {
Joins demo;
int joinType[] = { BasicStroke.JOIN_MITER,
int[] joinType = { BasicStroke.JOIN_MITER,
BasicStroke.JOIN_ROUND, BasicStroke.JOIN_BEVEL };
String joinName[] = { "Mitered Join", "Rounded Join", "Beveled Join" };
String[] joinName = { "Mitered Join", "Rounded Join", "Beveled Join" };
JMenu menu;
JMenuItem menuitem[] = new JMenuItem[joinType.length];
JoinIcon icons[] = new JoinIcon[joinType.length];
JMenuItem[] menuitem = new JMenuItem[joinType.length];
JoinIcon[] icons = new JoinIcon[joinType.length];
JToolBar toolbar;
@SuppressWarnings("LeakingThisInConstructor")

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -55,18 +55,18 @@ import java2d.AnimatingSurface;
@SuppressWarnings("serial")
public class LineAnim extends AnimatingSurface {
private static int caps[] = { BasicStroke.CAP_BUTT,
private static int[] caps = { BasicStroke.CAP_BUTT,
BasicStroke.CAP_SQUARE, BasicStroke.CAP_ROUND };
private static int joins[] = { BasicStroke.JOIN_MITER,
private static int[] joins = { BasicStroke.JOIN_MITER,
BasicStroke.JOIN_BEVEL, BasicStroke.JOIN_ROUND };
private static Color colors[] = { GRAY, PINK, LIGHT_GRAY };
private static Color[] colors = { GRAY, PINK, LIGHT_GRAY };
private static BasicStroke bs1 = new BasicStroke(1.0f);
private static final int CLOCKWISE = 0;
private Line2D lines[] = new Line2D[3];
private int rAmt[] = new int[lines.length];
private int direction[] = new int[lines.length];
private int speed[] = new int[lines.length];
private BasicStroke strokes[] = new BasicStroke[lines.length];
private Line2D[] lines = new Line2D[3];
private int[] rAmt = new int[lines.length];
private int[] direction = new int[lines.length];
private int[] speed = new int[lines.length];
private BasicStroke[] strokes = new BasicStroke[lines.length];
private GeneralPath path;
private Point2D[] pts;
private float size;
@ -158,7 +158,7 @@ public class LineAnim extends AnimatingSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new LineAnim());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -65,11 +65,11 @@ import javax.swing.JToolBar;
@SuppressWarnings("serial")
public class Balls extends AnimatingControlsSurface {
private static Color colors[] = { RED, ORANGE, YELLOW, GREEN.darker(), BLUE,
private static Color[] colors = { RED, ORANGE, YELLOW, GREEN.darker(), BLUE,
new Color(75, 00, 82), new Color(238, 130, 238) };
private long now, deltaT, lasttime;
private boolean active;
protected Ball balls[] = new Ball[colors.length];
protected Ball[] balls = new Ball[colors.length];
protected boolean clearToggle;
protected JComboBox combo;
@ -129,7 +129,7 @@ public class Balls extends AnimatingControlsSurface {
lasttime = now;
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Balls());
}
@ -141,7 +141,7 @@ public class Balls extends AnimatingControlsSurface {
public float x, y;
public float Vx = 0.1f;
public float Vy = 0.05f;
public BufferedImage imgs[];
public BufferedImage[] imgs;
// Pick a random starting image index, but not the last: we're going UP
// and that would throw us off the end.
public int index = (int) (random() * (nImgs - 1));
@ -182,11 +182,11 @@ public class Balls extends AnimatingControlsSurface {
imgs = new BufferedImage[nImgs];
int bg = 255;
byte red[] = new byte[256];
byte[] red = new byte[256];
red[0] = (byte) bg;
byte green[] = new byte[256];
byte[] green = new byte[256];
green[0] = (byte) bg;
byte blue[] = new byte[256];
byte[] blue = new byte[256];
blue[0] = (byte) bg;
for (int r = 0; r < imgs.length; r++) {
@ -202,7 +202,7 @@ public class Balls extends AnimatingControlsSurface {
IndexColorModel icm = new IndexColorModel(8, maxr + 1,
red, green, blue, 0);
DataBufferByte dbb = new DataBufferByte(data, data.length);
int bandOffsets[] = { 0 };
int[] bandOffsets = { 0 };
WritableRaster wr = Raster.createInterleavedRaster(dbb,
R * 2, R * 2, R * 2, 1, bandOffsets, null);
imgs[r] = new BufferedImage(icm, wr, icm.isAlphaPremultiplied(),

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -72,7 +72,7 @@ import javax.swing.JToolBar;
@SuppressWarnings("serial")
public class BezierScroller extends AnimatingControlsSurface {
private static String appletStrs[] = { " ", "J2Ddemo",
private static String[] appletStrs = { " ", "J2Ddemo",
"BezierScroller - Animated Bezier Curve shape with images",
"For README.txt file scrolling run in application mode", " " };
private static final int NUMPTS = 6;
@ -84,8 +84,8 @@ public class BezierScroller extends AnimatingControlsSurface {
private static BufferedImage img;
private static final int UP = 0;
private static final int DOWN = 1;
private float animpts[] = new float[NUMPTS * 2];
private float deltas[] = new float[NUMPTS * 2];
private float[] animpts = new float[NUMPTS * 2];
private float[] deltas = new float[NUMPTS * 2];
private BufferedReader reader;
private int nStrs;
private int strH;
@ -293,7 +293,7 @@ public class BezierScroller extends AnimatingControlsSurface {
g2.fill(gp);
PathIterator pi = gp.getPathIterator(null);
float pts[] = new float[6];
float[] pts = new float[6];
while (!pi.isDone()) {
if (pi.currentSegment(pts) == PathIterator.SEG_CUBICTO) {
g2.drawImage(hotj_img, (int) pts[0], (int) pts[1], this);
@ -310,7 +310,7 @@ public class BezierScroller extends AnimatingControlsSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new BezierScroller());
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -67,7 +67,7 @@ import javax.swing.JTextField;
@SuppressWarnings("serial")
public class Stars3D extends ControlsSurface {
private static Color colors[] = { RED, GREEN, WHITE };
private static Color[] colors = { RED, GREEN, WHITE };
private static AffineTransform at = AffineTransform.getTranslateInstance(-5,
-5);
private Shape shape, tshape;
@ -99,8 +99,8 @@ public class Stars3D extends ControlsSurface {
tshape = at.createTransformedShape(shape);
PathIterator pi = shape.getPathIterator(null);
float seg[] = new float[6];
float tseg[] = new float[6];
float[] seg = new float[6];
float[] tseg = new float[6];
GeneralPath working = new GeneralPath(Path2D.WIND_NON_ZERO);
float x = 0, y = 0; // Current point on the path
@ -247,7 +247,7 @@ public class Stars3D extends ControlsSurface {
g2.draw(shape);
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new Stars3D());
}
@ -306,8 +306,8 @@ public class Stars3D extends ControlsSurface {
return;
}
int length = getSize().width / 4;
int size[] = { length, length };
String str[] = { "OpenJDK", "J2D" };
int[] size = { length, length };
String[] str = { "OpenJDK", "J2D" };
while (thread == me) {
for (int i = 0; i < str.length; i++) {
demo.fontSize = size[i];

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -258,7 +258,7 @@ public class GradAnim extends AnimatingControlsSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new GradAnim());
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -93,7 +93,7 @@ public class Gradient extends ControlsSurface {
(int) (h / 2 + tl.getBounds().getHeight() / 2));
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new Gradient());
}
@ -101,13 +101,13 @@ public class Gradient extends ControlsSurface {
static class DemoControls extends CustomControls implements ActionListener {
Gradient demo;
Color colors[] = { red, orange, yellow, green, blue, lightGray, cyan,
Color[] colors = { red, orange, yellow, green, blue, lightGray, cyan,
magenta };
String colorName[] = { "Red", "Orange", "Yellow", "Green",
String[] colorName = { "Red", "Orange", "Yellow", "Green",
"Blue", "lightGray", "Cyan", "Magenta" };
JMenuItem innerMI[] = new JMenuItem[colors.length];
JMenuItem outerMI[] = new JMenuItem[colors.length];
ColoredSquare squares[] = new ColoredSquare[colors.length];
JMenuItem[] innerMI = new JMenuItem[colors.length];
JMenuItem[] outerMI = new JMenuItem[colors.length];
ColoredSquare[] squares = new ColoredSquare[colors.length];
JMenu imenu, omenu;
@SuppressWarnings("LeakingThisInConstructor")

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -166,7 +166,7 @@ public class Texture extends Surface {
g2.fill(sha);
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new Texture());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -80,7 +80,7 @@ public final class TextureAnim extends AnimatingControlsSurface {
private boolean sheary = false;
private boolean showanchor = true;
private AnimVal w, h, x, y, rot, shx, shy;
private static Image img[] = new Image[2];
private static Image[] img = new Image[2];
public TextureAnim() {
img[0] = getImage("duke.gif"); // 8 bit gif
@ -218,7 +218,7 @@ public final class TextureAnim extends AnimatingControlsSurface {
}
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new TextureAnim());
}
@ -301,7 +301,7 @@ public final class TextureAnim extends AnimatingControlsSurface {
JToolBar toolbar;
JComboBox combo;
JMenu menu;
JMenuItem menuitems[];
JMenuItem[] menuitems;
int iconSize = 20;
ButtonBorder buttonBorder = new ButtonBorder();

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -77,7 +77,7 @@ public class Append extends Surface {
g2.drawString("Append, connect", (int) (w * .25), (int) (h * .6) - 5);
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new Append());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -66,7 +66,7 @@ public class CurveQuadTo extends Surface {
g2.drawString("quadTo", (int) (w * .2), (int) (h * .6f) - 5);
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new CurveQuadTo());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -69,7 +69,7 @@ public class FillStroke extends Surface {
tl.draw(g2, (float) (w / 2 - tl.getBounds().getWidth() / 2), h * .85f);
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new FillStroke());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -86,7 +86,7 @@ public class WindingRule extends Surface {
g2.drawString("EVEN_ODD rule", 0, -5);
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new WindingRule());
}
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -99,7 +99,7 @@ public class Rotate extends ControlsSurface {
g2.drawString("Rotate", 5, 15);
}
public static void main(String s[]) {
public static void main(String[] s) {
createDemoFrame(new Rotate());
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -232,7 +232,7 @@ public class SelectTx extends AnimatingControlsSurface {
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new SelectTx());
}

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -107,16 +107,16 @@ public final class TransformAnim extends AnimatingControlsSurface {
}
private static BasicStroke bs = new BasicStroke(6);
private static Font fonts[] = {
private static Font[] fonts = {
new Font(Font.SERIF, PLAIN, 48),
new Font(Font.SERIF, BOLD|ITALIC, 24),
new Font(Font.MONOSPACED, BOLD, 36),
new Font(Font.SANS_SERIF, BOLD|ITALIC, 64),
new Font(Font.SANS_SERIF, PLAIN, 52)};
private static String strings[] = {
private static String[] strings = {
"Transformation", "Rotate", "Translate", "Shear", "Scale" };
private static String imgs[] = { "duke.png" };
private static Paint paints[] = {
private static String[] imgs = { "duke.png" };
private static Paint[] paints = {
RED, BLUE, texturePaint, GREEN, MAGENTA, ORANGE, PINK, CYAN,
new Color(0, 255, 0, 128), new Color(0, 0, 255, 128),
YELLOW, LIGHT_GRAY, WHITE};
@ -253,7 +253,7 @@ public final class TransformAnim extends AnimatingControlsSurface {
}
public static void main(String argv[]) {
public static void main(String[] argv) {
createDemoFrame(new TransformAnim());
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -615,7 +615,7 @@ public final class SampleTree {
}
} // End of class SampleTree.TreeEditableChangeListener
public static void main(String args[]) {
public static void main(String[] args) {
try {
SwingUtilities.invokeAndWait(new Runnable() {

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -64,11 +64,11 @@ class BezierAnimationPanel extends JPanel implements Runnable {
public final int NUMPTS = 6;
float animpts[] = new float[NUMPTS * 2];
float[] animpts = new float[NUMPTS * 2];
float deltas[] = new float[NUMPTS * 2];
float[] deltas = new float[NUMPTS * 2];
float staticpts[] = {
float[] staticpts = {
50.0f, 0.0f,
150.0f, 0.0f,
200.0f, 75.0f,
@ -77,7 +77,7 @@ class BezierAnimationPanel extends JPanel implements Runnable {
0.0f, 75.0f,
};
float movepts[] = new float[staticpts.length];
float[] movepts = new float[staticpts.length];
BufferedImage img;

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -350,7 +350,7 @@ public class ListDemo extends DemoModule {
}
}
ImageIcon images[] = new ImageIcon[7];
ImageIcon[] images = new ImageIcon[7];
void loadImages() {
images[0] = createImageIcon("list/red.gif", getString("ListDemo.red"));
images[1] = createImageIcon("list/blue.gif", getString("ListDemo.blue"));

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -149,19 +149,19 @@ public class TabbedPaneDemo extends DemoModule implements ActionListener {
class HeadSpin extends JComponent implements ActionListener {
javax.swing.Timer animator;
ImageIcon icon[] = new ImageIcon[6];
ImageIcon[] icon = new ImageIcon[6];
int tmpScale;
static final int numImages = 6;
double x[] = new double[numImages];
double y[] = new double[numImages];
double[] x = new double[numImages];
double[] y = new double[numImages];
int xh[] = new int[numImages];
int yh[] = new int[numImages];
int[] xh = new int[numImages];
int[] yh = new int[numImages];
double scale[] = new double[numImages];
double[] scale = new double[numImages];
public HeadSpin() {
setBackground(Color.black);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -248,7 +248,7 @@ public final class TableExample implements LayoutManager {
return scrollpane;
}
public static void main(String s[]) {
public static void main(String[] s) {
// Trying to set Nimbus look and feel
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -71,7 +71,7 @@ import javax.swing.table.TableColumnModel;
@SuppressWarnings("serial")
public final class TableSorter extends TableMap {
int indexes[];
int[] indexes;
List<Integer> sortingColumns = new ArrayList<Integer>();
boolean ascending = true;
int compares;
@ -249,7 +249,7 @@ public final class TableSorter extends TableMap {
// arrays. The number of compares appears to vary between N-1 and
// NlogN depending on the initial order but the main reason for
// using it here is that, unlike qsort, it is stable.
public void shuttlesort(int from[], int to[], int low, int high) {
public void shuttlesort(int[] from, int[] to, int low, int high) {
if (high - low < 2) {
return;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -669,7 +669,7 @@ public class AWTEventMonitor {
* @see AWTEventMonitor
*/
protected void installListeners() {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) {
installListeners(topLevelWindows[i]);
@ -685,7 +685,7 @@ public class AWTEventMonitor {
* @see EventID
*/
protected void installListeners(int eventID) {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) {
installListeners(topLevelWindows[i], eventID);
@ -943,7 +943,7 @@ public class AWTEventMonitor {
* @see EventID
*/
protected void removeListeners(int eventID) {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) {
removeListeners(topLevelWindows[i], eventID);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -128,7 +128,7 @@ public class AccessibilityEventMonitor {
* @see AWTEventMonitor
*/
protected void installListeners() {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) {
if (topLevelWindows[i] instanceof Accessible) {
@ -206,7 +206,7 @@ public class AccessibilityEventMonitor {
* @see EventID
*/
protected void removeListeners() {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) {
if (topLevelWindows[i] instanceof Accessible) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -318,7 +318,7 @@ public class Translator extends AccessibleContext
if (source instanceof Component) {
Container parent = ((Component) source).getParent();
if (parent != null) {
Component ca[] = parent.getComponents();
Component[] ca = parent.getComponents();
for (int i = 0; i < ca.length; i++) {
if (source.equals(ca[i])) {
return i;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 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
@ -291,9 +291,9 @@ final public class AccessBridge {
* map an HWND to an AWT Component
*/
private void initHWNDcalls() {
Class<?> integerParemter[] = new Class<?>[1];
Class<?>[] integerParemter = new Class<?>[1];
integerParemter[0] = Integer.TYPE;
Class<?> componentParemter[] = new Class<?>[1];
Class<?>[] componentParemter = new Class<?>[1];
try {
componentParemter[0] = Class.forName("java.awt.Component");
} catch (ClassNotFoundException e) {