|
|
@ -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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|