Closed GoogleCodeExporter closed 9 years ago
Added unit test to svn trunk.
$ svn commit -m "Issue 177 ; adding unit test for selection notification on
delete
key event" src/test/java/
Adding
src/test/java/edu/umd/cs/piccolox/event/PSelectionEventHandlerTest.java
Transmitting file data .
Committed revision 1016.
The patch proposed above looks reasonable to me. Should this go on trunk for
version
2.0 or on the 1.3 release branch for version 1.3.1 or both?
Original comment by heue...@gmail.com
on 27 Apr 2010 at 9:00
Two changes need to be made in order for this to be a fix.
#1 addition of postSelectionChanged
#2 Pressing delete on an empty selection shouldn't fire event
Following patch ensures thsoe things:
Index: src/main/java/edu/umd/cs/piccolox/event/PSelectionEventHandler.java
===================================================================
---
src/main/java/edu/umd/cs/piccolox/event/PSelectionEventHandler.java (revision
1016)
+++
src/main/java/edu/umd/cs/piccolox/event/PSelectionEventHandler.java (working
copy)
@@ -783,13 +783,14 @@
* @param e the key press event
*/
public void keyPressed(final PInputEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_DELETE && deleteKeyActive) {
+ if (e.getKeyCode() == KeyEvent.VK_DELETE && deleteKeyActive &&
!selection.isEmpty()) {
final Iterator selectionEn = selection.keySet().iterator();
while (selectionEn.hasNext()) {
final PNode node = (PNode) selectionEn.next();
node.removeFromParent();
}
selection.clear();
+ postSelectionChanged();
}
}
Original comment by allain.lalonde
on 28 Apr 2010 at 2:59
Good point. I'll add a few more test cases to the unit test and apply that
patch to
svn trunk.
Original comment by heue...@gmail.com
on 28 Apr 2010 at 3:28
It probably should be applied for eventual release in 1.3.1
Original comment by allain.lalonde
on 28 Apr 2010 at 1:57
$ svn commit -m "Issue 177 ; adding additional unit tests and applying patch" .
...
Committed revision 1017.
Original comment by heue...@gmail.com
on 28 Apr 2010 at 4:48
Original comment by heue...@gmail.com
on 26 Nov 2013 at 8:47
Original issue reported on code.google.com by
tbit455...@aol.com
on 20 Apr 2010 at 3:30