コード例 #1
0
 private int selectionSpan(SelectionModel sm, int orientation) {
   if (orientation == SwingConstants.VERTICAL) {
     return sm.getLastSelectedRow() - sm.getFirstSelectedRow() + 1;
   } else {
     return sm.getLastSelectedColumn() - sm.getFirstSelectedColumn() + 1;
   }
 }
コード例 #2
0
 private int compare(int i, SelectionModel sm, int orientation) {
   int min = 0;
   int max = 0;
   if (orientation == SwingConstants.VERTICAL) {
     min = sm.getFirstSelectedRow();
     max = sm.getLastSelectedRow();
   } else {
     min = sm.getFirstSelectedColumn();
     max = sm.getLastSelectedColumn();
   }
   return compare(i, min, max + 1);
 }