* Linux - Fixed that the battlefield popup menu also works when running on a linux system.

This commit is contained in:
LevelX2 2014-03-02 21:52:02 +01:00
parent 3cf7fd33ed
commit 595fd1a700

View file

@ -203,9 +203,20 @@ public class PlayAreaPanel extends javax.swing.JPanel {
} }
}); });
battlefieldPanel.getMainPanel().addMouseListener(new MouseAdapter() { battlefieldPanel.getMainPanel().addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseReleased(MouseEvent Me) { public void mouseReleased(MouseEvent Me) {
this.checkMenu(Me);
}
// neccessary for linux and mac systems
@Override
public void mousePressed(MouseEvent Me) {
this.checkMenu(Me);
}
private void checkMenu(MouseEvent Me){
if (Me.isPopupTrigger() && playingMode) { if (Me.isPopupTrigger() && playingMode) {
popupMenu.show(Me.getComponent(), Me.getX(), Me.getY()); popupMenu.show(Me.getComponent(), Me.getX(), Me.getY());
} }
@ -233,6 +244,15 @@ public class PlayAreaPanel extends javax.swing.JPanel {
battlefieldPanel.getMainPanel().addMouseListener(new MouseAdapter() { battlefieldPanel.getMainPanel().addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseReleased(MouseEvent Me) { public void mouseReleased(MouseEvent Me) {
this.checkMenu(Me);
}
// neccessary for linux and mac systems
@Override
public void mousePressed(MouseEvent Me) {
this.checkMenu(Me);
}
private void checkMenu(MouseEvent Me){
if (Me.isPopupTrigger() && playingMode) { if (Me.isPopupTrigger() && playingMode) {
popupMenu.show(Me.getComponent(), Me.getX(), Me.getY()); popupMenu.show(Me.getComponent(), Me.getX(), Me.getY());
} }