implement deck stats tab in Decks screen.

master
lodici 2017-02-07 14:24:31 +00:00
parent 776c8dfe13
commit 0e9e432783
2 changed files with 10 additions and 8 deletions

View File

@ -9,6 +9,7 @@ import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.ui.FontsAndBorders;
import magic.ui.screen.deck.editor.IDeckEditorView;
import magic.ui.screen.decks.IDeckView;
import magic.ui.screen.stats.IPagination;
import magic.ui.screen.stats.PaginationPanel;
import magic.ui.screen.widget.ActionBarButton;
@ -18,7 +19,7 @@ import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
public class DeckStatsPanel extends TexturedPanel
implements IDeckEditorView, IPagination {
implements IDeckEditorView, IDeckView, IPagination {
private GameStatsTableModel tm;
private GameStatsJTable table;

View File

@ -10,6 +10,7 @@ import magic.model.MagicCardDefinition;
import magic.model.MagicDeck;
import magic.translate.MText;
import magic.ui.helpers.MouseHelper;
import magic.ui.screen.deck.editor.stats.DeckStatsPanel;
import magic.ui.widget.deck.legality.LegalityPanel;
import magic.ui.widget.deck.stats.IPwlWorkerListener;
import net.miginfocom.swing.MigLayout;
@ -28,7 +29,7 @@ public class DeckViewsPanel extends JPanel implements IPwlWorkerListener {
private final ToggleButtonsPanel toggleButtonsPanel = new ToggleButtonsPanel();
private final DeckPanel deckPanel;
private final LegalityPanel legalityPanel;
// private final DeckStatsPanel statsPanel;
private final DeckStatsPanel statsPanel;
private JToggleButton statsToggleButton;
private IDeckView activeView;
@ -38,10 +39,10 @@ public class DeckViewsPanel extends JPanel implements IPwlWorkerListener {
deckPanel = new DeckPanel();
legalityPanel = new LegalityPanel();
// statsPanel = new DeckStatsPanel(new MagicDeck());
//
statsPanel = new DeckStatsPanel(new MagicDeck());
legalityPanel.setVisible(false);
// statsPanel.setVisible(false);
statsPanel.setVisible(false);
activeView = deckPanel;
@ -75,7 +76,7 @@ public class DeckViewsPanel extends JPanel implements IPwlWorkerListener {
@Override
public void actionPerformed(ActionEvent e) {
MouseHelper.showBusyCursor((Component) e.getSource());
// setView(statsPanel);
setView(statsPanel);
MouseHelper.showHandCursor((Component) e.getSource());
}
});
@ -91,7 +92,7 @@ public class DeckViewsPanel extends JPanel implements IPwlWorkerListener {
add(toggleButtonsPanel, "w 100%, h 34!");
add(deckPanel, "w 100%, h 100%, hidemode 3");
add(legalityPanel, "w 100%, h 100%, hidemode 3");
// add(statsPanel, "w 100%, h 100%, hidemode 3");
add(statsPanel, "w 100%, h 100%, hidemode 3");
revalidate();
}
@ -115,7 +116,7 @@ public class DeckViewsPanel extends JPanel implements IPwlWorkerListener {
System.out.println("DeckViewsPanel.doRefreshViews");
deckPanel.setDeck(deck);
legalityPanel.setDeck(deck);
// statsPanel.setDeck(deck);
statsPanel.setDeck(deck);
setView(activeView);
}