public void mousePressed(MouseEvent e) {
   if (e.isConsumed()) {
     selectedOnPress = false;
     return;
   }
   selectedOnPress = true;
   adjustFocusAndSelection(e);
 }
 private boolean shouldIgnore(MouseEvent e) {
   return e.isConsumed() || (!(SwingUtilities.isLeftMouseButton(e) && grid.isEnabled()));
 }