/[classpath]/classpath/javax/swing/plaf/basic/BasicTableUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicTableUI.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by mark, Sat Jul 2 20:32:50 2005 UTC revision 1.9 by abalkiss, Thu Jul 7 20:55:50 2005 UTC
# Line 113  public class BasicTableUI Line 113  public class BasicTableUI
113            ListSelectionModel rowModel = table.getSelectionModel();            ListSelectionModel rowModel = table.getSelectionModel();
114            if (lo_row != -1 && hi_row != -1)            if (lo_row != -1 && hi_row != -1)
115              {              {
116                if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION)                if (controlPressed && rowModel.getSelectionMode()
117                      != ListSelectionModel.SINGLE_SELECTION)
118                  rowModel.addSelectionInterval(lo_row, hi_row);                  rowModel.addSelectionInterval(lo_row, hi_row);
119                else                else
120                  rowModel.setSelectionInterval(lo_row, hi_row);                  rowModel.setSelectionInterval(lo_row, hi_row);
# Line 124  public class BasicTableUI Line 125  public class BasicTableUI
125          {          {
126            int lo_col = table.columnAtPoint(begin);            int lo_col = table.columnAtPoint(begin);
127            int hi_col = table.columnAtPoint(curr);            int hi_col = table.columnAtPoint(curr);
128            ListSelectionModel colModel = table.getColumnModel().getSelectionModel();            ListSelectionModel colModel = table.getColumnModel().
129                getSelectionModel();
130            if (lo_col != -1 && hi_col != -1)            if (lo_col != -1 && hi_col != -1)
131              {              {
132                if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION)                if (controlPressed && colModel.getSelectionMode() !=
133                      ListSelectionModel.SINGLE_SELECTION)
134                  colModel.addSelectionInterval(lo_col, hi_col);                  colModel.addSelectionInterval(lo_col, hi_col);
135                else                else
136                  colModel.setSelectionInterval(lo_col, hi_col);                  colModel.setSelectionInterval(lo_col, hi_col);
# Line 156  public class BasicTableUI Line 159  public class BasicTableUI
159      {      {
160        begin = new Point(e.getX(), e.getY());        begin = new Point(e.getX(), e.getY());
161        curr = new Point(e.getX(), e.getY());        curr = new Point(e.getX(), e.getY());
162        updateSelection(e.isControlDown());        //if control is pressed and the cell is already selected, deselect it
163          if (e.isControlDown() && table.
164              isCellSelected(table.rowAtPoint(begin),table.columnAtPoint(begin)))
165            {                                      
166              table.getSelectionModel().
167                removeSelectionInterval(table.rowAtPoint(begin),
168                                        table.rowAtPoint(begin));
169              table.getColumnModel().getSelectionModel().
170                removeSelectionInterval(table.columnAtPoint(begin),
171                                        table.columnAtPoint(begin));
172            }
173          else
174            updateSelection(e.isControlDown());
175                
176      }      }
177      public void mouseReleased(MouseEvent e)      public void mouseReleased(MouseEvent e)

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26