Author: allain.lalonde
Date: Wed Jul 15 11:49:27 2009
New Revision: 472
Modified:
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PDragSequenceEventHandler.java
Log:
Folding nested if statements into themselves. Makes PMD stop complaining so
loudly.
Modified:
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
==============================================================================
--- piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
(original)
+++ piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
Wed Jul 15 11:49:27 2009
@@ -2678,10 +2678,8 @@
boolean thisPickable = getPickable() &&
pickPath.acceptsNode(this);
- if (thisPickable) {
- if (pick(pickPath)) {
- return true;
- }
+ if (thisPickable && pick(pickPath)) {
+ return true;
}
if (getChildrenPickable()) {
@@ -2693,10 +2691,8 @@
}
}
- if (thisPickable) {
- if (pickAfterChildren(pickPath)) {
- return true;
- }
+ if (thisPickable && pickAfterChildren(pickPath)) {
+ return true;
}
pickPath.popTransform(transform);
Modified:
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PDragSequenceEventHandler.java
==============================================================================
---
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PDragSequenceEventHandler.java
(original)
+++
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PDragSequenceEventHandler.java
Wed Jul 15 11:49:27 2009
@@ -208,10 +208,8 @@
}
getMousePressedCanvasPoint().setLocation(e.getCanvasPosition());
- if (!isDragging()) {
- if (shouldStartDragInteraction(e)) {
- startDrag(e);
- }
+ if (!isDragging() && shouldStartDragInteraction(e)) {
+ startDrag(e);
}
}
--~--~---------~--~----~------------~-------~--~----~
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
-~----------~----~----~----~------~----~------~--~---