mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Cleanup whitespace
This commit is contained in:
@@ -51,7 +51,7 @@ import forge.util.ItemPool;
|
|||||||
public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
||||||
/** */
|
/** */
|
||||||
SINGLETON_INSTANCE;
|
SINGLETON_INSTANCE;
|
||||||
|
|
||||||
public static final int SEARCH_MODE_INVERSE_INDEX = 1;
|
public static final int SEARCH_MODE_INVERSE_INDEX = 1;
|
||||||
|
|
||||||
// Fields used with interface IVDoc
|
// Fields used with interface IVDoc
|
||||||
@@ -79,14 +79,14 @@ public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
|||||||
|
|
||||||
private final ItemManagerContainer cardManagerContainer = new ItemManagerContainer();
|
private final ItemManagerContainer cardManagerContainer = new ItemManagerContainer();
|
||||||
private final CardManager cardManager;
|
private final CardManager cardManager;
|
||||||
|
|
||||||
private final Map<RangeTypes, Pair<FSpinner, FSpinner>> spinners = new HashMap<RangeTypes, Pair<FSpinner, FSpinner>>();
|
private final Map<RangeTypes, Pair<FSpinner, FSpinner>> spinners = new HashMap<RangeTypes, Pair<FSpinner, FSpinner>>();
|
||||||
|
|
||||||
//========== Constructor
|
//========== Constructor
|
||||||
/** */
|
/** */
|
||||||
private VWorkshopCatalog() {
|
private VWorkshopCatalog() {
|
||||||
pnlStats.setOpaque(false);
|
pnlStats.setOpaque(false);
|
||||||
|
|
||||||
for (SItemManagerUtil.StatTypes s : SItemManagerUtil.StatTypes.values()) {
|
for (SItemManagerUtil.StatTypes s : SItemManagerUtil.StatTypes.values()) {
|
||||||
FLabel label = buildToggleLabel(s, SItemManagerUtil.StatTypes.TOTAL != s);
|
FLabel label = buildToggleLabel(s, SItemManagerUtil.StatTypes.TOTAL != s);
|
||||||
statLabels.put(s, label);
|
statLabels.put(s, label);
|
||||||
@@ -104,7 +104,7 @@ public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
|||||||
}
|
}
|
||||||
pnlStats.add(component);
|
pnlStats.add(component);
|
||||||
}
|
}
|
||||||
|
|
||||||
pnlSearch.setOpaque(false);
|
pnlSearch.setOpaque(false);
|
||||||
pnlSearch.add(btnAddRestriction, "center, w pref+8, h pref+8");
|
pnlSearch.add(btnAddRestriction, "center, w pref+8, h pref+8");
|
||||||
pnlSearch.add(txfSearch, "pushx, growx");
|
pnlSearch.add(txfSearch, "pushx, growx");
|
||||||
@@ -116,7 +116,7 @@ public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
|||||||
pnlSearch.add(lblText, "w pref+8, h pref+8");
|
pnlSearch.add(lblText, "w pref+8, h pref+8");
|
||||||
|
|
||||||
pnlRestrictions.setOpaque(false);
|
pnlRestrictions.setOpaque(false);
|
||||||
|
|
||||||
// fill spinner map
|
// fill spinner map
|
||||||
for (RangeTypes t : RangeTypes.values()) {
|
for (RangeTypes t : RangeTypes.values()) {
|
||||||
FSpinner lowerBound = new FSpinner.Builder().maxValue(10).build();
|
FSpinner lowerBound = new FSpinner.Builder().maxValue(10).build();
|
||||||
@@ -130,7 +130,7 @@ public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
|||||||
Iterable<PaperCard> allCards = Iterables.concat(Singletons.getMagicDb().getCommonCards(), Singletons.getMagicDb().getVariantCards());
|
Iterable<PaperCard> allCards = Iterables.concat(Singletons.getMagicDb().getCommonCards(), Singletons.getMagicDb().getVariantCards());
|
||||||
this.cardManager.setPool(ItemPool.createFrom(allCards, PaperCard.class), true);
|
this.cardManager.setPool(ItemPool.createFrom(allCards, PaperCard.class), true);
|
||||||
this.cardManagerContainer.setItemManager(this.cardManager);
|
this.cardManagerContainer.setItemManager(this.cardManager);
|
||||||
|
|
||||||
this.cardManager.addSelectionListener(new ListSelectionListener() {
|
this.cardManager.addSelectionListener(new ListSelectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void valueChanged(ListSelectionEvent e) {
|
public void valueChanged(ListSelectionEvent e) {
|
||||||
@@ -145,7 +145,7 @@ public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
|||||||
private void _setupSpinner (JSpinner spinner) {
|
private void _setupSpinner (JSpinner spinner) {
|
||||||
spinner.setFocusable(false); // only the spinner text field should be focusable, not the up/down widget
|
spinner.setFocusable(false); // only the spinner text field should be focusable, not the up/down widget
|
||||||
}
|
}
|
||||||
|
|
||||||
//========== Overridden from IVDoc
|
//========== Overridden from IVDoc
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -187,7 +187,7 @@ public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
|||||||
public FLabel getLblName() { return lblName; }
|
public FLabel getLblName() { return lblName; }
|
||||||
public FLabel getLblType() { return lblType; }
|
public FLabel getLblType() { return lblType; }
|
||||||
public FLabel getLblText() { return lblText; }
|
public FLabel getLblText() { return lblText; }
|
||||||
|
|
||||||
public FLabel getBtnAddRestriction() { return btnAddRestriction; }
|
public FLabel getBtnAddRestriction() { return btnAddRestriction; }
|
||||||
public FComboBoxWrapper<String> getCbSearchMode() { return cbSearchMode; }
|
public FComboBoxWrapper<String> getCbSearchMode() { return cbSearchMode; }
|
||||||
public JTextField getTxfSearch() { return txfSearch; }
|
public JTextField getTxfSearch() { return txfSearch; }
|
||||||
@@ -201,7 +201,7 @@ public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
|||||||
public Map<RangeTypes, Pair<FSpinner, FSpinner>> getSpinners() {
|
public Map<RangeTypes, Pair<FSpinner, FSpinner>> getSpinners() {
|
||||||
return spinners;
|
return spinners;
|
||||||
}
|
}
|
||||||
|
|
||||||
//========== Other methods
|
//========== Other methods
|
||||||
private FLabel buildToggleLabel(SItemManagerUtil.StatTypes s, boolean selectable) {
|
private FLabel buildToggleLabel(SItemManagerUtil.StatTypes s, boolean selectable) {
|
||||||
String tooltip;
|
String tooltip;
|
||||||
@@ -217,20 +217,20 @@ public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
|||||||
.tooltip(tooltip)
|
.tooltip(tooltip)
|
||||||
.hoverable().selectable(selectable).selected(selectable)
|
.hoverable().selectable(selectable).selected(selectable)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
label.setPreferredSize(labelSize);
|
label.setPreferredSize(labelSize);
|
||||||
label.setMinimumSize(labelSize);
|
label.setMinimumSize(labelSize);
|
||||||
|
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public void addRestrictionWidget(JComponent component, final Command onRemove) {
|
public void addRestrictionWidget(JComponent component, final Command onRemove) {
|
||||||
final JPanel pnl = new JPanel(new MigLayout("insets 2, gap 2, h 30!"));
|
final JPanel pnl = new JPanel(new MigLayout("insets 2, gap 2, h 30!"));
|
||||||
|
|
||||||
pnl.setOpaque(false);
|
pnl.setOpaque(false);
|
||||||
FSkin.get(pnl).setMatteBorder(1, 2, 1, 2, FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
FSkin.get(pnl).setMatteBorder(1, 2, 1, 2, FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
||||||
|
|
||||||
pnl.add(component, "h 30!, center");
|
pnl.add(component, "h 30!, center");
|
||||||
pnl.add(new FLabel.Builder().text("X").fontSize(10).hoverable(true)
|
pnl.add(new FLabel.Builder().text("X").fontSize(10).hoverable(true)
|
||||||
.tooltip("Remove filter").cmdClick(new Command() {
|
.tooltip("Remove filter").cmdClick(new Command() {
|
||||||
@@ -245,25 +245,25 @@ public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
|||||||
pnlRestrictions.add(pnl, "h 30!");
|
pnlRestrictions.add(pnl, "h 30!");
|
||||||
refreshRestrictionWidgets();
|
refreshRestrictionWidgets();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshRestrictionWidgets() {
|
public void refreshRestrictionWidgets() {
|
||||||
Container parent = pnlRestrictions.getParent();
|
Container parent = pnlRestrictions.getParent();
|
||||||
pnlRestrictions.validate();
|
pnlRestrictions.validate();
|
||||||
parent.validate();
|
parent.validate();
|
||||||
parent.repaint();
|
parent.repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
public JPanel buildRangeRestrictionWidget(RangeTypes t) {
|
public JPanel buildRangeRestrictionWidget(RangeTypes t) {
|
||||||
JPanel pnl = new JPanel(new MigLayout("insets 0, gap 2"));
|
JPanel pnl = new JPanel(new MigLayout("insets 0, gap 2"));
|
||||||
pnl.setOpaque(false);
|
pnl.setOpaque(false);
|
||||||
|
|
||||||
Pair<FSpinner, FSpinner> s = spinners.get(t);
|
Pair<FSpinner, FSpinner> s = spinners.get(t);
|
||||||
pnl.add(s.getLeft(), "w 45!, h 26!, center");
|
pnl.add(s.getLeft(), "w 45!, h 26!, center");
|
||||||
pnl.add(new FLabel.Builder().text("<=").fontSize(11).build(), "h 26!, center");
|
pnl.add(new FLabel.Builder().text("<=").fontSize(11).build(), "h 26!, center");
|
||||||
pnl.add(new FLabel.Builder().text(t.toLabelString()).fontSize(11).build(), "h 26!, center");
|
pnl.add(new FLabel.Builder().text(t.toLabelString()).fontSize(11).build(), "h 26!, center");
|
||||||
pnl.add(new FLabel.Builder().text("<=").fontSize(11).build(), "h 26!, center");
|
pnl.add(new FLabel.Builder().text("<=").fontSize(11).build(), "h 26!, center");
|
||||||
pnl.add(s.getRight(), "w 45!, h 26!, center");
|
pnl.add(s.getRight(), "w 45!, h 26!, center");
|
||||||
|
|
||||||
return pnl;
|
return pnl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user