Revision: 3924
Author: [email protected]
Date: Wed Aug 25 12:55:34 2010
Log: Fixed a bug with PlayPenLabel selection, where if other components are selected, clicking the label will deselect everything else. If control is pressed down and the label is clicked, selection is maintained on the previously selected components.
http://code.google.com/p/power-architect/source/detail?r=3924

Modified:
 /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenLabel.java

=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenLabel.java Wed Aug 25 09:29:42 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenLabel.java Wed Aug 25 12:55:34 2010
@@ -167,6 +167,12 @@
         pp.unzoomPoint(p);
         p.translate(-getX(), -getY());
         if (evt.getID() == MouseEvent.MOUSE_CLICKED) {
+ if (evt.getClickCount() == 1 && evt.getButton() == MouseEvent.BUTTON1) {
+               if (!evt.isControlDown()) {
+                   pp.selectNone();
+               }
+            }
+
             if ((evt.getModifiers() & MouseEvent.BUTTON1_MASK) != 0) {
                 if (evt.getClickCount() == 2) { // double click
                     if (isSelected()) {
@@ -182,6 +188,10 @@
             if (isSelected()){
                 componentPreviouslySelected = true;
             } else {
+                if (!evt.isControlDown()) {
+                    pp.selectNone();
+                }
+
                 componentPreviouslySelected = false;
                 setSelected(true, SelectionEvent.SINGLE_SELECT);
             }

Reply via email to