mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Merge pull request #1986 from draxdyn/clicks
Recognize double clicks made in rapid succession
This commit is contained in:
commit
5d1b96e4c9
5 changed files with 6 additions and 6 deletions
|
|
@ -236,7 +236,7 @@ public class CardArea extends JPanel implements MouseListener {
|
||||||
public void mousePressed(MouseEvent e) {
|
public void mousePressed(MouseEvent e) {
|
||||||
if (e.getClickCount() >= 1 && !e.isConsumed()) {
|
if (e.getClickCount() >= 1 && !e.isConsumed()) {
|
||||||
Object obj = e.getSource();
|
Object obj = e.getSource();
|
||||||
if (e.getClickCount() == 2) {
|
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0)) { // double clicks and repeated double clicks
|
||||||
e.consume();
|
e.consume();
|
||||||
if (obj instanceof Card) {
|
if (obj instanceof Card) {
|
||||||
if (e.isAltDown()) {
|
if (e.isAltDown()) {
|
||||||
|
|
|
||||||
|
|
@ -308,7 +308,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
@Override
|
@Override
|
||||||
public void mouseClicked(MouseEvent e) {
|
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();
|
e.consume();
|
||||||
Object obj = e.getSource();
|
Object obj = e.getSource();
|
||||||
if (obj instanceof Card) {
|
if (obj instanceof Card) {
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
||||||
mainTable.addMouseListener(new MouseAdapter() {
|
mainTable.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mousePressed(MouseEvent e) {
|
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();
|
e.consume();
|
||||||
if (e.isAltDown()) {
|
if (e.isAltDown()) {
|
||||||
handleAltDoubleClick();
|
handleAltDoubleClick();
|
||||||
|
|
@ -755,7 +755,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
||||||
public void mousePressed(MouseEvent e) {
|
public void mousePressed(MouseEvent e) {
|
||||||
if (e.getClickCount() >= 1 && !e.isConsumed()) {
|
if (e.getClickCount() >= 1 && !e.isConsumed()) {
|
||||||
Object obj = e.getSource();
|
Object obj = e.getSource();
|
||||||
if (e.getClickCount() == 2) {
|
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0)) { // double clicks and repeated double clicks
|
||||||
e.consume();
|
e.consume();
|
||||||
if (obj instanceof Card) {
|
if (obj instanceof Card) {
|
||||||
if (e.isAltDown()) {
|
if (e.isAltDown()) {
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ public class DraftGrid extends javax.swing.JPanel implements MouseListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mouseClicked(MouseEvent e) {
|
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) {
|
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||||
Object obj = e.getSource();
|
Object obj = e.getSource();
|
||||||
if (obj instanceof MageCard) {
|
if (obj instanceof MageCard) {
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
mainTable.addMouseListener(new MouseAdapter() {
|
mainTable.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mousePressed(MouseEvent e) {
|
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();
|
e.consume();
|
||||||
if (e.isAltDown()) {
|
if (e.isAltDown()) {
|
||||||
jButtonAddToSideboardActionPerformed(null);
|
jButtonAddToSideboardActionPerformed(null);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue