mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
* Changes to clear of card panel on panel remove.
This commit is contained in:
parent
e9dc1a1c68
commit
6fe430ecba
2 changed files with 3 additions and 2 deletions
|
|
@ -229,7 +229,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
||||||
// remove possible mouse listeners, preventing gc
|
// remove possible mouse listeners, preventing gc
|
||||||
for (MageCard mageCard: cards.values()) {
|
for (MageCard mageCard: cards.values()) {
|
||||||
if (mageCard instanceof CardPanel) {
|
if (mageCard instanceof CardPanel) {
|
||||||
((CardPanel)mageCard).clear();
|
((CardPanel)mageCard).cleanUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.cards.clear();
|
this.cards.clear();
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void cleanUp() {
|
||||||
if (dayNightButton != null) {
|
if (dayNightButton != null) {
|
||||||
for(ActionListener al: dayNightButton.getActionListeners()) {
|
for(ActionListener al: dayNightButton.getActionListeners()) {
|
||||||
dayNightButton.removeActionListener(al);
|
dayNightButton.removeActionListener(al);
|
||||||
|
|
@ -267,6 +267,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
||||||
for(MouseWheelListener ml: this.getMouseWheelListeners() ){
|
for(MouseWheelListener ml: this.getMouseWheelListeners() ){
|
||||||
this.removeMouseWheelListener(ml);
|
this.removeMouseWheelListener(ml);
|
||||||
}
|
}
|
||||||
|
this.callback = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setText(CardView card) {
|
private void setText(CardView card) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue