Commit 52184e24 authored by Peter Patel-Schneider's avatar Peter Patel-Schneider

Add intermediate FloatingCardArea to hold commonalities between FloatingZone and ListCardArea

parent b6dbfcee
......@@ -290,12 +290,9 @@ public class GuiChoose {
final Callable<List<Card>> callable = new Callable<List<Card>>() {
@Override
public List<Card> call() throws Exception {
ListCardArea tempArea = new ListCardArea(gui,title,cards,manipulable,toTop,toBottom,toAnywhere);
ListCardArea tempArea = ListCardArea.show(gui,title,cards,manipulable,toTop,toBottom,toAnywhere);
// tempArea.pack();
// window? tempArea.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
tempArea.show();
// tempArea.dispose();
//try { Thread.sleep(1000); } catch(InterruptedException ex) { }
final List<Card> cardList = tempArea.getCardList();
return cardList;
}
......
......@@ -101,7 +101,7 @@ import forge.util.ITriggerEvent;
import forge.util.gui.SOptionPane;
import forge.view.FView;
import forge.view.arcane.CardPanel;
import forge.view.arcane.FloatingCardArea;
import forge.view.arcane.FloatingZone;
import forge.match.input.*;
/**
......@@ -401,7 +401,7 @@ public final class CMatchUI
break;
default:
updateZones = true;
FloatingCardArea.refresh(owner, zone);
FloatingZone.refresh(owner, zone);
break;
}
}
......@@ -437,7 +437,7 @@ public final class CMatchUI
break;
case Hand: // controller hand always shown
if (controller != player) {
FloatingCardArea.show(this,player,zone);
FloatingZone.show(this,player,zone);
}
break;
case Library:
......@@ -445,7 +445,7 @@ public final class CMatchUI
case Exile:
case Flashback:
case Command:
FloatingCardArea.show(this,player,zone);
FloatingZone.show(this,player,zone);
break;
default:
break;
......@@ -469,7 +469,7 @@ public final class CMatchUI
case Exile:
case Flashback:
case Command:
FloatingCardArea.hide(this,player,zone);
FloatingZone.hide(this,player,zone);
break;
default:
break;
......@@ -519,7 +519,7 @@ public final class CMatchUI
}
break;
default:
FloatingCardArea.refresh(c.getController(),zone); // in case the card is visible in the zone
FloatingZone.refresh(c.getController(),zone); // in case the card is visible in the zone
break;
}
}
......@@ -559,7 +559,7 @@ public final class CMatchUI
layoutControl.initialize();
layoutControl.update();
}
FloatingCardArea.closeAll();
FloatingZone.closeAll();
}
@Override
......@@ -617,7 +617,7 @@ public final class CMatchUI
case Exile:
case Graveyard:
case Library:
return FloatingCardArea.getCardPanel(this, card);
return FloatingZone.getCardPanel(this, card);
default:
break;
}
......@@ -728,7 +728,7 @@ public final class CMatchUI
@Override
public void finishGame() {
FloatingCardArea.closeAll(); //ensure floating card areas cleared and closed after the game
FloatingZone.closeAll(); //ensure floating card areas cleared and closed after the game
final GameView gameView = getGameView();
if (hasLocalPlayers() || gameView.isMatchOver()) {
new ViewWinLose(gameView, this).show();
......@@ -842,7 +842,7 @@ public final class CMatchUI
} else {
final ZoneType zone = hostCard.getZone();
if (ImmutableList.of(ZoneType.Command, ZoneType.Exile, ZoneType.Graveyard, ZoneType.Library).contains(zone)) {
FloatingCardArea.show(this, hostCard.getController(), zone);
FloatingZone.show(this, hostCard.getController(), zone);
}
menuParent = panel.getParent();
x = triggerEvent.getX();
......
......@@ -2,7 +2,7 @@ package forge.screens.match;
import forge.game.player.PlayerView;
import forge.game.zone.ZoneType;
import forge.view.arcane.FloatingCardArea;
import forge.view.arcane.FloatingZone;
/**
* Receives click and programmatic requests for viewing data stacks in the
......@@ -27,6 +27,6 @@ public final class ZoneAction implements Runnable {
@Override
public void run() {
FloatingCardArea.showOrHide(matchUI, player, zone);
FloatingZone.showOrHide(matchUI, player, zone);
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment