diff --git a/core/src/build/conf/checkstyle.xml b/core/src/build/conf/checkstyle.xml
index dabc816..fd39590 100644
--- a/core/src/build/conf/checkstyle.xml
+++ b/core/src/build/conf/checkstyle.xml
@@ -151,10 +151,13 @@
-
-
-
+
+
+
diff --git a/core/src/main/java/edu/umd/cs/piccolo/PCanvas.java b/core/src/main/java/edu/umd/cs/piccolo/PCanvas.java
index 629be5b..3d3cdb0 100644
--- a/core/src/main/java/edu/umd/cs/piccolo/PCanvas.java
+++ b/core/src/main/java/edu/umd/cs/piccolo/PCanvas.java
@@ -154,6 +154,9 @@
*/
private transient MouseMotionListener mouseMotionListener;
+ private static final int ALL_BUTTONS_MASK = InputEvent.BUTTON1_DOWN_MASK | InputEvent.BUTTON2_DOWN_MASK
+ | InputEvent.BUTTON3_DOWN_MASK;
+
/**
* Construct a canvas with the basic scene graph consisting of a root,
* camera, and layer. Zooming and panning are automatically installed.
@@ -843,10 +846,6 @@
sendInputEventToInputManager(event, MouseEvent.MOUSE_RELEASED);
}
- private boolean isAnyButtonDown(final MouseEvent e) {
- return (e.getModifiersEx() & (InputEvent.BUTTON1_DOWN_MASK | InputEvent.BUTTON2_DOWN_MASK | InputEvent.BUTTON3_DOWN_MASK)) != 0;
- }
-
private MouseEvent copyButtonsFromModifiers(final MouseEvent rawEvent, final int eventType) {
if (rawEvent.getButton() != MouseEvent.NOBUTTON) {
return rawEvent;
@@ -886,6 +885,10 @@
}
}
+ private boolean isAnyButtonDown(final MouseEvent e) {
+ return (e.getModifiersEx() & ALL_BUTTONS_MASK) != 0;
+ }
+
/**
* Class responsible for sending key events to the the InputManager.
*/
@@ -904,6 +907,9 @@
}
}
+ /**
+ * Class responsible for sending mouse events to the the InputManager.
+ */
private final class MouseWheelInputSourceListener implements MouseWheelListener {
/** {@inheritDoc} */
public void mouseWheelMoved(final MouseWheelEvent e) {
diff --git a/core/src/main/java/edu/umd/cs/piccolo/activities/PTransformActivity.java b/core/src/main/java/edu/umd/cs/piccolo/activities/PTransformActivity.java
index 15779a3..5758c17 100644
--- a/core/src/main/java/edu/umd/cs/piccolo/activities/PTransformActivity.java
+++ b/core/src/main/java/edu/umd/cs/piccolo/activities/PTransformActivity.java
@@ -43,8 +43,7 @@
* @author Jesse Grosjean
*/
public class PTransformActivity extends PInterpolatingActivity {
-
- private static PAffineTransform STATIC_TRANSFORM = new PAffineTransform();
+ private static final PAffineTransform STATIC_TRANSFORM = new PAffineTransform();
private final double[] source;
private double[] destination;
diff --git a/core/src/main/java/edu/umd/cs/piccolo/nodes/PPath.java b/core/src/main/java/edu/umd/cs/piccolo/nodes/PPath.java
index 1cc6628..6e1ecbd 100644
--- a/core/src/main/java/edu/umd/cs/piccolo/nodes/PPath.java
+++ b/core/src/main/java/edu/umd/cs/piccolo/nodes/PPath.java
@@ -521,7 +521,8 @@
* @param x3 x component of point through which curve must pass
* @param y3 y component of point through which curve must pass
*/
- public void curveTo(final float x1, final float y1, final float x2, final float y2, final float x3, final float y3) {
+ public void curveTo(final float x1, final float y1, final float x2, final float y2,
+ final float x3, final float y3) {
path.curveTo(x1, y1, x2, y2, x3, y3);
firePropertyChange(PROPERTY_CODE_PATH, PROPERTY_PATH, null, path);
updateBoundsFromPath();
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 baf7305..6bed75b 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
@@ -164,6 +164,7 @@
*/
public PText() {
super();
+ setText(DEFAULT_TEXT);
}
/**
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 74ed562..5b7f3a4 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
@@ -68,7 +68,7 @@
public static PPaintContext CURRENT_PAINT_CONTEXT;
/** Used while calculating scale at which rendering is occurring. */
- private static double[] PTS = new double[4];
+ private static final double[] PTS = new double[4];
/** PaintContext is associated with this graphics context. */
private final Graphics2D graphics;
diff --git a/core/src/main/java/edu/umd/cs/piccolo/util/PPickPath.java b/core/src/main/java/edu/umd/cs/piccolo/util/PPickPath.java
index 999d5ed..0007042 100644
--- a/core/src/main/java/edu/umd/cs/piccolo/util/PPickPath.java
+++ b/core/src/main/java/edu/umd/cs/piccolo/util/PPickPath.java
@@ -67,7 +67,7 @@
public static PPickPath CURRENT_PICK_PATH;
/** Used when calculating the scale. */
- private static double[] PTS = new double[4];
+ private static final double[] PTS = new double[4];
/** Stack of nodes representing all picked nodes. */
private PStack nodeStack;