Merge pull request #1986 from draxdyn/clicks

Recognize double clicks made in rapid succession
This commit is contained in:
LevelX2 2016-06-17 13:42:38 +02:00 committed by GitHub
commit 5d1b96e4c9
5 changed files with 6 additions and 6 deletions

View file

@ -236,7 +236,7 @@ public class CardArea extends JPanel implements MouseListener {
public void mousePressed(MouseEvent e) {
if (e.getClickCount() >= 1 && !e.isConsumed()) {
Object obj = e.getSource();
if (e.getClickCount() == 2) {
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0)) { // double clicks and repeated double clicks
e.consume();
if (obj instanceof Card) {
if (e.isAltDown()) {

View file

@ -308,7 +308,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
// End of variables declaration//GEN-END:variables
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2 && !e.isConsumed()) {
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0) && !e.isConsumed()) { // double clicks and repeated double clicks
e.consume();
Object obj = e.getSource();
if (obj instanceof Card) {

View file

@ -200,7 +200,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
mainTable.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if (e.getClickCount() == 2 && !e.isConsumed()) {
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0) && !e.isConsumed()) { // double clicks and repeated double clicks
e.consume();
if (e.isAltDown()) {
handleAltDoubleClick();
@ -755,7 +755,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
public void mousePressed(MouseEvent e) {
if (e.getClickCount() >= 1 && !e.isConsumed()) {
Object obj = e.getSource();
if (e.getClickCount() == 2) {
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0)) { // double clicks and repeated double clicks
e.consume();
if (obj instanceof Card) {
if (e.isAltDown()) {

View file

@ -183,7 +183,7 @@ public class DraftGrid extends javax.swing.JPanel implements MouseListener {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0)) { // double clicks and repeated double clicks
if (e.getButton() == MouseEvent.BUTTON1) {
Object obj = e.getSource();
if (obj instanceof MageCard) {

View file

@ -157,7 +157,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
mainTable.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if (e.getClickCount() == 2 && !e.isConsumed()) {
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0) && !e.isConsumed()) { // double clicks and repeated double clicks
e.consume();
if (e.isAltDown()) {
jButtonAddToSideboardActionPerformed(null);