Browse Source

Fix MouseListener

feature_solitaer_setup_GamePanel
Alexander Hartung 3 years ago
parent
commit
6c2aaeb146
  1. 15
      src/main/java/solitaer/MyMouseListener.java

15
src/main/java/solitaer/MyMouseListener.java

@ -29,14 +29,7 @@ public class MyMouseListener implements MouseInputListener {
// TODO Auto-generated method stub
System.out.println("DOWN");
Component com = SwingUtilities.getDeepestComponentAt(e.getComponent(), e.getX(), e.getY());
// // Leeres StartFeld
// if (com instanceof StartStack) {
// System.out.println("Leer Start");
//
// }
// // Karte, die in einem StartStack liegt
// else
if ((com instanceof Card && com.getParent() instanceof StartStack)
|| (com instanceof StartStack && ((StartStack) com).stackIsEmpty())) {
@ -152,6 +145,12 @@ public class MyMouseListener implements MouseInputListener {
} else {
clearSaveStack(selectedStack);
}
//Clear SaveStack click on SolitaerGamePanel
}else if(com instanceof SolitaerGamePanel ||
com.getParent() instanceof SolitaerGamePanel && com instanceof StartStack ){
if(saveStack.stackIsEmpty() == false) {
clearSaveStack(selectedStack);
}
}
}

Loading…
Cancel
Save