mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Finalization for Refactoring
This commit is contained in:
@@ -444,7 +444,7 @@ public class FDeckChooser extends JPanel implements IDecksComboBoxListener {
|
||||
if (decksComboBox.getDeckType() == null || decksComboBox.getDeckType() == DeckType.NET_DECK) {
|
||||
//handle special case of net decks
|
||||
if (netDeckCategory == null) { return ""; }
|
||||
state.append(NetDeckCategory.PREFIX + netDeckCategory.getName());
|
||||
state.append(NetDeckCategory.PREFIX).append(netDeckCategory.getName());
|
||||
}
|
||||
else {
|
||||
state.append(decksComboBox.getDeckType().name());
|
||||
|
||||
@@ -98,9 +98,7 @@ public final class SRearrangingUtil {
|
||||
}
|
||||
// Otherwise, add all of the documents.
|
||||
else {
|
||||
for (final IVDoc<? extends ICDoc> vDoc : cellSrc.getDocs()) {
|
||||
docsToMove.add(vDoc);
|
||||
}
|
||||
docsToMove.addAll(cellSrc.getDocs());
|
||||
}
|
||||
|
||||
// Reset and show preview panel
|
||||
|
||||
@@ -136,9 +136,7 @@ public final class SResizingUtil {
|
||||
int smoothVal = 0;
|
||||
|
||||
Set<Component> existingComponents = new HashSet<>();
|
||||
for (Component c : pnlContent.getComponents()) {
|
||||
existingComponents.add(c);
|
||||
}
|
||||
existingComponents.addAll(Arrays.asList(pnlContent.getComponents()));
|
||||
|
||||
// This is the core of the pixel-perfect layout. To avoid ±1 px errors on borders
|
||||
// from rounding individual panels, the intermediate values (exactly accurate, in %)
|
||||
|
||||
@@ -45,10 +45,10 @@ public abstract class ListLabelFilter<T extends InventoryItem> extends ItemFilte
|
||||
labelBuilder.append("s: All");
|
||||
break;
|
||||
case 1:
|
||||
labelBuilder.append(": " + getList().iterator().next());
|
||||
labelBuilder.append(": ").append(getList().iterator().next());
|
||||
break;
|
||||
default:
|
||||
labelBuilder.append("s: " + TextUtil.join(getList(), ", "));
|
||||
labelBuilder.append("s: ").append(TextUtil.join(getList(), ", "));
|
||||
break;
|
||||
}
|
||||
label.setText(labelBuilder.toString());
|
||||
|
||||
@@ -32,7 +32,7 @@ public abstract class StatTypeFilter<T extends InventoryItem> extends ToggleButt
|
||||
final Localizer localizer = Localizer.getInstance();
|
||||
StringBuilder tooltip = new StringBuilder();
|
||||
tooltip.append(st.label);
|
||||
tooltip.append(" (" + localizer.getMessage("lblclicktotoogle") + " ");
|
||||
tooltip.append(" (").append(localizer.getMessage("lblclicktotoogle")).append(" ");
|
||||
if (st.label.length() > 1 && !Character.isUpperCase(st.label.charAt(1))) {
|
||||
tooltip.append(st.label.substring(0, 1).toLowerCase());
|
||||
tooltip.append(st.label.substring(1));
|
||||
|
||||
@@ -597,9 +597,7 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
piles.get(key).items.add(itemInfo);
|
||||
}
|
||||
group.piles.clear();
|
||||
for (Pile pile : piles.values()) {
|
||||
group.piles.add(pile);
|
||||
}
|
||||
group.piles.addAll(piles.values());
|
||||
}
|
||||
|
||||
groupY = y;
|
||||
|
||||
@@ -2,6 +2,7 @@ package forge.screens.home;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.Arrays;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
@@ -28,9 +29,7 @@ public class CLobby {
|
||||
|
||||
private void addDecks(final Iterable<DeckProxy> commanderDecks, FList<Object> deckList, String... initialItems) {
|
||||
Vector<Object> listData = new Vector<>();
|
||||
for (String item : initialItems) {
|
||||
listData.add(item);
|
||||
}
|
||||
listData.addAll(Arrays.asList(initialItems));
|
||||
listData.add("Generate");
|
||||
if (!Iterables.isEmpty(commanderDecks)) {
|
||||
listData.add("Random");
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ContestGauntletLister extends JPanel {
|
||||
this.removeAll();
|
||||
final List<RowPanel> tempRows = new ArrayList<>();
|
||||
final List<GauntletData> sorted = new ArrayList<>();
|
||||
for (final GauntletData gd : gd0) { sorted.add(gd); }
|
||||
sorted.addAll(gd0);
|
||||
sorted.sort(new Comparator<GauntletData>() {
|
||||
@Override
|
||||
public int compare(final GauntletData x, final GauntletData y) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public class QuickGauntletLister extends JPanel {
|
||||
this.removeAll();
|
||||
final List<RowPanel> tempRows = new ArrayList<>();
|
||||
final List<GauntletData> sorted = new ArrayList<>();
|
||||
for (final GauntletData gd : gauntlets) { sorted.add(gd); }
|
||||
sorted.addAll(gauntlets);
|
||||
sorted.sort(new Comparator<GauntletData>() {
|
||||
@Override
|
||||
public int compare(final GauntletData x, final GauntletData y) {
|
||||
|
||||
@@ -161,7 +161,7 @@ public enum CSubmenuChallenges implements ICDoc {
|
||||
final JXButtonPanel grpPanel = new JXButtonPanel();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(localizer.getMessage("lblMatchBestof") + " ").append(FModel.getQuest().getMatchLength());
|
||||
sb.append(localizer.getMessage("lblMatchBestof")).append(" ").append(FModel.getQuest().getMatchLength());
|
||||
view.getCbxMatchLength().setSelectedItem(sb.toString());
|
||||
|
||||
boolean haveAnyChallenges = true;
|
||||
|
||||
@@ -197,7 +197,7 @@ public enum CSubmenuDuels implements ICDoc {
|
||||
view.getPnlDuels().add(grpPanel, "w 100%!");
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(localizer.getMessage("lblMatchBestof") + " ").append(FModel.getQuest().getMatchLength());
|
||||
sb.append(localizer.getMessage("lblMatchBestof")).append(" ").append(FModel.getQuest().getMatchLength());
|
||||
view.getCbxMatchLength().setSelectedItem(sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class QuestFileLister extends JPanel {
|
||||
this.removeAll();
|
||||
List<RowPanel> tempRows = new ArrayList<>();
|
||||
List<QuestData> sorted = new ArrayList<>();
|
||||
for (QuestData qd : qd0) { sorted.add(qd); }
|
||||
sorted.addAll(qd0);
|
||||
sorted.sort(new Comparator<QuestData>() {
|
||||
@Override
|
||||
public int compare(final QuestData x, final QuestData y) {
|
||||
|
||||
@@ -234,8 +234,8 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
cniSB.append("-------------------\n\n");
|
||||
|
||||
for (CardEdition e : editions) {
|
||||
nifSB.append("Edition: " + e.getName() + " " + "(" + e.getCode() + "/" + e.getCode2() + ")\n");
|
||||
cniSB.append("Edition: " + e.getName() + " " + "(" + e.getCode() + "/" + e.getCode2() + ")\n");
|
||||
nifSB.append("Edition: ").append(e.getName()).append(" ").append("(").append(e.getCode()).append("/").append(e.getCode2()).append(")\n");
|
||||
cniSB.append("Edition: ").append(e.getName()).append(" ").append("(").append(e.getCode()).append("/").append(e.getCode2()).append(")\n");
|
||||
|
||||
String imagePath;
|
||||
int artIndex = 1;
|
||||
@@ -261,7 +261,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
}
|
||||
|
||||
if (cp == null) {
|
||||
cniSB.append(" " + c + "\n");
|
||||
cniSB.append(" ").append(c).append("\n");
|
||||
notImplementedCount++;
|
||||
continue;
|
||||
}
|
||||
@@ -274,7 +274,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
if (imagePath != null) {
|
||||
File file = ImageKeys.getImageFile(imagePath);
|
||||
if (file == null) {
|
||||
nifSB.append(" " + imagePath + "\n");
|
||||
nifSB.append(" ").append(imagePath).append("\n");
|
||||
missingCount++;
|
||||
}
|
||||
}
|
||||
@@ -287,7 +287,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
if (imagePath != null) {
|
||||
File file = ImageKeys.getImageFile(imagePath);
|
||||
if (file == null) {
|
||||
nifSB.append(" " + imagePath + "\n");
|
||||
nifSB.append(" ").append(imagePath).append("\n");
|
||||
missingCount++;
|
||||
}
|
||||
}
|
||||
@@ -310,7 +310,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
String imgKey = token.getImageKey(i);
|
||||
File file = ImageKeys.getImageFile(imgKey);
|
||||
if (file == null) {
|
||||
nifSB.append(" " + token.getImageFilename(i+1) + "\n");
|
||||
nifSB.append(" ").append(token.getImageFilename(i + 1)).append("\n");
|
||||
missingCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,7 +403,7 @@ public class VAssignDamage {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(dmg);
|
||||
if( overkill >= 0 ) {
|
||||
sb.append(" (" +localizer.getMessage("lblLethal"));
|
||||
sb.append(" (").append(localizer.getMessage("lblLethal"));
|
||||
if( overkill > 0 )
|
||||
sb.append(" +").append(overkill);
|
||||
sb.append(")");
|
||||
|
||||
@@ -459,8 +459,7 @@ public enum FView {
|
||||
* @return {@link java.util.List}<{@link forge.gui.framework.DragCell}>
|
||||
*/
|
||||
public List<DragCell> getDragCells() {
|
||||
final List<DragCell> clone = new ArrayList<>();
|
||||
clone.addAll(allCells);
|
||||
final List<DragCell> clone = new ArrayList<>(allCells);
|
||||
return clone;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user