|
@ -29,14 +29,7 @@ public class MyMouseListener implements MouseInputListener { |
|
|
// TODO Auto-generated method stub |
|
|
// TODO Auto-generated method stub |
|
|
System.out.println("DOWN"); |
|
|
System.out.println("DOWN"); |
|
|
Component com = SwingUtilities.getDeepestComponentAt(e.getComponent(), e.getX(), e.getY()); |
|
|
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) |
|
|
if ((com instanceof Card && com.getParent() instanceof StartStack) |
|
|
|| (com instanceof StartStack && ((StartStack) com).stackIsEmpty())) { |
|
|
|| (com instanceof StartStack && ((StartStack) com).stackIsEmpty())) { |
|
|
|
|
|
|
|
@ -152,6 +145,12 @@ public class MyMouseListener implements MouseInputListener { |
|
|
} else { |
|
|
} else { |
|
|
clearSaveStack(selectedStack); |
|
|
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); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|