From b79876c95963425a34b72a0d4a005e99aa249618 Mon Sep 17 00:00:00 2001 From: drdev Date: Sun, 22 Dec 2013 09:39:00 +0000 Subject: [PATCH] Support hiding Favorite column from Editor Preferences pane --- .../controllers/CEditorPreferences.java | 1 + .../deckeditor/views/VEditorPreferences.java | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/forge-gui/src/main/java/forge/gui/deckeditor/controllers/CEditorPreferences.java b/forge-gui/src/main/java/forge/gui/deckeditor/controllers/CEditorPreferences.java index 0f077dc89ae..9eb1eab09f5 100644 --- a/forge-gui/src/main/java/forge/gui/deckeditor/controllers/CEditorPreferences.java +++ b/forge-gui/src/main/java/forge/gui/deckeditor/controllers/CEditorPreferences.java @@ -59,6 +59,7 @@ public enum CEditorPreferences implements ICDoc { prefsDict.put(prefsInstance.getChbCatalogRanking(), ColumnName.CAT_RANKING); prefsDict.put(prefsInstance.getChbCatalogPower(), ColumnName.CAT_POWER); prefsDict.put(prefsInstance.getChbCatalogToughness(), ColumnName.CAT_TOUGHNESS); + prefsDict.put(prefsInstance.getChbCatalogFavorite(), ColumnName.CAT_FAVORITE); prefsDict.put(prefsInstance.getChbCatalogOwned(), ColumnName.CAT_OWNED); // Deck diff --git a/forge-gui/src/main/java/forge/gui/deckeditor/views/VEditorPreferences.java b/forge-gui/src/main/java/forge/gui/deckeditor/views/VEditorPreferences.java index a0c03345edd..f60e45b5cf8 100644 --- a/forge-gui/src/main/java/forge/gui/deckeditor/views/VEditorPreferences.java +++ b/forge-gui/src/main/java/forge/gui/deckeditor/views/VEditorPreferences.java @@ -51,6 +51,7 @@ public enum VEditorPreferences implements IVDoc { private JCheckBox chbCatalogRanking = new FCheckBox("Ranking"); private JCheckBox chbCatalogPower = new FCheckBox("Power"); private JCheckBox chbCatalogToughness = new FCheckBox("Toughness"); + private JCheckBox chbCatalogFavorite = new FCheckBox("Favorite"); private JCheckBox chbCatalogOwned = new FCheckBox("Owned (Spell shop)"); private JCheckBox chbDeckColor = new FCheckBox("Color"); @@ -66,7 +67,7 @@ public enum VEditorPreferences implements IVDoc { private JCheckBox chbCardDisplayUnique = new FCheckBox("Show unique cards only (only affects Constructed)"); - private JPanel pnl = new JPanel(new MigLayout("insets 0, gap 0, wrap 2, ax center")); + private JPanel pnl = new JPanel(new MigLayout("insets 0, gap 0, wrap 2, ax left")); private JScrollPane scroller = new JScrollPane(pnl); //========== Constructor @@ -86,6 +87,7 @@ public enum VEditorPreferences implements IVDoc { FSkin.get(chbCatalogRanking).setFont(font); FSkin.get(chbCatalogPower).setFont(font); FSkin.get(chbCatalogToughness).setFont(font); + FSkin.get(chbCatalogFavorite).setFont(font); FSkin.get(chbCatalogOwned).setFont(font); FSkin.get(chbDeckColor).setFont(font); @@ -103,10 +105,10 @@ public enum VEditorPreferences implements IVDoc { FSkin.get(chbCardDisplayUnique).setFont(font); chbCardDisplayUnique.setSelected(false); - pnl.add(lblStats, "h 25px!, gap 5px 5px 5px 5px, ax center, span 2 1"); - pnl.add(chbElasticColumns, "h 25px!, gap 5px 5px 5px 5px, ax center, span 2 1"); + pnl.add(lblStats, "h 25px!, gap 5px 5px 5px 5px, ax left, span 2 1"); + pnl.add(chbElasticColumns, "h 25px!, gap 5px 5px 5px 5px, ax left, span 2 1"); - final String constraints = "w 75px, h 25px!, gap 5px 5px 5px 5px, ax center"; + final String constraints = "w 75px, h 25px!, gap 5px 5px 5px 5px, ax left"; pnl.add(lblCatalog, constraints + ", span 2 1"); pnl.add(chbCatalogColor, constraints); pnl.add(chbCatalogRarity, constraints); @@ -116,6 +118,7 @@ public enum VEditorPreferences implements IVDoc { pnl.add(chbCatalogToughness, constraints); pnl.add(chbCatalogAI, constraints); pnl.add(chbCatalogRanking, constraints); + pnl.add(chbCatalogFavorite, constraints); pnl.add(chbCatalogOwned, constraints + ", wrap"); pnl.add(lblDeck, constraints + ", span 2 1"); @@ -125,7 +128,7 @@ public enum VEditorPreferences implements IVDoc { pnl.add(chbDeckSet, constraints); pnl.add(chbDeckPower, constraints); pnl.add(chbDeckToughness, constraints); - pnl.add(chbDeckAI, constraints + ", wrap"); + pnl.add(chbDeckAI, constraints); pnl.add(chbDeckRanking, constraints + ", wrap"); pnl.add(lblDisplay, constraints + ", span 2 1"); @@ -230,6 +233,11 @@ public enum VEditorPreferences implements IVDoc { return chbCatalogToughness; } + /** @return {@link javax.swing.JCheckBox} */ + public JCheckBox getChbCatalogFavorite() { + return chbCatalogFavorite; + } + /** @return {@link javax.swing.JCheckBox} */ public JCheckBox getChbCatalogOwned() { return chbCatalogOwned;