diff --git a/core/src/main/java/edu/umd/cs/piccolo/event/PInputEventFilter.java b/core/src/main/java/edu/umd/cs/piccolo/event/PInputEventFilter.java index 0c5cddf..0f510f3 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/event/PInputEventFilter.java +++ b/core/src/main/java/edu/umd/cs/piccolo/event/PInputEventFilter.java @@ -53,7 +53,7 @@ */ public class PInputEventFilter { /** Mask representing all possible modifiers. */ - public static int ALL_MODIFIERS_MASK = InputEvent.BUTTON1_MASK | InputEvent.BUTTON2_MASK | InputEvent.BUTTON3_MASK + public static final int ALL_MODIFIERS_MASK = InputEvent.BUTTON1_MASK | InputEvent.BUTTON2_MASK | InputEvent.BUTTON3_MASK | InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK | InputEvent.ALT_MASK | InputEvent.ALT_GRAPH_MASK | InputEvent.META_MASK; diff --git a/core/src/main/java/edu/umd/cs/piccolo/nodes/PText.java b/core/src/main/java/edu/umd/cs/piccolo/nodes/PText.java index 861016f..ad43dbf 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/nodes/PText.java +++ b/core/src/main/java/edu/umd/cs/piccolo/nodes/PText.java @@ -110,13 +110,13 @@ */ // public static final Font DEFAULT_FONT = new Font(Font.SANS_SERIF, // Font.PLAIN, 12); jdk 1.6+ - public static Font DEFAULT_FONT = new Font("SansSerif", Font.PLAIN, 12); + public static final Font DEFAULT_FONT = new Font("SansSerif", Font.PLAIN, 12); /** * Default greek threshold, 5.5d. Will be made final in version * 2.0. */ - public static double DEFAULT_GREEK_THRESHOLD = 5.5d; + public static final double DEFAULT_GREEK_THRESHOLD = 5.5d; /** * Default horizontal alignment, Component.LEFT_ALIGNMENT. diff --git a/core/src/main/java/edu/umd/cs/piccolo/util/PPaintContext.java b/core/src/main/java/edu/umd/cs/piccolo/util/PPaintContext.java index aea1e28..19e45dc 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/util/PPaintContext.java +++ b/core/src/main/java/edu/umd/cs/piccolo/util/PPaintContext.java @@ -56,10 +56,10 @@ public static final int HIGH_QUALITY_RENDERING = 1; /** Font context to use while in low quality rendering. */ - public static FontRenderContext RENDER_QUALITY_LOW_FRC = new FontRenderContext(null, false, true); + public static final FontRenderContext RENDER_QUALITY_LOW_FRC = new FontRenderContext(null, false, true); /** Font context to use while in high quality rendering. */ - public static FontRenderContext RENDER_QUALITY_HIGH_FRC = new FontRenderContext(null, true, true); + public static final FontRenderContext RENDER_QUALITY_HIGH_FRC = new FontRenderContext(null, true, true); /** * @deprecated will disappear as soon as possible Global for accessing the diff --git a/core/src/main/java/edu/umd/cs/piccolo/util/PUtil.java b/core/src/main/java/edu/umd/cs/piccolo/util/PUtil.java index c10a182..004d9b0 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/util/PUtil.java +++ b/core/src/main/java/edu/umd/cs/piccolo/util/PUtil.java @@ -57,13 +57,13 @@ * PActivities are broken into steps, this is how many milliseconds should * pass between steps. */ - public static long DEFAULT_ACTIVITY_STEP_RATE = 20; + public static final long DEFAULT_ACTIVITY_STEP_RATE = 20; /** Rate in milliseconds at which the activity timer will get invoked. */ - public static int ACTIVITY_SCHEDULER_FRAME_DELAY = 10; + public static final int ACTIVITY_SCHEDULER_FRAME_DELAY = 10; /** An iterator that iterates over an empty collection. */ - public static Iterator NULL_ITERATOR = Collections.EMPTY_LIST.iterator(); + public static final Iterator NULL_ITERATOR = Collections.EMPTY_LIST.iterator(); /** * Used when persisting paths to an object stream. Used to mark the end of @@ -72,7 +72,7 @@ private static final int PATH_TERMINATOR = -1; /** A utility enumeration with no elements. */ - public static Enumeration NULL_ENUMERATION = new Enumeration() { + public static final Enumeration NULL_ENUMERATION = new Enumeration() { public boolean hasMoreElements() { return false; } @@ -86,7 +86,7 @@ * @deprecated This has been moved into a private static class of * PObjectOutputStream */ - public static OutputStream NULL_OUTPUT_STREAM = new OutputStream() { + public static final OutputStream NULL_OUTPUT_STREAM = new OutputStream() { public void close() { } diff --git a/core/src/test/java/edu/umd/cs/piccolo/event/PInputEventFilterTest.java b/core/src/test/java/edu/umd/cs/piccolo/event/PInputEventFilterTest.java index 18a74e1..9c6d096 100644 --- a/core/src/test/java/edu/umd/cs/piccolo/event/PInputEventFilterTest.java +++ b/core/src/test/java/edu/umd/cs/piccolo/event/PInputEventFilterTest.java @@ -46,17 +46,6 @@ filter = new PInputEventFilter(); } - // http://code.google.com/p/piccolo2d/issues/detail?id=116 - public void testPreventCodeCleanFinal() { - final int pre = PInputEventFilter.ALL_MODIFIERS_MASK; - try { - PInputEventFilter.ALL_MODIFIERS_MASK = 0; - } - finally { - PInputEventFilter.ALL_MODIFIERS_MASK = pre; - } - } - public void testAcceptsAlreadyHandledEventsFalseByDefault() { assertFalse(filter.getAcceptsAlreadyHandledEvents()); } diff --git a/core/src/test/java/edu/umd/cs/piccolo/util/PUtilTest.java b/core/src/test/java/edu/umd/cs/piccolo/util/PUtilTest.java index 45863b4..00cc2e2 100644 --- a/core/src/test/java/edu/umd/cs/piccolo/util/PUtilTest.java +++ b/core/src/test/java/edu/umd/cs/piccolo/util/PUtilTest.java @@ -27,10 +27,6 @@ */ package edu.umd.cs.piccolo.util; -import java.io.OutputStream; -import java.util.Enumeration; -import java.util.Iterator; - import junit.framework.TestCase; /** @@ -38,31 +34,4 @@ */ public class PUtilTest extends TestCase { - // see http://code.google.com/p/piccolo2d/issues/detail?id=116 - public void testPreventCodeCleanFinal() { - final Enumeration ne = PUtil.NULL_ENUMERATION; - try { - PUtil.NULL_ENUMERATION = null; - } - finally { - PUtil.NULL_ENUMERATION = ne; - } - - final Iterator ni = PUtil.NULL_ITERATOR; - try { - PUtil.NULL_ITERATOR = null; - } - finally { - PUtil.NULL_ITERATOR = ni; - } - - final OutputStream no = PUtil.NULL_OUTPUT_STREAM; - try { - PUtil.NULL_OUTPUT_STREAM = null; - } - finally { - PUtil.NULL_OUTPUT_STREAM = no; - } - } - } diff --git a/extras/src/main/java/edu/umd/cs/piccolox/handles/PHandle.java b/extras/src/main/java/edu/umd/cs/piccolox/handles/PHandle.java index 1f8cf2b..ecab2ec 100644 --- a/extras/src/main/java/edu/umd/cs/piccolox/handles/PHandle.java +++ b/extras/src/main/java/edu/umd/cs/piccolox/handles/PHandle.java @@ -82,12 +82,12 @@ private static final long serialVersionUID = 1L; /** The default size for a handle. */ - public static float DEFAULT_HANDLE_SIZE = 8; + public static final float DEFAULT_HANDLE_SIZE = 8; /** Default shape to use when drawing handles. */ - public static Shape DEFAULT_HANDLE_SHAPE = new Ellipse2D.Float(0f, 0f, DEFAULT_HANDLE_SIZE, DEFAULT_HANDLE_SIZE); + public static final Shape DEFAULT_HANDLE_SHAPE = new Ellipse2D.Float(0f, 0f, DEFAULT_HANDLE_SIZE, DEFAULT_HANDLE_SIZE); /** Default color to paint handles. */ - public static Color DEFAULT_COLOR = Color.white; + public static final Color DEFAULT_COLOR = Color.white; private PLocator locator; private transient PDragSequenceEventHandler handleDragger; diff --git a/extras/src/main/java/edu/umd/cs/piccolox/nodes/PLens.java b/extras/src/main/java/edu/umd/cs/piccolox/nodes/PLens.java index 52bcd3f..795c18c 100644 --- a/extras/src/main/java/edu/umd/cs/piccolox/nodes/PLens.java +++ b/extras/src/main/java/edu/umd/cs/piccolox/nodes/PLens.java @@ -69,13 +69,13 @@ private final transient PDragEventHandler lensDragger; /** The height of the drag bar. */ - public static double LENS_DRAGBAR_HEIGHT = 20; + public static final double LENS_DRAGBAR_HEIGHT = 20; /** Default paint to use for the drag bar. */ - public static Paint DEFAULT_DRAGBAR_PAINT = Color.DARK_GRAY; + public static final Paint DEFAULT_DRAGBAR_PAINT = Color.DARK_GRAY; /** Default paint to use when drawing the background of the lens. */ - public static Paint DEFAULT_LENS_PAINT = Color.LIGHT_GRAY; + public static final Paint DEFAULT_LENS_PAINT = Color.LIGHT_GRAY; /** * Constructs the default PLens. diff --git a/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java b/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java index 09e4d59..d495995 100644 --- a/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java +++ b/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java @@ -65,10 +65,10 @@ private static final long serialVersionUID = 1L; /** Font rendering context used for all PStyledText instances. */ - protected static FontRenderContext SWING_FRC = new FontRenderContext(null, true, false); + protected static final FontRenderContext SWING_FRC = new FontRenderContext(null, true, false); /** Used while painting underlines. */ - protected static Line2D paintLine = new Line2D.Double(); + protected static final Line2D paintLine = new Line2D.Double(); /** * Underlying document used to handle the complexities involved with diff --git a/parent/.settings/org.eclipse.jdt.core.prefs b/parent/.settings/org.eclipse.jdt.core.prefs index 94535b3..f879a5f 100644 --- a/parent/.settings/org.eclipse.jdt.core.prefs +++ b/parent/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,5 @@ -#Wed Oct 28 10:17:01 EDT 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.source=1.4 +#Fri Jul 31 20:29:04 EDT 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.source=1.4 diff --git a/parent/.settings/org.maven.ide.eclipse.prefs b/parent/.settings/org.maven.ide.eclipse.prefs index 293ab5d..e0f41b4 100644 --- a/parent/.settings/org.maven.ide.eclipse.prefs +++ b/parent/.settings/org.maven.ide.eclipse.prefs @@ -1,9 +1,9 @@ -#Wed Oct 28 10:16:59 EDT 2009 -activeProfiles= -eclipse.preferences.version=1 -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -skipCompilerPlugin=true -version=1 +#Fri Jul 31 20:28:54 EDT 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTHandle.java b/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTHandle.java index b6d8d25..6cd1a4e 100644 --- a/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTHandle.java +++ b/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTHandle.java @@ -61,11 +61,11 @@ public class PSWTHandle extends PSWTPath { private static final long serialVersionUID = 1L; /** The Default Size of a handle not including its border. */ - public static float DEFAULT_HANDLE_SIZE = 8; + public static final float DEFAULT_HANDLE_SIZE = 8; /** The default shape to use when drawing handles. Default is an ellipse. */ - public static Shape DEFAULT_HANDLE_SHAPE = new Ellipse2D.Float(0f, 0f, DEFAULT_HANDLE_SIZE, DEFAULT_HANDLE_SIZE); + public static final Shape DEFAULT_HANDLE_SHAPE = new Ellipse2D.Float(0f, 0f, DEFAULT_HANDLE_SIZE, DEFAULT_HANDLE_SIZE); /** The default color to use when drawing a handle. (white) */ - public static Color DEFAULT_COLOR = Color.white; + public static final Color DEFAULT_COLOR = Color.white; private PLocator locator; private PDragSequenceEventHandler handleDragger; diff --git a/swt/src/main/java/edu/umd/cs/piccolox/swt/SWTGraphics2D.java b/swt/src/main/java/edu/umd/cs/piccolox/swt/SWTGraphics2D.java index ca0f94b..26d0b00 100644 --- a/swt/src/main/java/edu/umd/cs/piccolox/swt/SWTGraphics2D.java +++ b/swt/src/main/java/edu/umd/cs/piccolox/swt/SWTGraphics2D.java @@ -93,18 +93,18 @@ */ protected static int CACHE_COUNT = 0; /** Map from font names to Fonts. */ - protected static HashMap FONT_CACHE = new HashMap(); + protected static final HashMap FONT_CACHE = new HashMap(); /** Map from awt colors to swt colors. */ - protected static HashMap COLOR_CACHE = new HashMap(); + protected static final HashMap COLOR_CACHE = new HashMap(); /** Map from awt shapess to swt Paths. */ - protected static HashMap SHAPE_CACHE = new HashMap(); + protected static final HashMap SHAPE_CACHE = new HashMap(); /** Buffer used to extract the graphics device. */ - protected static BufferedImage BUFFER = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); + protected static final BufferedImage BUFFER = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); - private static Point TEMP_POINT = new Point(); - private static Rectangle2D TEMP_RECT = new Rectangle2D.Double(); - private static Rectangle2D TEMP_LINE_RECT = new Rectangle2D.Double(); - private static org.eclipse.swt.graphics.Rectangle SWT_RECT = new org.eclipse.swt.graphics.Rectangle(0, 0, 0, 0); + private static final Point TEMP_POINT = new Point(); + private static final Rectangle2D TEMP_RECT = new Rectangle2D.Double(); + private static final Rectangle2D TEMP_LINE_RECT = new Rectangle2D.Double(); + private static final org.eclipse.swt.graphics.Rectangle SWT_RECT = new org.eclipse.swt.graphics.Rectangle(0, 0, 0, 0); /** The Underlying GraphicsContext provided by swt. */ protected GC gc;