Merge pull request #2839 from federicobond/static-inner-classes

Add static modifier to inner classes that don't access parent
This commit is contained in:
Ben Fry
2014-09-08 14:17:13 -04:00
9 changed files with 17 additions and 17 deletions
+2 -2
View File
@@ -639,7 +639,7 @@ public class ColorChooser { //extends JFrame implements DocumentListener {
/**
* Extension of JTextField that only allows numbers
*/
class NumberField extends JTextField {
static class NumberField extends JTextField {
public boolean allowHex;
@@ -672,7 +672,7 @@ public class ColorChooser { //extends JFrame implements DocumentListener {
/**
* Document model to go with JTextField that only allows numbers.
*/
class NumberDocument extends PlainDocument {
static class NumberDocument extends PlainDocument {
NumberField parentField;
+1 -1
View File
@@ -626,7 +626,7 @@ public class EditorHeader extends JComponent {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
class Tab implements Comparable {
static class Tab implements Comparable {
int index;
int left;
int right;
+1 -1
View File
@@ -221,7 +221,7 @@ public class Language {
* Custom 'Control' class for consistent encoding.
* http://stackoverflow.com/questions/4659929/how-to-use-utf-8-in-resource-properties-with-resourcebundle
*/
class UTF8Control extends ResourceBundle.Control {
static class UTF8Control extends ResourceBundle.Control {
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException,IOException {
// The below is a copy of the default implementation.
String bundleName = toBundleName(baseName, locale);
+1 -1
View File
@@ -832,7 +832,7 @@ public class PreferencesFrame {
* most basic usage scenarios. Is there someone on the team I can contact?
* Oracle, are you listening?
*/
class FontNamer extends JLabel implements ListCellRenderer<Font> {
static class FontNamer extends JLabel implements ListCellRenderer<Font> {
public Component getListCellRendererComponent(JList<? extends Font> list,
Font value, int index,
boolean isSelected,
+2 -2
View File
@@ -310,7 +310,7 @@ public class Recent {
// }
class Record {
static class Record {
String path; // if not loaded, this is non-null
// EditorState state; // if not loaded, this is non-null
@@ -376,4 +376,4 @@ public class Recent {
// return getPath().equals(r.getPath());
// }
}
}
}
@@ -1450,7 +1450,7 @@ public class PGraphicsJava2D extends PGraphics {
}
class ImageCache {
static class ImageCache {
boolean tinted;
int tintedColor;
int[] tintedTemp; // one row of tinted pixels
+7 -7
View File
@@ -1431,7 +1431,7 @@ public class PShapeSVG extends PShape {
}
class LinearGradient extends Gradient {
static class LinearGradient extends Gradient {
float x1, y1, x2, y2;
public LinearGradient(PShapeSVG parent, XML properties) {
@@ -1461,7 +1461,7 @@ public class PShapeSVG extends PShape {
}
class RadialGradient extends Gradient {
static class RadialGradient extends Gradient {
float cx, cy, r;
public RadialGradient(PShapeSVG parent, XML properties) {
@@ -1490,7 +1490,7 @@ public class PShapeSVG extends PShape {
class LinearGradientPaint implements Paint {
static class LinearGradientPaint implements Paint {
float x1, y1, x2, y2;
float[] offset;
int[] color;
@@ -1615,7 +1615,7 @@ public class PShapeSVG extends PShape {
}
class RadialGradientPaint implements Paint {
static class RadialGradientPaint implements Paint {
float cx, cy, radius;
float[] offset;
int[] color;
@@ -1773,7 +1773,7 @@ public class PShapeSVG extends PShape {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
public class Font extends PShapeSVG {
public static class Font extends PShapeSVG {
public FontFace face;
public HashMap<String,FontGlyph> namedGlyphs;
@@ -1887,7 +1887,7 @@ public class PShapeSVG extends PShape {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
class FontFace extends PShapeSVG {
static class FontFace extends PShapeSVG {
int horizOriginX; // dflt 0
int horizOriginY; // dflt 0
// int horizAdvX; // no dflt?
@@ -1924,7 +1924,7 @@ public class PShapeSVG extends PShape {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
public class FontGlyph extends PShapeSVG { // extends Path
public static class FontGlyph extends PShapeSVG { // extends Path
public String name;
char unicode;
int horizAdvX;
+1 -1
View File
@@ -390,4 +390,4 @@ class FontTexture implements PConstants {
crop[2] + 2, -crop[3] + 2);
}
}
}
}
@@ -2527,7 +2527,7 @@ public class PGraphicsOpenGL extends PGraphics {
}
class Triangle {
static class Triangle {
int i0, i1, i2;
PImage tex;
float dist;