Author: [email protected]
Date: Wed Jan 14 12:32:56 2009
New Revision: 2921

Modified:
   trunk/src/ca/sqlpower/architect/swingui/ContainerPane.java
   trunk/src/ca/sqlpower/architect/swingui/ProfileRowComponent.java

Log:
Added the support so that mac users can use COMMAND key to multi-select columns or tables on the playpen and profiles in the profile manager.The problem of using CTRL key to do multi-select is it's equivalent to right click on mac, so a right-click menu will appear,which is annoying.

Modified: trunk/src/ca/sqlpower/architect/swingui/ContainerPane.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/ContainerPane.java  (original)
+++ trunk/src/ca/sqlpower/architect/swingui/ContainerPane.java Wed Jan 14 12:32:56 2009
@@ -124,7 +124,9 @@
             int clickItem = pointToItemIndex(p);

             if (pp.getMouseMode() != MouseModeType.CREATING_TABLE) {
- if ((evt.getModifiersEx() & (InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK)) == 0) {
+                if ((evt.getModifiersEx() & (InputEvent.SHIFT_DOWN_MASK |
+                                             InputEvent.CTRL_DOWN_MASK |
+ InputEvent.META_DOWN_MASK)) == 0) { if (!isSelected() || pp.getMouseMode() == MouseModeType.IDLE) {
                         pp.setMouseMode(MouseModeType.SELECT_TABLE);
                         pp.selectNone();
@@ -143,7 +145,8 @@

                     if ((evt.getModifiersEx() &
                             (InputEvent.SHIFT_DOWN_MASK |
-                                    InputEvent.CTRL_DOWN_MASK)) == 0) {
+                             InputEvent.CTRL_DOWN_MASK |
+                             InputEvent.META_DOWN_MASK)) == 0) {

                         if (!isItemSelected(clickItem) ){
                             deSelectEverythingElse(evt);

Modified: trunk/src/ca/sqlpower/architect/swingui/ProfileRowComponent.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/ProfileRowComponent.java (original) +++ trunk/src/ca/sqlpower/architect/swingui/ProfileRowComponent.java Wed Jan 14 12:32:56 2009
@@ -304,7 +304,7 @@
             if (evt.getButton() == MouseEvent.BUTTON1) {
                 if (evt.getClickCount() == 2) {
                     showProfile(obj);
- } else if ((evt.getModifiers() & InputEvent.CTRL_MASK) != 0){ + } else if ((evt.getModifiers() & (InputEvent.CTRL_MASK | InputEvent.META_MASK)) != 0) { setSelected(!selected, SelectionEvent.CTRL_MULTISELECT); } else if ((evt.getModifiers() & InputEvent.SHIFT_MASK) != 0){
                     setSelected(true, SelectionEvent.SHIFT_MULTISELECT);

Reply via email to