forked from External/mage
still more Deck Editor changes
This commit is contained in:
parent
436c48b17e
commit
f74df18cc9
11 changed files with 132 additions and 69 deletions
|
|
@ -84,7 +84,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener
|
|||
for (Iterator<Entry<UUID, MageCard>> i = cards.entrySet().iterator(); i.hasNext();) {
|
||||
Entry<UUID, MageCard> entry = i.next();
|
||||
if (!showCards.containsKey(entry.getKey())) {
|
||||
removeCard(entry.getKey());
|
||||
removeCardImg(entry.getKey());
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
|
|
@ -123,14 +123,16 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener
|
|||
}
|
||||
}
|
||||
resizeArea();
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
|
||||
public void removeCard(UUID cardId) {
|
||||
private void removeCardImg(UUID cardId) {
|
||||
for (Component comp: getComponents()) {
|
||||
if (comp instanceof Card) {
|
||||
if (((Card)comp).getCardId().equals(cardId)) {
|
||||
remove(comp);
|
||||
}
|
||||
}
|
||||
} else if (comp instanceof MageCard) {
|
||||
if (((MageCard)comp).getOriginal().getId().equals(cardId)) {
|
||||
remove(comp);
|
||||
|
|
@ -139,6 +141,11 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener
|
|||
}
|
||||
}
|
||||
|
||||
public void removeCard(UUID cardId) {
|
||||
removeCardImg(cardId);
|
||||
cards.remove(cardId);
|
||||
}
|
||||
|
||||
|
||||
public void addCardEventListener(Listener<Event> listener) {
|
||||
cardEventSource.addListener(listener);
|
||||
|
|
@ -213,8 +220,6 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener
|
|||
}
|
||||
if (size.height != area.height || size.width != area.width) {
|
||||
setPreferredSize(area);
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue