Fixed a bug that during sideboarding the display of the card the mouse hoovered on did stop to show in the big card panel.

This commit is contained in:
LevelX2 2014-02-26 20:41:27 +01:00
parent 62b92f1c5d
commit 4bd4ad3d8a
5 changed files with 53 additions and 36 deletions

View file

@ -67,10 +67,10 @@ import mage.view.PermanentView;
*/
public class BattlefieldPanel extends javax.swing.JLayeredPane {
private final Map<UUID, MagePermanent> permanents = new LinkedHashMap<UUID, MagePermanent>();
private final Map<UUID, MagePermanent> permanents = new LinkedHashMap<>();
private UUID gameId;
private BigCard bigCard;
private final Map<String, JComponent> uiComponentsList = new HashMap<String, JComponent>();
private final Map<String, JComponent> uiComponentsList = new HashMap<>();
protected Map<UUID, PermanentView> battlefield;
private Dimension cardDimension;
@ -118,12 +118,13 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
}
permanents.clear();
Plugins.getInstance().sortPermanents(uiComponentsList, permanents.values());
this.bigCard = null;
}
public void update(Map<UUID, PermanentView> battlefield) {
boolean changed = false;
List<PermanentView> permanentsToAdd = new ArrayList<PermanentView>();
List<PermanentView> permanentsToAdd = new ArrayList<>();
for (PermanentView permanent: battlefield.values()) {
if (!permanents.containsKey(permanent.getId())) {
permanentsToAdd.add(permanent);