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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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 { public static class CompatImg extends Destinations {
int transparency; int transparency;
public static String ShortNames[] = { public static String[] ShortNames = {
"compatimg", "compatimg",
"opqcompatimg", "opqcompatimg",
"bmcompatimg", "bmcompatimg",
"transcompatimg", "transcompatimg",
}; };
public static String ShortDescriptions[] = { public static String[] ShortDescriptions = {
"Default", "Default",
"Opaque", "Opaque",
"Bitmask", "Bitmask",
"Translucent", "Translucent",
}; };
public static String LongDescriptions[] = { public static String[] LongDescriptions = {
"Default Compatible Image", "Default Compatible Image",
"Opaque Compatible Image", "Opaque Compatible Image",
"Bitmask Compatible Image", "Bitmask Compatible Image",
"Translucent Compatible Image", "Translucent Compatible Image",
}; };
public static String ModifierNames[] = { public static String[] ModifierNames = {
"CompatImage()", "CompatImage()",
"CompatImage(Opaque)", "CompatImage(Opaque)",
"CompatImage(Bitmask)", "CompatImage(Bitmask)",
@ -282,7 +282,7 @@ public abstract class Destinations extends Option.Enable {
int type; int type;
Image img; Image img;
public static String ShortNames[] = { public static String[] ShortNames = {
"custom", "custom",
"IntXrgb", "IntXrgb",
"IntArgb", "IntArgb",
@ -299,7 +299,7 @@ public abstract class Destinations extends Option.Enable {
"ByteIndexed", "ByteIndexed",
}; };
public static String Descriptions[] = { public static String[] Descriptions = {
"Custom Image", "Custom Image",
"32-bit XRGB Packed Image", "32-bit XRGB Packed Image",
"32-bit ARGB Packed Image", "32-bit ARGB Packed Image",

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -187,7 +187,7 @@ public class J2DBench {
System.exit(exitcode); System.exit(exitcode);
} }
public static void main(String argv[]) { public static void main(String[] argv) {
init(); init();
TestEnvironment.init(); TestEnvironment.init();
Result.init(); Result.init();
@ -310,8 +310,8 @@ public class J2DBench {
if (argv[i].indexOf(":") >= 0) { if (argv[i].indexOf(":") >= 0) {
String values[] = argv[i].split(":"); String[] values = argv[i].split(":");
int intVals[] = new int[3]; int[] intVals = new int[3];
for(int j=0; j<values.length; j++) { for(int j=0; j<values.length; j++) {
try { try {

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

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -51,7 +51,7 @@ public class ResultSet {
static Hashtable ignoreprops; static Hashtable ignoreprops;
// Preferred props - will be listed even if undefined // Preferred props - will be listed even if undefined
static String preferredkeys[] = { static String[] preferredkeys = {
"java.version", "java.version",
"java.runtime.version", "java.runtime.version",
"java.class.version", "java.class.version",
@ -69,7 +69,7 @@ public class ResultSet {
}; };
// Ignored props - will not be copied to results file // Ignored props - will not be copied to results file
static String ignoredkeys[] = { static String[] ignoredkeys = {
"user.dir", "user.dir",
"user.home", "user.home",
"user.timezone", "user.timezone",

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -468,7 +468,7 @@ public class HTMLSeriesReporter {
/** /**
* main * main
*/ */
public static void main(String args[]) { public static void main(String[] args) {
String resDir = "."; String resDir = ".";
ArrayList results = new ArrayList(); ArrayList results = new ArrayList();

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -284,7 +284,7 @@ public class IIOComparator {
String key = (String)e.nextElement(); String key = (String)e.nextElement();
keylist.add(key); keylist.add(key);
} }
String keys[] = new String[keylist.size()]; String[] keys = new String[keylist.size()];
keylist.copyInto(keys); keylist.copyInto(keys);
if (special) { if (special) {
sort2(keys); sort2(keys);
@ -294,7 +294,7 @@ public class IIOComparator {
return keys; return keys;
} }
public static void sort(String strs[]) { public static void sort(String[] strs) {
for (int i = 1; i < strs.length; i++) { for (int i = 1; i < strs.length; i++) {
for (int j = i; j > 0; j--) { for (int j = i; j > 0; j--) {
if (strs[j].compareTo(strs[j-1]) >= 0) { 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 i = 1; i < strs.length; i++) {
for (int j = i; j > 0; j--) { for (int j = i; j > 0; j--) {
if (compare(strs[j-1], strs[j])) { if (compare(strs[j-1], strs[j])) {

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

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

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

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

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

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -57,7 +57,7 @@ public class EnableButton extends JButton implements ActionListener {
private Group group; private Group group;
private int type; private int type;
public static final String icons[] = { public static final String[] icons = {
"Set", "Set",
"Clear", "Clear",
"Invert", "Invert",

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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 { try {
SwingUtilities.invokeAndWait(new Runnable() { SwingUtilities.invokeAndWait(new Runnable() {

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

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -161,7 +161,7 @@ public final class CloningFeature extends JPanel implements Runnable {
return; return;
} }
Component cmps[] = dg.clonePanels[0].getComponents(); Component[] cmps = dg.clonePanels[0].getComponents();
for (int i = 0; i < cmps.length && thread != null; i++) { for (int i = 0; i < cmps.length && thread != null; i++) {
if ((dp = (DemoPanel) cmps[i]).tools == null) { if ((dp = (DemoPanel) cmps[i]).tools == null) {
continue; continue;

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -74,8 +74,8 @@ public class DemoPanel extends JPanel {
} }
if (obj instanceof CustomControlsContext) { if (obj instanceof CustomControlsContext) {
ccc = (CustomControlsContext) obj; ccc = (CustomControlsContext) obj;
Component cmps[] = ccc.getControls(); Component[] cmps = ccc.getControls();
String cons[] = ccc.getConstraints(); String[] cons = ccc.getConstraints();
for (int i = 0; i < cmps.length; i++) { for (int i = 0; i < cmps.length; i++) {
add(cmps[i], cons[i]); add(cmps[i], cons[i]);
} }

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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() { SwingUtilities.invokeLater(new Runnable() {
@Override @Override
public void run() { public void run() {

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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 Font font = new Font(Font.SERIF, Font.PLAIN, 11);
private Runtime r = Runtime.getRuntime(); private Runtime r = Runtime.getRuntime();
private int columnInc; private int columnInc;
private int pts[]; private int[] pts;
private int ptNum; private int ptNum;
private int ascent, descent; private int ascent, descent;
private Rectangle graphOutlineRect = new Rectangle(); private Rectangle graphOutlineRect = new Rectangle();
@ -247,7 +247,7 @@ public class MemoryMonitor extends JPanel {
pts = new int[graphW]; pts = new int[graphW];
ptNum = 0; ptNum = 0;
} else if (pts.length != graphW) { } else if (pts.length != graphW) {
int tmp[] = null; int[] tmp = null;
if (ptNum < graphW) { if (ptNum < graphW) {
tmp = new int[ptNum]; tmp = new int[ptNum];
System.arraycopy(pts, 0, tmp, 0, tmp.length); 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(); final MemoryMonitor demo = new MemoryMonitor();
WindowListener l = new WindowAdapter() { WindowListener l = new WindowAdapter() {

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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"); Frame f = new Frame("J2D Demo - TextureChooser");
f.addWindowListener(new WindowAdapter() { f.addWindowListener(new WindowAdapter() {

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -45,7 +45,7 @@ import static java.awt.Color.*;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class Arcs extends AnimatingSurface { 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 CLOSE = 0;
private static final int OPEN = 1; private static final int OPEN = 1;
private static final int FORWARD = 0; private static final int FORWARD = 0;
@ -159,7 +159,7 @@ public class Arcs extends AnimatingSurface {
g2.fill(at.createTransformedShape(pieArc)); g2.fill(at.createTransformedShape(pieArc));
} }
public static void main(String argv[]) { public static void main(String[] argv) {
createDemoFrame(new Arcs()); createDemoFrame(new Arcs());
} }
} }

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -52,7 +52,7 @@ import static java.awt.geom.PathIterator.*;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class Curves extends Surface { public class Curves extends Surface {
private static Color colors[] = { BLUE, GREEN, RED }; private static Color[] colors = { BLUE, GREEN, RED };
public Curves() { public Curves() {
setBackground(WHITE); 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()); createDemoFrame(new Curves());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -44,12 +44,12 @@ import static java.awt.Color.*;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public final class Ellipses extends AnimatingSurface { public final class Ellipses extends AnimatingSurface {
private static Color colors[] = { private static Color[] colors = {
BLUE, CYAN, GREEN, MAGENTA, ORANGE, PINK, RED, BLUE, CYAN, GREEN, MAGENTA, ORANGE, PINK, RED,
YELLOW, LIGHT_GRAY, WHITE }; YELLOW, LIGHT_GRAY, WHITE };
private Ellipse2D.Float[] ellipses; private Ellipse2D.Float[] ellipses;
private double esize[]; private double[] esize;
private float estroke[]; private float[] estroke;
private double maxSize; private double maxSize;
public Ellipses() { 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()); createDemoFrame(new Ellipses());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -141,7 +141,7 @@ public class Areas extends ControlsSurface {
g2.draw(area); g2.draw(area);
} }
public static void main(String argv[]) { public static void main(String[] argv) {
createDemoFrame(new Areas()); createDemoFrame(new Areas());
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -61,7 +61,7 @@ public class ClipAnim extends AnimatingControlsSurface {
big.fillRect(0, 0, 3, 3); big.fillRect(0, 0, 3, 3);
texturePaint = new TexturePaint(bi, new Rectangle(0, 0, 5, 5)); 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; protected boolean doObjects = true;
private Font originalFont = new Font(Font.SERIF, Font.PLAIN, 12); private Font originalFont = new Font(Font.SERIF, Font.PLAIN, 12);
private Font font; 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()); createDemoFrame(new ClipAnim());
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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()); createDemoFrame(new Intersection());
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -161,7 +161,7 @@ public class Text extends ControlsSurface {
g2.draw(shape); g2.draw(shape);
} }
public static void main(String s[]) { public static void main(String[] s) {
createDemoFrame(new Text()); createDemoFrame(new Text());
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -53,7 +53,7 @@ public class BullsEye extends Surface {
@Override @Override
public void render(int w, int h, Graphics2D g2) { 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++) { for (int N = 0; N < 18; N++) {
float i = (N + 2) / 2.0f; float i = (N + 2) / 2.0f;
float x = (5 + i * (w / 2 / 10)); 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()); createDemoFrame(new BullsEye());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -65,7 +65,7 @@ import java2d.Surface;
public class ColorConvert extends Surface { public class ColorConvert extends Surface {
private static Image img; private static Image img;
private static Color colors[] = { red, pink, orange, private static Color[] colors = { red, pink, orange,
yellow, green, magenta, cyan, blue }; yellow, green, magenta, cyan, blue };
public ColorConvert() { public ColorConvert() {
@ -123,7 +123,7 @@ public class ColorConvert extends Surface {
g2.drawImage(dstImg, w / 2 + 10, 20, w / 2 - 20, h - 30, null); 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()); createDemoFrame(new ColorConvert());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -50,7 +50,7 @@ import java2d.AnimatingSurface;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class Rotator3D extends AnimatingSurface { public class Rotator3D extends AnimatingSurface {
private Objects3D objs[] = new Objects3D[3]; private Objects3D[] objs = new Objects3D[3];
private static final int[][][] polygons = { private static final int[][][] polygons = {
// Solid cube // Solid cube
{ { 5, 1, 15, 13, 21, 23, 15 }, { { 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()); createDemoFrame(new Rotator3D());
} }
@ -170,8 +170,8 @@ public class Rotator3D extends AnimatingSurface {
private double ix = 3.0, iy = 3.0; private double ix = 3.0, iy = 3.0;
private double[][] rotPts; private double[][] rotPts;
private int[][] scrPts; private int[][] scrPts;
private int xx[] = new int[20]; private int[] xx = new int[20];
private int yy[] = new int[20]; private int[] yy = new int[20];
private double x, y; private double x, y;
private int p, j; private int p, j;
private int colour; private int colour;

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -61,11 +61,11 @@ import java2d.Surface;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class ACimages extends Surface { public class ACimages extends Surface {
private static final String s[] = { "box", "fight", "magnify", private static final String[] s = { "box", "fight", "magnify",
"boxwave", "globe", "snooze", "boxwave", "globe", "snooze",
"tip", "thumbsup", "dukeplug" }; "tip", "thumbsup", "dukeplug" };
private static Image imgs[] = new Image[s.length]; private static Image[] imgs = new Image[s.length];
private static Color colors[] = { BLUE, CYAN, GREEN, private static Color[] colors = { BLUE, CYAN, GREEN,
MAGENTA, ORANGE, PINK, RED, YELLOW, LIGHT_GRAY }; MAGENTA, ORANGE, PINK, RED, YELLOW, LIGHT_GRAY };
public ACimages() { 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()); createDemoFrame(new ACimages());
} }
} }

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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)); texturePaint = new TexturePaint(bi, new Rectangle(0, 0, w, h));
} }
private static BasicStroke bs = new BasicStroke(6); 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.PLAIN, 64),
new Font(Font.SERIF, Font.BOLD | Font.ITALIC, 24), new Font(Font.SERIF, Font.BOLD | Font.ITALIC, 24),
new Font(Font.MONOSPACED, Font.BOLD, 36), new Font(Font.MONOSPACED, Font.BOLD, 36),
new Font(Font.SANS_SERIF, Font.BOLD | Font.ITALIC, 48), new Font(Font.SANS_SERIF, Font.BOLD | Font.ITALIC, 48),
new Font(Font.SANS_SERIF, Font.PLAIN, 52) }; new Font(Font.SANS_SERIF, Font.PLAIN, 52) };
private static String strings[] = { private static String[] strings = {
"Alpha", "Composite", "Src", "SrcOver", "Alpha", "Composite", "Src", "SrcOver",
"SrcIn", "SrcOut", "Clear", "DstOver", "DstIn" }; "SrcIn", "SrcOut", "Clear", "DstOver", "DstIn" };
private static String imgs[] = { private static String[] imgs = {
"jumptojavastrip.png", "duke.png", "star7.png" }; "jumptojavastrip.png", "duke.png", "star7.png" };
private static Paint paints[] = { private static Paint[] paints = {
RED, BLUE, GREEN, MAGENTA, RED, BLUE, GREEN, MAGENTA,
ORANGE, PINK, CYAN, texturePaint, ORANGE, PINK, CYAN, texturePaint,
YELLOW, LIGHT_GRAY, WHITE }; 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()); createDemoFrame(new FadeAnim());
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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()); createDemoFrame(new AllFonts());
} }
@ -135,9 +135,9 @@ public class AllFonts extends AnimatingControlsSurface {
AllFonts demo; AllFonts demo;
JSlider slider; JSlider slider;
int fsize[] = { 8, 14, 18, 24 }; int[] fsize = { 8, 14, 18, 24 };
JMenuItem menuitem[] = new JMenuItem[fsize.length]; JMenuItem[] menuitem = new JMenuItem[fsize.length];
Font font[] = new Font[fsize.length]; Font[] font = new Font[fsize.length];
@SuppressWarnings("LeakingThisInConstructor") @SuppressWarnings("LeakingThisInConstructor")
public DemoControls(AllFonts demo) { public DemoControls(AllFonts demo) {

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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()); createDemoFrame(new AttributedStr());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -55,8 +55,8 @@ import java2d.AnimatingSurface;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class Highlighting extends AnimatingSurface { public class Highlighting extends AnimatingSurface {
private static String text[] = { "HIGHLIGHTING", "OpenJDK" }; private static String[] text = { "HIGHLIGHTING", "OpenJDK" };
private static Color colors[] = { CYAN, LIGHT_GRAY }; private static Color[] colors = { CYAN, LIGHT_GRAY };
private static Font smallF = new Font("Monospaced", Font.PLAIN, 8); private static Font smallF = new Font("Monospaced", Font.PLAIN, 8);
private int[] curPos; private int[] curPos;
private TextLayout[] layouts; 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()); createDemoFrame(new Highlighting());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -109,7 +109,7 @@ public class Outline extends Surface {
g2.fill(sha); g2.fill(sha);
} }
public static void main(String s[]) { public static void main(String[] s) {
createDemoFrame(new Outline()); createDemoFrame(new Outline());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -90,7 +90,7 @@ public class Tree extends AnimatingSurface {
static double Twidth = 0.6; static double Twidth = 0.6;
static double Rwidth = 0.6; static double Rwidth = 0.6;
static double FontHeight = 0.75; static double FontHeight = 0.75;
static Color colors[] = { BLUE, static Color[] colors = { BLUE,
RED.darker(), RED.darker(),
GREEN.darker() }; GREEN.darker() };
@ -123,7 +123,7 @@ public class Tree extends AnimatingSurface {
g2d.setTransform(new AffineTransform()); g2d.setTransform(new AffineTransform());
} }
public static void main(String argv[]) { public static void main(String[] argv) {
createDemoFrame(new Tree()); createDemoFrame(new Tree());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -91,7 +91,7 @@ public class DukeAnim extends AnimatingSurface implements ImageObserver {
return isShowing(); return isShowing();
} }
public static void main(String s[]) { public static void main(String[] s) {
createDemoFrame(new DukeAnim()); createDemoFrame(new DukeAnim());
} }
} }

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -176,7 +176,7 @@ public class JPEGFlip extends Surface {
g2.drawLine(0, hh, w, hh); g2.drawLine(0, hh, w, hh);
} }
public static void main(String s[]) { public static void main(String[] s) {
createDemoFrame(new JPEGFlip()); createDemoFrame(new JPEGFlip());
} }
} }

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -53,8 +53,8 @@ import java2d.Surface;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class Caps extends Surface { public class Caps extends Surface {
private static int cap[] = { CAP_BUTT, CAP_ROUND, CAP_SQUARE }; private static int[] cap = { CAP_BUTT, CAP_ROUND, CAP_SQUARE };
private static String desc[] = { "Butt Cap", "Round Cap", "Square Cap" }; private static String[] desc = { "Butt Cap", "Round Cap", "Square Cap" };
public Caps() { public Caps() {
setBackground(WHITE); 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()); createDemoFrame(new Caps());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -76,11 +76,11 @@ public class Dash extends Surface {
int x = 0; int x = 0;
int y = h - 34; int y = h - 34;
BasicStroke bs[] = new BasicStroke[6]; BasicStroke[] bs = new BasicStroke[6];
float j = 1.1f; float j = 1.1f;
for (int i = 0; i < bs.length; i++, j += 1.0f) { 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 b = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f); BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f);
g2.setStroke(b); 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()); createDemoFrame(new Dash());
} }
} }

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -55,18 +55,18 @@ import java2d.AnimatingSurface;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class LineAnim extends AnimatingSurface { 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 }; 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 }; 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 BasicStroke bs1 = new BasicStroke(1.0f);
private static final int CLOCKWISE = 0; private static final int CLOCKWISE = 0;
private Line2D lines[] = new Line2D[3]; private Line2D[] lines = new Line2D[3];
private int rAmt[] = new int[lines.length]; private int[] rAmt = new int[lines.length];
private int direction[] = new int[lines.length]; private int[] direction = new int[lines.length];
private int speed[] = new int[lines.length]; private int[] speed = new int[lines.length];
private BasicStroke strokes[] = new BasicStroke[lines.length]; private BasicStroke[] strokes = new BasicStroke[lines.length];
private GeneralPath path; private GeneralPath path;
private Point2D[] pts; private Point2D[] pts;
private float size; 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()); createDemoFrame(new LineAnim());
} }
} }

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

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

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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()); createDemoFrame(new GradAnim());
} }

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

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -166,7 +166,7 @@ public class Texture extends Surface {
g2.fill(sha); g2.fill(sha);
} }
public static void main(String s[]) { public static void main(String[] s) {
createDemoFrame(new Texture()); createDemoFrame(new Texture());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -80,7 +80,7 @@ public final class TextureAnim extends AnimatingControlsSurface {
private boolean sheary = false; private boolean sheary = false;
private boolean showanchor = true; private boolean showanchor = true;
private AnimVal w, h, x, y, rot, shx, shy; 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() { public TextureAnim() {
img[0] = getImage("duke.gif"); // 8 bit gif 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()); createDemoFrame(new TextureAnim());
} }
@ -301,7 +301,7 @@ public final class TextureAnim extends AnimatingControlsSurface {
JToolBar toolbar; JToolBar toolbar;
JComboBox combo; JComboBox combo;
JMenu menu; JMenu menu;
JMenuItem menuitems[]; JMenuItem[] menuitems;
int iconSize = 20; int iconSize = 20;
ButtonBorder buttonBorder = new ButtonBorder(); ButtonBorder buttonBorder = new ButtonBorder();

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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); 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()); createDemoFrame(new Append());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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); 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()); createDemoFrame(new CurveQuadTo());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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); 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()); createDemoFrame(new FillStroke());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -86,7 +86,7 @@ public class WindingRule extends Surface {
g2.drawString("EVEN_ODD rule", 0, -5); g2.drawString("EVEN_ODD rule", 0, -5);
} }
public static void main(String s[]) { public static void main(String[] s) {
createDemoFrame(new WindingRule()); createDemoFrame(new WindingRule());
} }
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -99,7 +99,7 @@ public class Rotate extends ControlsSurface {
g2.drawString("Rotate", 5, 15); g2.drawString("Rotate", 5, 15);
} }
public static void main(String s[]) { public static void main(String[] s) {
createDemoFrame(new Rotate()); createDemoFrame(new Rotate());
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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()); createDemoFrame(new SelectTx());
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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 BasicStroke bs = new BasicStroke(6);
private static Font fonts[] = { private static Font[] fonts = {
new Font(Font.SERIF, PLAIN, 48), new Font(Font.SERIF, PLAIN, 48),
new Font(Font.SERIF, BOLD|ITALIC, 24), new Font(Font.SERIF, BOLD|ITALIC, 24),
new Font(Font.MONOSPACED, BOLD, 36), new Font(Font.MONOSPACED, BOLD, 36),
new Font(Font.SANS_SERIF, BOLD|ITALIC, 64), new Font(Font.SANS_SERIF, BOLD|ITALIC, 64),
new Font(Font.SANS_SERIF, PLAIN, 52)}; new Font(Font.SANS_SERIF, PLAIN, 52)};
private static String strings[] = { private static String[] strings = {
"Transformation", "Rotate", "Translate", "Shear", "Scale" }; "Transformation", "Rotate", "Translate", "Shear", "Scale" };
private static String imgs[] = { "duke.png" }; private static String[] imgs = { "duke.png" };
private static Paint paints[] = { private static Paint[] paints = {
RED, BLUE, texturePaint, GREEN, MAGENTA, ORANGE, PINK, CYAN, RED, BLUE, texturePaint, GREEN, MAGENTA, ORANGE, PINK, CYAN,
new Color(0, 255, 0, 128), new Color(0, 0, 255, 128), new Color(0, 255, 0, 128), new Color(0, 0, 255, 128),
YELLOW, LIGHT_GRAY, WHITE}; 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()); createDemoFrame(new TransformAnim());
} }

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -615,7 +615,7 @@ public final class SampleTree {
} }
} // End of class SampleTree.TreeEditableChangeListener } // End of class SampleTree.TreeEditableChangeListener
public static void main(String args[]) { public static void main(String[] args) {
try { try {
SwingUtilities.invokeAndWait(new Runnable() { SwingUtilities.invokeAndWait(new Runnable() {

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -64,11 +64,11 @@ class BezierAnimationPanel extends JPanel implements Runnable {
public final int NUMPTS = 6; 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, 50.0f, 0.0f,
150.0f, 0.0f, 150.0f, 0.0f,
200.0f, 75.0f, 200.0f, 75.0f,
@ -77,7 +77,7 @@ class BezierAnimationPanel extends JPanel implements Runnable {
0.0f, 75.0f, 0.0f, 75.0f,
}; };
float movepts[] = new float[staticpts.length]; float[] movepts = new float[staticpts.length];
BufferedImage img; BufferedImage img;

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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() { void loadImages() {
images[0] = createImageIcon("list/red.gif", getString("ListDemo.red")); images[0] = createImageIcon("list/red.gif", getString("ListDemo.red"));
images[1] = createImageIcon("list/blue.gif", getString("ListDemo.blue")); images[1] = createImageIcon("list/blue.gif", getString("ListDemo.blue"));

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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 { class HeadSpin extends JComponent implements ActionListener {
javax.swing.Timer animator; javax.swing.Timer animator;
ImageIcon icon[] = new ImageIcon[6]; ImageIcon[] icon = new ImageIcon[6];
int tmpScale; int tmpScale;
static final int numImages = 6; static final int numImages = 6;
double x[] = new double[numImages]; double[] x = new double[numImages];
double y[] = new double[numImages]; double[] y = new double[numImages];
int xh[] = new int[numImages]; int[] xh = new int[numImages];
int yh[] = new int[numImages]; int[] yh = new int[numImages];
double scale[] = new double[numImages]; double[] scale = new double[numImages];
public HeadSpin() { public HeadSpin() {
setBackground(Color.black); setBackground(Color.black);

@ -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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -248,7 +248,7 @@ public final class TableExample implements LayoutManager {
return scrollpane; return scrollpane;
} }
public static void main(String s[]) { public static void main(String[] s) {
// Trying to set Nimbus look and feel // Trying to set Nimbus look and feel
try { try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {

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

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -669,7 +669,7 @@ public class AWTEventMonitor {
* @see AWTEventMonitor * @see AWTEventMonitor
*/ */
protected void installListeners() { protected void installListeners() {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows(); Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) { if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) { for (int i = 0; i < topLevelWindows.length; i++) {
installListeners(topLevelWindows[i]); installListeners(topLevelWindows[i]);
@ -685,7 +685,7 @@ public class AWTEventMonitor {
* @see EventID * @see EventID
*/ */
protected void installListeners(int eventID) { protected void installListeners(int eventID) {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows(); Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) { if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) { for (int i = 0; i < topLevelWindows.length; i++) {
installListeners(topLevelWindows[i], eventID); installListeners(topLevelWindows[i], eventID);
@ -943,7 +943,7 @@ public class AWTEventMonitor {
* @see EventID * @see EventID
*/ */
protected void removeListeners(int eventID) { protected void removeListeners(int eventID) {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows(); Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) { if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) { for (int i = 0; i < topLevelWindows.length; i++) {
removeListeners(topLevelWindows[i], eventID); removeListeners(topLevelWindows[i], eventID);

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -128,7 +128,7 @@ public class AccessibilityEventMonitor {
* @see AWTEventMonitor * @see AWTEventMonitor
*/ */
protected void installListeners() { protected void installListeners() {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows(); Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) { if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) { for (int i = 0; i < topLevelWindows.length; i++) {
if (topLevelWindows[i] instanceof Accessible) { if (topLevelWindows[i] instanceof Accessible) {
@ -206,7 +206,7 @@ public class AccessibilityEventMonitor {
* @see EventID * @see EventID
*/ */
protected void removeListeners() { protected void removeListeners() {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows(); Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) { if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) { for (int i = 0; i < topLevelWindows.length; i++) {
if (topLevelWindows[i] instanceof Accessible) { if (topLevelWindows[i] instanceof Accessible) {

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * 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) { if (source instanceof Component) {
Container parent = ((Component) source).getParent(); Container parent = ((Component) source).getParent();
if (parent != null) { if (parent != null) {
Component ca[] = parent.getComponents(); Component[] ca = parent.getComponents();
for (int i = 0; i < ca.length; i++) { for (int i = 0; i < ca.length; i++) {
if (source.equals(ca[i])) { if (source.equals(ca[i])) {
return i; return i;

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * 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 * map an HWND to an AWT Component
*/ */
private void initHWNDcalls() { private void initHWNDcalls() {
Class<?> integerParemter[] = new Class<?>[1]; Class<?>[] integerParemter = new Class<?>[1];
integerParemter[0] = Integer.TYPE; integerParemter[0] = Integer.TYPE;
Class<?> componentParemter[] = new Class<?>[1]; Class<?>[] componentParemter = new Class<?>[1];
try { try {
componentParemter[0] = Class.forName("java.awt.Component"); componentParemter[0] = Class.forName("java.awt.Component");
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {