mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Update language properties
This commit is contained in:
@@ -85,10 +85,10 @@ public enum FControl implements KeyEventDispatcher {
|
||||
private CloseAction closeAction;
|
||||
private final List<HostedMatch> currentMatches = Lists.newArrayList();
|
||||
|
||||
public static enum CloseAction {
|
||||
public enum CloseAction {
|
||||
NONE,
|
||||
CLOSE_SCREEN,
|
||||
EXIT_FORGE;
|
||||
EXIT_FORGE
|
||||
}
|
||||
|
||||
private boolean hasCurrentMatches() {
|
||||
@@ -122,7 +122,7 @@ public enum FControl implements KeyEventDispatcher {
|
||||
* switches between various display screens in that JFrame. Controllers are
|
||||
* instantiated separately by each screen's top level view class.
|
||||
*/
|
||||
private FControl() {
|
||||
FControl() {
|
||||
Singletons.getView().getFrame().addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(final WindowEvent e) {
|
||||
@@ -187,10 +187,7 @@ public enum FControl implements KeyEventDispatcher {
|
||||
if (!FOptionPane.showConfirmDialog(userPrompt, action + " Forge", action, "Cancel", !hasCurrentMatches)) { //default Yes if no game active
|
||||
return false;
|
||||
}
|
||||
if (!CDeckEditorUI.SINGLETON_INSTANCE.canSwitchAway(true)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return CDeckEditorUI.SINGLETON_INSTANCE.canSwitchAway(true);
|
||||
}
|
||||
|
||||
public boolean restartForge() {
|
||||
@@ -395,9 +392,8 @@ public enum FControl implements KeyEventDispatcher {
|
||||
else {
|
||||
altKeyLastDown = false;
|
||||
if (e.getID() == KeyEvent.KEY_PRESSED) {
|
||||
if (forgeMenu.handleKeyEvent(e)) { //give Forge menu the chance to handle the key event
|
||||
return true;
|
||||
}
|
||||
//give Forge menu the chance to handle the key event
|
||||
return forgeMenu.handleKeyEvent(e);
|
||||
}
|
||||
else if (e.getID() == KeyEvent.KEY_RELEASED) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.google.common.base.Predicate;
|
||||
import forge.deck.*;
|
||||
import forge.game.GameFormat;
|
||||
import forge.item.PaperCard;
|
||||
import forge.util.Localizer;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -46,7 +47,9 @@ public class FDeckChooser extends JPanel implements IDecksComboBoxListener {
|
||||
private boolean isForCommander;
|
||||
|
||||
private final DeckManager lstDecks;
|
||||
private final FLabel btnViewDeck = new FLabel.ButtonBuilder().text("View Deck").fontSize(14).build();
|
||||
final Localizer localizer = Localizer.getInstance();
|
||||
|
||||
private final FLabel btnViewDeck = new FLabel.ButtonBuilder().text(localizer.getMessage("lblViewDeck")).fontSize(14).build();
|
||||
private final FLabel btnRandom = new FLabel.ButtonBuilder().fontSize(14).build();
|
||||
|
||||
private boolean isAi;
|
||||
@@ -119,7 +122,7 @@ public class FDeckChooser extends JPanel implements IDecksComboBoxListener {
|
||||
lstDecks.setPool(decks);
|
||||
lstDecks.setup(config);
|
||||
|
||||
btnRandom.setText("Random Deck");
|
||||
btnRandom.setText(localizer.getMessage("lblRandomDeck"));
|
||||
btnRandom.setCommand(new UiCommand() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package forge.deckchooser;
|
||||
|
||||
public interface IDecksComboBoxListener {
|
||||
public void deckTypeSelected(DecksComboBoxEvent ev);
|
||||
void deckTypeSelected(DecksComboBoxEvent ev);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public enum FNetOverlay implements IOnlineChatInterface {
|
||||
/**
|
||||
* Semi-transparent overlay panel. Should be used with layered panes.
|
||||
*/
|
||||
private FNetOverlay() {
|
||||
FNetOverlay() {
|
||||
window.setTitle("Chat");
|
||||
window.setVisible(false);
|
||||
window.setBackground(FSkin.getColor(FSkin.Colors.CLR_ZEBRA));
|
||||
|
||||
@@ -250,7 +250,7 @@ public class GuiChoose {
|
||||
|
||||
final Callable<List<T>> callable = new Callable<List<T>>() {
|
||||
@Override
|
||||
public List<T> call() throws Exception {
|
||||
public List<T> call() {
|
||||
final DualListBox<T> dual = new DualListBox<T>(remainingObjectsMin, remainingObjectsMax, sourceChoices, destChoices, matchUI);
|
||||
dual.setSecondColumnLabelText(top);
|
||||
|
||||
@@ -290,7 +290,7 @@ public class GuiChoose {
|
||||
gui.setSelectables(manipulable);
|
||||
final Callable<List<CardView>> callable = new Callable<List<CardView>>() {
|
||||
@Override
|
||||
public List<CardView> call() throws Exception {
|
||||
public List<CardView> call() {
|
||||
ListCardArea tempArea = ListCardArea.show(gui,title,cards,manipulable,toTop,toBottom,toAnywhere);
|
||||
// tempArea.pack();
|
||||
tempArea.show();
|
||||
|
||||
@@ -490,7 +490,7 @@ public class ImportDialog {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground() throws Exception {
|
||||
protected Void doInBackground() {
|
||||
Timer timer = null;
|
||||
|
||||
try {
|
||||
@@ -867,7 +867,7 @@ public class ImportDialog {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground() throws Exception {
|
||||
protected Void doInBackground() {
|
||||
try {
|
||||
// working with textbox text is thread safe
|
||||
_operationLog.setText("");
|
||||
|
||||
@@ -155,12 +155,12 @@ public enum EDocID {
|
||||
// End enum declarations, start enum methods.
|
||||
private IVDoc<? extends ICDoc> vDoc;
|
||||
|
||||
private EDocID() {
|
||||
EDocID() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
/** @param doc0   {@link forge.gui.framework.IVDoc} */
|
||||
private EDocID(final IVDoc<? extends ICDoc> doc0) {
|
||||
EDocID(final IVDoc<? extends ICDoc> doc0) {
|
||||
this.vDoc = doc0;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,9 +53,7 @@ public class RectangleOfDouble {
|
||||
return false;
|
||||
if (Double.doubleToLongBits(x) != Double.doubleToLongBits(other.x))
|
||||
return false;
|
||||
if (Double.doubleToLongBits(y) != Double.doubleToLongBits(other.y))
|
||||
return false;
|
||||
return true;
|
||||
return Double.doubleToLongBits(y) == Double.doubleToLongBits(other.y);
|
||||
}
|
||||
|
||||
public final double getX() {
|
||||
|
||||
@@ -242,7 +242,7 @@ public final class SLayoutIO {
|
||||
}
|
||||
catch (final Exception e) {
|
||||
try {
|
||||
if (reader != null) { reader.close(); };
|
||||
if (reader != null) { reader.close(); }
|
||||
}
|
||||
catch (final XMLStreamException x) {
|
||||
e.printStackTrace();
|
||||
@@ -556,7 +556,7 @@ public final class SLayoutIO {
|
||||
EDocID selectedId = null;
|
||||
double x0 = 0, y0 = 0, w0 = 0, h0 = 0;
|
||||
|
||||
MapOfLists<LayoutInfo, EDocID> model = new HashMapOfLists<LayoutInfo, EDocID>(CollectionSuppliers.<EDocID>arrayLists());
|
||||
MapOfLists<LayoutInfo, EDocID> model = new HashMapOfLists<LayoutInfo, EDocID>(CollectionSuppliers.arrayLists());
|
||||
|
||||
LayoutInfo currentKey = null;
|
||||
while (null != reader && reader.hasNext()) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public final class SOverflowUtil {
|
||||
public void mouseClicked(final MouseEvent e) {
|
||||
final JPanel pnl = FView.SINGLETON_INSTANCE.getPnlTabOverflow();
|
||||
if (pnl != null) {
|
||||
pnl.setVisible(pnl.isVisible() ? false : true);
|
||||
pnl.setVisible(!pnl.isVisible());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -90,7 +90,7 @@ public final class SRearrangingUtil {
|
||||
// If only a single tab, select it, and add it to docsToMove.
|
||||
if (e.getSource() instanceof DragTab) {
|
||||
for (final IVDoc<? extends ICDoc> vDoc : cellSrc.getDocs()) {
|
||||
if (vDoc.getTabLabel() == (DragTab) (e.getSource())) {
|
||||
if (vDoc.getTabLabel() == e.getSource()) {
|
||||
cellSrc.setSelected(vDoc);
|
||||
docsToMove.add(vDoc);
|
||||
}
|
||||
|
||||
@@ -1130,7 +1130,7 @@ public abstract class ItemManager<T extends InventoryItem> extends JPanel implem
|
||||
* @param unique - if true, the editor will be set to the "unique item names only" mode.
|
||||
*/
|
||||
public void setWantUnique(final boolean unique) {
|
||||
this.wantUnique = this.alwaysNonUnique ? false : unique;
|
||||
this.wantUnique = !this.alwaysNonUnique && unique;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,7 @@ public enum CBazaarUI implements ICDoc {
|
||||
* @param v0   {@link forge.screens.bazaar.VBazaarUI}
|
||||
* @param bazaar
|
||||
*/
|
||||
private CBazaarUI() {
|
||||
CBazaarUI() {
|
||||
}
|
||||
|
||||
/** Populate all stalls, and select first one. */
|
||||
|
||||
@@ -33,7 +33,7 @@ public enum VBazaarUI implements IVTopLevelUI {
|
||||
/** Lays out containers and borders for resizeable layout and
|
||||
* instantiates top-level controller for bazaar UI.
|
||||
* @param bazaar0 */
|
||||
private VBazaarUI() {
|
||||
VBazaarUI() {
|
||||
}
|
||||
|
||||
/** */
|
||||
|
||||
@@ -66,7 +66,7 @@ public enum CDeckEditorUI implements ICDoc {
|
||||
private final VBrawlDecks vBrawlDecks;
|
||||
private final VTinyLeadersDecks vTinyLeadersDecks;
|
||||
|
||||
private CDeckEditorUI() {
|
||||
CDeckEditorUI() {
|
||||
screenChildControllers = new HashMap<FScreen, ACEditorBase<? extends InventoryItem, ? extends DeckBase>>();
|
||||
this.cDetailPicture = new CDetailPicture();
|
||||
this.vAllDecks = VAllDecks.SINGLETON_INSTANCE;
|
||||
@@ -153,7 +153,7 @@ public enum CDeckEditorUI implements ICDoc {
|
||||
}
|
||||
|
||||
private interface _MoveAction {
|
||||
public <T extends InventoryItem> void move(Iterable<Entry<T, Integer>> items);
|
||||
<T extends InventoryItem> void move(Iterable<Entry<T, Integer>> items);
|
||||
}
|
||||
|
||||
private <T extends InventoryItem> void moveSelectedItems(final ItemManager<T> itemManager, final _MoveAction moveAction, final int maxQty) {
|
||||
|
||||
@@ -12,7 +12,7 @@ public enum CCardCatalog implements ICDoc {
|
||||
/** */
|
||||
SINGLETON_INSTANCE;
|
||||
|
||||
private CCardCatalog() {
|
||||
CCardCatalog() {
|
||||
}
|
||||
|
||||
//========== Overridden methods
|
||||
|
||||
@@ -39,7 +39,7 @@ public enum CCurrentDeck implements ICDoc {
|
||||
|
||||
//========== Overridden methods
|
||||
|
||||
private CCurrentDeck() {
|
||||
CCurrentDeck() {
|
||||
final FileFilter[] defaultFilters = fileChooser.getChoosableFileFilters();
|
||||
for (final FileFilter defFilter : defaultFilters) {
|
||||
fileChooser.removeChoosableFileFilter(defFilter);
|
||||
|
||||
@@ -30,7 +30,7 @@ public enum VCardCatalog implements IVDoc<CCardCatalog> {
|
||||
|
||||
//========== Constructor
|
||||
/** */
|
||||
private VCardCatalog() {
|
||||
VCardCatalog() {
|
||||
}
|
||||
|
||||
//========== Overridden from IVDoc
|
||||
|
||||
@@ -88,7 +88,7 @@ public enum VCurrentDeck implements IVDoc<CCurrentDeck> {
|
||||
|
||||
//========== Constructor
|
||||
|
||||
private VCurrentDeck() {
|
||||
VCurrentDeck() {
|
||||
// Header area
|
||||
pnlHeader.setOpaque(false);
|
||||
pnlHeader.setLayout(new MigLayout("insets 3, gapx 3, hidemode 3"));
|
||||
|
||||
@@ -43,7 +43,7 @@ public enum VDeckgen implements IVDoc<CDeckgen> {
|
||||
.opaque(true).hoverable(true).build();
|
||||
|
||||
//========== Constructor
|
||||
private VDeckgen() {
|
||||
VDeckgen() {
|
||||
}
|
||||
|
||||
//========== Overridden methods
|
||||
|
||||
@@ -55,7 +55,7 @@ public enum VProbabilities implements IVDoc<CProbabilities> {
|
||||
private final JPanel pnlLibrary = new JPanel(new MigLayout("insets 0, gap 0, wrap"));
|
||||
|
||||
//========== Constructor
|
||||
private VProbabilities() {
|
||||
VProbabilities() {
|
||||
pnlContent.setOpaque(false);
|
||||
pnlHand.setOpaque(false);
|
||||
pnlLibrary.setOpaque(false);
|
||||
|
||||
@@ -86,7 +86,7 @@ public enum VStatistics implements IVDoc<CStatistics> {
|
||||
private final FScrollPane scroller = new FScrollPane(pnlStats, false);
|
||||
|
||||
//========== Constructor
|
||||
private VStatistics() {
|
||||
VStatistics() {
|
||||
scroller.getViewport().setBorder(null);
|
||||
|
||||
// Color stats
|
||||
|
||||
@@ -18,7 +18,7 @@ public enum EMenuGroup {
|
||||
private final String strTitle;
|
||||
|
||||
/** @param {@link java.lang.String} */
|
||||
private EMenuGroup(final String s0) { strTitle = s0; }
|
||||
EMenuGroup(final String s0) { strTitle = s0; }
|
||||
|
||||
/** @return {@link java.lang.String} */
|
||||
public String getTitle() {
|
||||
|
||||
@@ -248,7 +248,7 @@ public class PlayerPanel extends FPanel {
|
||||
lobby.updateVanguardList(index);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Listens to name text fields and gives the appropriate player focus. Also
|
||||
@@ -388,7 +388,7 @@ public class PlayerPanel extends FPanel {
|
||||
public Set<AIOption> getAiOptions() {
|
||||
return isSimulatedAi()
|
||||
? ImmutableSet.of(AIOption.USE_SIMULATION)
|
||||
: Collections.<AIOption>emptySet();
|
||||
: Collections.emptySet();
|
||||
}
|
||||
private boolean isSimulatedAi() {
|
||||
return radioAi.isSelected() && radioAiUseSimulation.isSelected();
|
||||
|
||||
@@ -98,7 +98,7 @@ public enum VHomeUI implements IVTopLevelUI {
|
||||
.iconAlignX(SwingConstants.CENTER)
|
||||
.iconInBackground(true).iconScaleFactor(1.0).build();
|
||||
|
||||
private VHomeUI() {
|
||||
VHomeUI() {
|
||||
// Add main menu containing logo and menu buttons
|
||||
final JPanel pnlMainMenu = new JPanel(new MigLayout("w 200px!, ax center, insets 0, gap 0, wrap"));
|
||||
pnlMainMenu.setOpaque(false);
|
||||
|
||||
@@ -24,6 +24,7 @@ import forge.toolbox.*;
|
||||
import forge.toolbox.FSkin.SkinImage;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.Lang;
|
||||
import forge.util.Localizer;
|
||||
import forge.util.NameGenerator;
|
||||
import forge.util.gui.SOptionPane;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
@@ -47,12 +48,13 @@ import java.util.List;
|
||||
public class VLobby implements ILobbyView {
|
||||
|
||||
static final int MAX_PLAYERS = 8;
|
||||
final Localizer localizer = Localizer.getInstance();
|
||||
private static final ForgePreferences prefs = FModel.getPreferences();
|
||||
|
||||
// General variables
|
||||
private final GameLobby lobby;
|
||||
private IPlayerChangeListener playerChangeListener = null;
|
||||
private final LblHeader lblTitle = new LblHeader("Sanctioned Format: Constructed");
|
||||
private final LblHeader lblTitle = new LblHeader(localizer.getMessage("lblHeaderConstructedMode"));
|
||||
private int activePlayersNum = 0;
|
||||
private int playerWithFocus = 0; // index of the player that currently has focus
|
||||
|
||||
@@ -81,13 +83,13 @@ public class VLobby implements ILobbyView {
|
||||
private final FScrollPanel playersScroll = new FScrollPanel(new MigLayout("insets 0, gap 0, wrap, hidemode 3"), true);
|
||||
private final List<PlayerPanel> playerPanels = new ArrayList<PlayerPanel>(MAX_PLAYERS);
|
||||
|
||||
private final FLabel addPlayerBtn = new FLabel.ButtonBuilder().fontSize(14).text("Add a Player").build();
|
||||
private final FLabel addPlayerBtn = new FLabel.ButtonBuilder().fontSize(14).text(localizer.getMessage("lblAddAPlayer")).build();
|
||||
|
||||
// Deck frame elements
|
||||
private final JPanel decksFrame = new JPanel(new MigLayout("insets 0, gap 0, wrap, hidemode 3"));
|
||||
private final List<FDeckChooser> deckChoosers = Lists.newArrayListWithCapacity(MAX_PLAYERS);
|
||||
private final FCheckBox cbSingletons = new FCheckBox("Singleton Mode");
|
||||
private final FCheckBox cbArtifacts = new FCheckBox("Remove Artifacts");
|
||||
private final FCheckBox cbSingletons = new FCheckBox(localizer.getMessage("cbSingletons"));
|
||||
private final FCheckBox cbArtifacts = new FCheckBox(localizer.getMessage("cbRemoveArtifacts"));
|
||||
private final Deck[] decks = new Deck[MAX_PLAYERS];
|
||||
|
||||
// Variants
|
||||
@@ -146,7 +148,7 @@ public class VLobby implements ILobbyView {
|
||||
}
|
||||
|
||||
variantsPanel.setOpaque(false);
|
||||
variantsPanel.add(newLabel("Variants:"));
|
||||
variantsPanel.add(newLabel(localizer.getMessage("lblVariants")));
|
||||
for (final VariantCheckBox vcb : vntBoxes) {
|
||||
variantsPanel.add(vcb);
|
||||
}
|
||||
@@ -431,7 +433,7 @@ public class VLobby implements ILobbyView {
|
||||
deckChoosers.add(mainChooser);
|
||||
|
||||
// Scheme deck list
|
||||
buildDeckPanel("Scheme Deck", playerIndex, schemeDeckLists, schemeDeckPanels, new ListSelectionListener() {
|
||||
buildDeckPanel(localizer.getMessage("lblSchemeDeck"), playerIndex, schemeDeckLists, schemeDeckPanels, new ListSelectionListener() {
|
||||
@Override public final void valueChanged(final ListSelectionEvent e) {
|
||||
selectSchemeDeck(playerIndex);
|
||||
}
|
||||
@@ -479,14 +481,14 @@ public class VLobby implements ILobbyView {
|
||||
});*/
|
||||
|
||||
// Planar deck list
|
||||
buildDeckPanel("Planar Deck", playerIndex, planarDeckLists, planarDeckPanels, new ListSelectionListener() {
|
||||
buildDeckPanel(localizer.getMessage("lblPlanarDeck"), playerIndex, planarDeckLists, planarDeckPanels, new ListSelectionListener() {
|
||||
@Override public final void valueChanged(final ListSelectionEvent e) {
|
||||
selectPlanarDeck(playerIndex);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Vanguard avatar list
|
||||
buildDeckPanel("Vanguard Avatar", playerIndex, vgdAvatarLists, vgdPanels, new ListSelectionListener() {
|
||||
buildDeckPanel(localizer.getMessage("lblVanguardAvatar"), playerIndex, vgdAvatarLists, vgdPanels, new ListSelectionListener() {
|
||||
@Override public final void valueChanged(final ListSelectionEvent e) {
|
||||
selectVanguardAvatar(playerIndex);
|
||||
}
|
||||
@@ -872,8 +874,8 @@ public class VLobby implements ILobbyView {
|
||||
private static final ImmutableList<String> genderOptions = ImmutableList.of("Male", "Female", "Any"),
|
||||
typeOptions = ImmutableList.of("Fantasy", "Generic", "Any");
|
||||
final String getNewName() {
|
||||
final String title = "Get new random name";
|
||||
final String message = "What type of name do you want to generate?";
|
||||
final String title = localizer.getMessage("lblGetNewRandomName");
|
||||
final String message = localizer.getMessage("lbltypeofName");
|
||||
final SkinImage icon = FOptionPane.QUESTION_ICON;
|
||||
|
||||
final int genderIndex = FOptionPane.showOptionDialog(message, title, icon, genderOptions, 2);
|
||||
@@ -892,8 +894,8 @@ public class VLobby implements ILobbyView {
|
||||
final List<String> usedNames = getPlayerNames();
|
||||
do {
|
||||
newName = NameGenerator.getRandomName(gender, type, usedNames);
|
||||
confirmMsg = "Would you like to use the name \"" + newName + "\", or try again?";
|
||||
} while (!FOptionPane.showConfirmDialog(confirmMsg, title, "Use this name", "Try again", true));
|
||||
confirmMsg = localizer.getMessage("lblconfirmName").replace("%n","\"" +newName + "\"");
|
||||
} while (!FOptionPane.showConfirmDialog(confirmMsg, title, localizer.getMessage("lblUseThisName"), localizer.getMessage("lblTryAgain"), true));
|
||||
|
||||
return newName;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public enum VSubmenuGauntletBuild implements IVSubmenu<CSubmenuGauntletBuild> {
|
||||
.icon(FSkin.getIcon(FSkinProp.ICO_OPEN))
|
||||
.text(" ").hoverable(true).build();
|
||||
|
||||
private VSubmenuGauntletBuild() {
|
||||
VSubmenuGauntletBuild() {
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
|
||||
// File handling panel
|
||||
|
||||
@@ -54,7 +54,7 @@ public enum VSubmenuGauntletContests implements IVSubmenu<CSubmenuGauntletContes
|
||||
private final FLabel lblDesc1 = new FLabel.Builder()
|
||||
.text("A gauntlet that has been started will keep the same deck until it is finished.").build();
|
||||
|
||||
private VSubmenuGauntletContests() {
|
||||
VSubmenuGauntletContests() {
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
|
||||
pnlLoad.setLayout(new MigLayout("insets 0, gap 0, wrap"));
|
||||
|
||||
@@ -43,7 +43,7 @@ public enum VSubmenuGauntletLoad implements IVSubmenu<CSubmenuGauntletLoad> {
|
||||
|
||||
private final StartButton btnStart = new StartButton();
|
||||
|
||||
private VSubmenuGauntletLoad() {
|
||||
VSubmenuGauntletLoad() {
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ public enum VSubmenuGauntletQuick implements IVSubmenu<CSubmenuGauntletQuick> {
|
||||
|
||||
private final StartButton btnStart = new StartButton();
|
||||
|
||||
private VSubmenuGauntletQuick() {
|
||||
VSubmenuGauntletQuick() {
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
|
||||
boxUserDecks.setSelected(true);
|
||||
|
||||
@@ -54,7 +54,6 @@ public enum CSubmenuOnlineLobby implements ICDoc, IMenuProvider {
|
||||
} else {
|
||||
BugReporter.reportException(ex);
|
||||
}
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public enum VSubmenuOnlineLobby implements IVSubmenu<CSubmenuOnlineLobby>, IOnli
|
||||
private final JPanel pnlTitle = new JPanel(new MigLayout());
|
||||
private final StopButton btnStop = new StopButton();
|
||||
|
||||
private VSubmenuOnlineLobby() {
|
||||
VSubmenuOnlineLobby() {
|
||||
}
|
||||
|
||||
public ILobbyView setLobby(final GameLobby lobby) {
|
||||
|
||||
@@ -81,7 +81,7 @@ public enum VSubmenuChallenges implements IVSubmenu<CSubmenuChallenges>, IVQuest
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
private VSubmenuChallenges() {
|
||||
VSubmenuChallenges() {
|
||||
final String constraints = "h 30px!, gap 0 0 0 5px";
|
||||
pnlStats.setLayout(new MigLayout("insets 0, gap 0, wrap, hidemode 3"));
|
||||
pnlStats.add(btnUnlock, "w 150px!, h 30px!, gap 0 0 0 10px");
|
||||
|
||||
@@ -60,7 +60,7 @@ public enum VSubmenuQuestDecks implements IVSubmenu<CSubmenuQuestDecks> {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
private VSubmenuQuestDecks() {
|
||||
VSubmenuQuestDecks() {
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
lstDecks.setCaption("Quest Decks");
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public enum VSubmenuQuestPrefs implements IVSubmenu<CSubmenuQuestPrefs> {
|
||||
DIFFICULTY, /** */
|
||||
BOOSTER, /** */
|
||||
SHOP, /***/
|
||||
DRAFT_TOURNAMENTS;
|
||||
DRAFT_TOURNAMENTS
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,7 @@ import forge.properties.ForgePreferences.FPref;
|
||||
import forge.screens.deckeditor.CDeckEditorUI;
|
||||
import forge.screens.deckeditor.controllers.CEditorDraftingProcess;
|
||||
import forge.toolbox.FOptionPane;
|
||||
import forge.util.Localizer;
|
||||
|
||||
/**
|
||||
* Controls the draft submenu in the home UI.
|
||||
@@ -114,11 +115,12 @@ public enum CSubmenuDraft implements ICDoc {
|
||||
}
|
||||
|
||||
private void startGame(final GameType gameType) {
|
||||
final Localizer localizer = Localizer.getInstance();
|
||||
final boolean gauntlet = !VSubmenuDraft.SINGLETON_INSTANCE.isSingleSelected();
|
||||
final DeckProxy humanDeck = VSubmenuDraft.SINGLETON_INSTANCE.getLstDecks().getSelectedItem();
|
||||
|
||||
if (humanDeck == null) {
|
||||
FOptionPane.showErrorDialog("No deck selected for human.\n(You may need to build a new deck)", "No Deck");
|
||||
FOptionPane.showErrorDialog(localizer.getMessage("lblNoDeckSelected"), localizer.getMessage("lblNoDeck"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -179,8 +181,9 @@ public enum CSubmenuDraft implements ICDoc {
|
||||
|
||||
/** */
|
||||
private void setupDraft() {
|
||||
final Localizer localizer = Localizer.getInstance();
|
||||
// Determine what kind of booster draft to run
|
||||
final LimitedPoolType poolType = GuiChoose.oneOrNone("Choose Draft Format", LimitedPoolType.values());
|
||||
final LimitedPoolType poolType = GuiChoose.oneOrNone(localizer.getMessage("lblChooseDraftFormat"), LimitedPoolType.values());
|
||||
if (poolType == null) { return; }
|
||||
|
||||
final BoosterDraft draft = BoosterDraft.createDraft(poolType);
|
||||
|
||||
@@ -34,7 +34,7 @@ public enum VSubmenuConstructed implements IVSubmenu<CSubmenuConstructed> {
|
||||
private final DragTab tab = new DragTab(localizer.getMessage("lblConstructedMode"));
|
||||
private final GameLobby lobby = new LocalLobby();
|
||||
private final VLobby vLobby = new VLobby(lobby);
|
||||
private VSubmenuConstructed() {
|
||||
VSubmenuConstructed() {
|
||||
lobby.setListener(vLobby);
|
||||
|
||||
vLobby.setPlayerChangeListener(new IPlayerChangeListener() {
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.awt.Font;
|
||||
import javax.swing.*;
|
||||
|
||||
import forge.toolbox.*;
|
||||
import forge.util.Localizer;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import forge.game.GameType;
|
||||
import forge.gui.framework.DragCell;
|
||||
@@ -28,50 +29,51 @@ import forge.screens.home.VHomeUI.PnlDisplay;
|
||||
public enum VSubmenuDraft implements IVSubmenu<CSubmenuDraft> {
|
||||
/** */
|
||||
SINGLETON_INSTANCE;
|
||||
|
||||
final Localizer localizer = Localizer.getInstance();
|
||||
// Fields used with interface IVDoc
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Booster Draft");
|
||||
|
||||
private final DragTab tab = new DragTab(localizer.getMessage("lblBoosterDraft"));
|
||||
|
||||
/** */
|
||||
private final LblHeader lblTitle = new LblHeader("Sanctioned Format: Booster Draft");
|
||||
private final LblHeader lblTitle = new LblHeader(localizer.getMessage("lblHeaderBoosterDraft"));
|
||||
|
||||
private final JPanel pnlStart = new JPanel();
|
||||
private final StartButton btnStart = new StartButton();
|
||||
|
||||
private final DeckManager lstDecks = new DeckManager(GameType.Draft, CDeckEditorUI.SINGLETON_INSTANCE.getCDetailPicture());
|
||||
|
||||
private final JRadioButton radSingle = new FRadioButton("Play an opponent");
|
||||
private final JRadioButton radAll = new FRadioButton("Play all 7 opponents");
|
||||
private final JRadioButton radSingle = new FRadioButton(localizer.getMessage("lblPlayAnOpponent"));
|
||||
private final JRadioButton radAll = new FRadioButton(localizer.getMessage("lblPlayAll7opponents"));
|
||||
|
||||
private final JComboBox<String> cbOpponent = new JComboBox<String>();
|
||||
|
||||
private final JLabel lblInfo = new FLabel.Builder()
|
||||
.fontAlign(SwingConstants.LEFT).fontSize(16).fontStyle(Font.BOLD)
|
||||
.text("Build or select a deck").build();
|
||||
.text(localizer.getMessage("lblBuildorselectadeck")).build();
|
||||
|
||||
private final FLabel lblDir1 = new FLabel.Builder()
|
||||
.text("In Draft mode, three booster packs are rotated around eight players.")
|
||||
.text(localizer.getMessage("lblDraftText1"))
|
||||
.fontSize(12).build();
|
||||
|
||||
private final FLabel lblDir2 = new FLabel.Builder()
|
||||
.text("Build a deck from the cards you choose. The AI will do the same.")
|
||||
.text(localizer.getMessage("lblDraftText2"))
|
||||
.fontSize(12).build();
|
||||
|
||||
private final FLabel lblDir3 = new FLabel.Builder()
|
||||
.text("Then, play against one or all of the AI opponents.")
|
||||
.text(localizer.getMessage("lblDraftText3"))
|
||||
.fontSize(12).build();
|
||||
|
||||
private final FLabel btnBuildDeck = new FLabel.ButtonBuilder().text("New Booster Draft Game").fontSize(16).build();
|
||||
private final FLabel btnBuildDeck = new FLabel.ButtonBuilder().text(localizer.getMessage("lblNewBoosterDraftGame")).fontSize(16).build();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
private VSubmenuDraft() {
|
||||
VSubmenuDraft() {
|
||||
btnStart.setEnabled(false);
|
||||
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
lstDecks.setCaption("Draft Decks");
|
||||
lstDecks.setCaption(localizer.getMessage("lblDraftDecks"));
|
||||
|
||||
final JXButtonPanel grpPanel = new JXButtonPanel();
|
||||
grpPanel.add(radSingle, "w 200px!, h 30px!");
|
||||
@@ -98,7 +100,7 @@ public enum VSubmenuDraft implements IVSubmenu<CSubmenuDraft> {
|
||||
*/
|
||||
@Override
|
||||
public String getMenuTitle() {
|
||||
return "Booster Draft";
|
||||
return localizer.getMessage("lblBoosterDraft");
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
||||
@@ -12,6 +12,7 @@ import javax.swing.text.StyleConstants;
|
||||
import javax.swing.text.StyledDocument;
|
||||
|
||||
import forge.toolbox.*;
|
||||
import forge.util.Localizer;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import forge.assets.FSkinProp;
|
||||
import forge.game.GameType;
|
||||
@@ -38,40 +39,41 @@ import forge.toolbox.FSkin.SkinnedTextPane;
|
||||
public enum VSubmenuSealed implements IVSubmenu<CSubmenuSealed> {
|
||||
/** */
|
||||
SINGLETON_INSTANCE;
|
||||
final Localizer localizer = Localizer.getInstance();
|
||||
|
||||
// Fields used with interface IVDoc
|
||||
private DragCell parentCell;
|
||||
private final DragTab tab = new DragTab("Sealed Deck");
|
||||
private final DragTab tab = new DragTab(localizer.getMessage("lblSealedDeck"));
|
||||
|
||||
/** */
|
||||
private final LblHeader lblTitle = new LblHeader("Sanctioned Format: Sealed Deck");
|
||||
private final LblHeader lblTitle = new LblHeader(localizer.getMessage("lblHeaderSealed"));
|
||||
|
||||
private final JPanel pnlStart = new JPanel();
|
||||
private final StartButton btnStart = new StartButton();
|
||||
private final DeckManager lstDecks = new DeckManager(GameType.Sealed, CDeckEditorUI.SINGLETON_INSTANCE.getCDetailPicture());
|
||||
|
||||
private final JRadioButton radSingle = new FRadioButton("Play an opponent");
|
||||
private final JRadioButton radAll = new FRadioButton("Play all 7 opponents");
|
||||
private final JRadioButton radSingle = new FRadioButton(localizer.getMessage("lblPlayAnOpponent"));
|
||||
private final JRadioButton radAll = new FRadioButton(localizer.getMessage("lblPlayAll7opponents"));
|
||||
|
||||
private final JComboBox<String> cbOpponent = new JComboBox<String>();
|
||||
|
||||
private final FLabel lblInfo = new FLabel.Builder()
|
||||
.fontAlign(SwingConstants.LEFT).fontSize(16).fontStyle(Font.BOLD)
|
||||
.text("Select a game, or build a new one").build();
|
||||
.text(localizer.getMessage("lblSealedText1")).build();
|
||||
|
||||
private final FLabel lblDir1 = new FLabel.Builder()
|
||||
.text("In Sealed mode, you build a deck from booster packs (maximum 10).")
|
||||
.text(localizer.getMessage("lblSealedText2"))
|
||||
.fontSize(12).build();
|
||||
|
||||
private final FLabel lblDir2 = new FLabel.Builder()
|
||||
.text("Build a deck from the cards you receive. A number of AI opponents will do the same.")
|
||||
.text(localizer.getMessage("lblSealedText3"))
|
||||
.fontSize(12).build();
|
||||
|
||||
private final FLabel lblDir3 = new FLabel.Builder()
|
||||
.text("Then, you may play against each of the AI opponents, or one of the opponents.")
|
||||
.text(localizer.getMessage("lblSealedText4"))
|
||||
.fontSize(12).build();
|
||||
|
||||
private final FLabel btnBuildDeck = new FLabel.ButtonBuilder().text("Build New Sealed Deck").fontSize(16).build();
|
||||
private final FLabel btnBuildDeck = new FLabel.ButtonBuilder().text(localizer.getMessage("btnBuildNewSealedDeck")).fontSize(16).build();
|
||||
|
||||
private final FLabel btnDirections = new FLabel.Builder()
|
||||
.fontSize(16).opaque(true).hoverable(true)
|
||||
@@ -80,11 +82,11 @@ public enum VSubmenuSealed implements IVSubmenu<CSubmenuSealed> {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
private VSubmenuSealed() {
|
||||
VSubmenuSealed() {
|
||||
btnStart.setEnabled(false);
|
||||
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
lstDecks.setCaption("Sealed Decks");
|
||||
lstDecks.setCaption(localizer.getMessage("lblSealedDecks"));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -135,7 +137,7 @@ public enum VSubmenuSealed implements IVSubmenu<CSubmenuSealed> {
|
||||
*/
|
||||
@Override
|
||||
public String getMenuTitle() {
|
||||
return "Sealed Deck";
|
||||
return localizer.getMessage("lblSealedDeck");
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
||||
@@ -70,7 +70,7 @@ public enum VSubmenuWinston implements IVSubmenu<CSubmenuWinston> {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
private VSubmenuWinston() {
|
||||
VSubmenuWinston() {
|
||||
lstAI.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
btnStart.setEnabled(false);
|
||||
|
||||
|
||||
@@ -233,6 +233,8 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
initializeCounterDisplayLocationComboBox();
|
||||
initializeGraveyardOrderingComboBox();
|
||||
initializePlayerNameButton();
|
||||
initializeDefaultLanguageComboBox();
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -352,6 +354,15 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
panel.setComboBox(comboBox, Singletons.getControl().getCloseAction());
|
||||
}
|
||||
|
||||
private void initializeDefaultLanguageComboBox() {
|
||||
|
||||
final String [] choices = {"en-US", "es-ES", "de-DE"};
|
||||
final FPref userSetting = FPref.UI_LANGUAGE;
|
||||
final FComboBoxPanel<String> panel = this.view.getCbpDefaultLanguageComboBoxPanel();
|
||||
final FComboBox<String> comboBox = createComboBox(choices, userSetting);
|
||||
final String selectedItem = this.prefs.getPref(userSetting);
|
||||
panel.setComboBox(comboBox, selectedItem);
|
||||
}
|
||||
private void initializeDefaultFontSizeComboBox() {
|
||||
final String [] choices = {"10", "11", "12", "13", "14", "15", "16", "17", "18"};
|
||||
final FPref userSetting = FPref.UI_DEFAULT_FONT_SIZE;
|
||||
|
||||
@@ -68,7 +68,7 @@ public enum VSubmenuAchievements implements IVSubmenu<CSubmenuAchievements> {
|
||||
private final FScrollPane scroller = new FScrollPane(trophyCase, false,
|
||||
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
|
||||
private VSubmenuAchievements() {
|
||||
VSubmenuAchievements() {
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
|
||||
trophyCase.setMinimumSize(new Dimension(FSkinProp.IMG_TROPHY_SHELF.getWidth(), 0));
|
||||
|
||||
@@ -38,7 +38,7 @@ public enum VSubmenuAvatars implements IVSubmenu<CSubmenuAvatars> {
|
||||
private final FLabel lblAvatarAI = new FLabel.Builder().hoverable(true).selectable(true)
|
||||
.iconScaleFactor(0.99f).iconInBackground(true).build();
|
||||
|
||||
private VSubmenuAvatars() {
|
||||
VSubmenuAvatars() {
|
||||
populateAvatars();
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
* Constructor.
|
||||
*/
|
||||
VSubmenuDownloaders() {
|
||||
final Localizer localizer = Localizer.getInstance();
|
||||
|
||||
final String constraintsLBL = "w 90%!, h 20px!, center, gap 0 0 3px 8px";
|
||||
final String constraintsBTN = "h 30px!, w 50%!, center";
|
||||
@@ -106,7 +107,7 @@ public enum VSubmenuDownloaders implements IVSubmenu<CSubmenuDownloaders> {
|
||||
pnlContent.add(label, "w 90%!, h 25px!, center, gap 0 0 0 36px");
|
||||
|
||||
}
|
||||
|
||||
|
||||
pnlContent.add(btnListImageData, constraintsBTN);
|
||||
pnlContent.add(_makeLabel(localizer.getMessage("lblListImageData")), constraintsLBL);
|
||||
|
||||
|
||||
@@ -119,6 +119,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
private final FComboBoxPanel<String> cbpCounterDisplayType = new FComboBoxPanel<>(localizer.getMessage("cbpCounterDisplayType")+":");
|
||||
private final FComboBoxPanel<String> cbpCounterDisplayLocation =new FComboBoxPanel<>(localizer.getMessage("cbpCounterDisplayLocation")+":");
|
||||
private final FComboBoxPanel<String> cbpGraveyardOrdering = new FComboBoxPanel<>(localizer.getMessage("cbpGraveyardOrdering")+":");
|
||||
private final FComboBoxPanel<String> cbpDefaultLanguage = new FComboBoxPanel<>(localizer.getMessage("cbpSelectLanguage")+":");
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -152,6 +153,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
// General Configuration
|
||||
pnlPrefs.add(new SectionLabel(localizer.getMessage("GeneralConfiguration")), sectionConstraints);
|
||||
|
||||
// language
|
||||
pnlPrefs.add(cbpDefaultLanguage, comboBoxConstraints);
|
||||
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlSelectLanguage")), descriptionConstraints);
|
||||
|
||||
pnlPrefs.add(getPlayerNamePanel(), titleConstraints + ", h 26px!");
|
||||
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlPlayerName")), descriptionConstraints);
|
||||
|
||||
@@ -648,6 +653,11 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
return cbpDefaultFontSize;
|
||||
}
|
||||
|
||||
public FComboBoxPanel<String> getCbpDefaultLanguageComboBoxPanel() {
|
||||
return cbpDefaultLanguage;
|
||||
}
|
||||
|
||||
|
||||
public FComboBoxPanel<String> getAutoYieldModeComboBoxPanel() {
|
||||
return cbpAutoYieldMode;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public final class CMatchUI
|
||||
this.myDocs.put(EDocID.REPORT_COMBAT, cCombat.getView());
|
||||
this.myDocs.put(EDocID.REPORT_LOG, cLog.getView());
|
||||
this.myDocs.put(EDocID.DEV_MODE, getCDev().getView());
|
||||
this.myDocs.put(EDocID.BUTTON_DOCK, getCDock().getView());;
|
||||
this.myDocs.put(EDocID.BUTTON_DOCK, getCDock().getView());
|
||||
}
|
||||
|
||||
private void registerDocs() {
|
||||
@@ -703,7 +703,7 @@ public final class CMatchUI
|
||||
FThreads.invokeInEdtNowOrLater(focusRoutine);
|
||||
} else {
|
||||
FThreads.invokeInEdtAndWait(focusRoutine);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -196,7 +196,7 @@ public final class CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void exileCardsFromHand() {
|
||||
getController().cheat().exileCardsFromHand();;
|
||||
getController().cheat().exileCardsFromHand();
|
||||
}
|
||||
|
||||
private final MouseListener madAddCounter = new MouseAdapter() {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class CDock implements ICDoc {
|
||||
this.view = new VDock(this);
|
||||
}
|
||||
|
||||
public enum ArcState { OFF, MOUSEOVER, ON; }
|
||||
public enum ArcState { OFF, MOUSEOVER, ON}
|
||||
|
||||
public VDock getView() {
|
||||
return view;
|
||||
@@ -108,7 +108,7 @@ public class CDock implements ICDoc {
|
||||
|
||||
public void setArcState(final ArcState state) {
|
||||
arcState = state;
|
||||
while (arcStateIterator.next() != arcState) { /* Put the iterator to the correct value */ };
|
||||
while (arcStateIterator.next() != arcState) { /* Put the iterator to the correct value */ }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -62,7 +62,7 @@ public final class CardOverlaysMenu {
|
||||
toggleShowOverlaySetting();
|
||||
repaintCardOverlays();
|
||||
// Enable/disable overlay menu items based on state of "Show" menu.
|
||||
for (Component c : ((JPopupMenu)showMenu.getParent()).getComponents()) {
|
||||
for (Component c : showMenu.getParent().getComponents()) {
|
||||
if (c instanceof JMenuItem) {
|
||||
JMenuItem m = (JMenuItem)c;
|
||||
if (m != showMenu) {
|
||||
|
||||
@@ -24,7 +24,7 @@ public class DevModeMenu implements ActionListener, IDevListener {
|
||||
public DevModeMenu(final CDev controller) {
|
||||
this.controller = controller;
|
||||
controller.addListener(this);
|
||||
};
|
||||
}
|
||||
|
||||
// Using an enum to avoid having to create multiple
|
||||
// ActionListeners each calling a single method.
|
||||
@@ -49,7 +49,7 @@ public class DevModeMenu implements ActionListener, IDevListener {
|
||||
DEV_CORNER("Developer's Corner");
|
||||
|
||||
protected String caption;
|
||||
private DevMenuItem(final String value) {
|
||||
DevMenuItem(final String value) {
|
||||
this.caption = value;
|
||||
}
|
||||
protected static DevMenuItem getValue(final String s) {
|
||||
@@ -60,7 +60,7 @@ public class DevModeMenu implements ActionListener, IDevListener {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(final boolean playUnlimitedLands, final boolean mayViewAllCards) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public enum CWorkshopUI implements ICDoc, IMenuProvider {
|
||||
/** */
|
||||
SINGLETON_INSTANCE;
|
||||
|
||||
private CWorkshopUI() {
|
||||
CWorkshopUI() {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
||||
@@ -13,7 +13,7 @@ public enum CCardDesigner implements ICDoc {
|
||||
/** */
|
||||
SINGLETON_INSTANCE;
|
||||
|
||||
private CCardDesigner() {
|
||||
CCardDesigner() {
|
||||
VCardDesigner.SINGLETON_INSTANCE.getBtnSaveCard().setCommand(new Runnable() {
|
||||
@Override public final void run() {
|
||||
CCardScript.SINGLETON_INSTANCE.saveChanges();
|
||||
|
||||
@@ -46,7 +46,7 @@ public enum CCardScript implements ICDoc {
|
||||
private boolean switchInProgress;
|
||||
private boolean refreshing;
|
||||
|
||||
private CCardScript() {
|
||||
CCardScript() {
|
||||
VCardScript.SINGLETON_INSTANCE.getTxtScript().getDocument().addDocumentListener(new DocumentListener() {
|
||||
@Override
|
||||
public void removeUpdate(final DocumentEvent arg0) {
|
||||
@@ -103,7 +103,7 @@ public enum CCardScript implements ICDoc {
|
||||
refreshing = true;
|
||||
final JTextPane txtScript = VCardScript.SINGLETON_INSTANCE.getTxtScript();
|
||||
txtScript.setText(currentScriptInfo != null ? currentScriptInfo.getText() : "");
|
||||
txtScript.setEditable(currentScriptInfo != null ? currentScriptInfo.canEdit() : false);
|
||||
txtScript.setEditable(currentScriptInfo != null && currentScriptInfo.canEdit());
|
||||
txtScript.setCaretPosition(0); //keep scrolled to top
|
||||
|
||||
final StyledDocument doc = VCardScript.SINGLETON_INSTANCE.getDoc();
|
||||
|
||||
@@ -14,7 +14,7 @@ public enum CWorkshopCatalog implements ICDoc {
|
||||
/** */
|
||||
SINGLETON_INSTANCE;
|
||||
|
||||
private CWorkshopCatalog() {
|
||||
CWorkshopCatalog() {
|
||||
}
|
||||
|
||||
//========== Overridden methods
|
||||
|
||||
@@ -34,7 +34,7 @@ public enum VCardDesigner implements IVDoc<CCardDesigner> {
|
||||
.build();
|
||||
|
||||
//========== Constructor
|
||||
private VCardDesigner() {
|
||||
VCardDesigner() {
|
||||
}
|
||||
|
||||
public FLabel getBtnSaveCard() {
|
||||
|
||||
@@ -35,7 +35,7 @@ public enum VCardScript implements IVDoc<CCardScript> {
|
||||
private final Style error;
|
||||
|
||||
//========== Constructor
|
||||
private VCardScript() {
|
||||
VCardScript() {
|
||||
txtScript.setEditable(true);
|
||||
txtScript.setFocusable(true);
|
||||
doc = new DefaultStyledDocument();
|
||||
|
||||
@@ -36,7 +36,7 @@ public enum VWorkshopCatalog implements IVDoc<CWorkshopCatalog> {
|
||||
private final CDetailPicture cDetailPicture = new CDetailPicture();
|
||||
|
||||
//========== Constructor
|
||||
private VWorkshopCatalog() {
|
||||
VWorkshopCatalog() {
|
||||
this.cardManager = new CardManager(cDetailPicture, true, false);
|
||||
this.cardManager.setCaption("Catalog");
|
||||
final Iterable<PaperCard> allCards = Iterables.concat(FModel.getMagicDb().getCommonCards(), FModel.getMagicDb().getVariantCards());
|
||||
|
||||
@@ -36,7 +36,7 @@ public enum FAbsolutePositioner {
|
||||
|
||||
private final JPanel panel = new JPanel();
|
||||
|
||||
private FAbsolutePositioner() {
|
||||
FAbsolutePositioner() {
|
||||
panel.setOpaque(false);
|
||||
panel.setLayout(null);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class FComboBox<E> extends SkinnedComboBox<E> implements IComboBox<E> {
|
||||
RIGHT (SwingConstants.RIGHT),
|
||||
CENTER (SwingConstants.CENTER);
|
||||
private int value;
|
||||
private TextAlignment(final int value) { this.value = value; }
|
||||
TextAlignment(final int value) { this.value = value; }
|
||||
public int getInt() { return value; }
|
||||
}
|
||||
private TextAlignment textAlignment = TextAlignment.LEFT;
|
||||
|
||||
@@ -104,7 +104,7 @@ public class FOptionPane extends FDialog {
|
||||
FTextField txtInput = null;
|
||||
FComboBox<T> cbInput = null;
|
||||
if (inputOptions == null) {
|
||||
txtInput = new FTextField.Builder().text(initialInput.toString()).build();
|
||||
txtInput = new FTextField.Builder().text(initialInput).build();
|
||||
inputField = txtInput;
|
||||
} else {
|
||||
cbInput = new FComboBox<T>(inputOptions);
|
||||
|
||||
@@ -47,7 +47,7 @@ public enum FOverlay {
|
||||
/**
|
||||
* Semi-transparent overlay panel. Should be used with layered panes.
|
||||
*/
|
||||
private FOverlay() {
|
||||
FOverlay() {
|
||||
pnl.setOpaque(false);
|
||||
pnl.setVisible(false);
|
||||
pnl.setFocusCycleRoot(true);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package forge.toolbox;
|
||||
|
||||
public interface IDisposable {
|
||||
public void dispose();
|
||||
void dispose();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,8 @@ import java.awt.image.BufferedImage;
|
||||
public class FImagePanel extends JPanel {
|
||||
|
||||
// See {@code setAutosizeMode} for descriptions.
|
||||
public enum AutoSizeImageMode {OFF, PANEL, SOURCE};
|
||||
public enum AutoSizeImageMode {OFF, PANEL, SOURCE}
|
||||
|
||||
AutoSizeImageMode autoSizeMode = AutoSizeImageMode.PANEL;
|
||||
|
||||
// The original unscaled, unrotated image.
|
||||
@@ -66,7 +67,7 @@ public class FImagePanel extends JPanel {
|
||||
public FImagePanel() {
|
||||
setOpaque(false);
|
||||
setResizeListener();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* This timer is used to identify when resizing has finished.
|
||||
@@ -326,7 +327,7 @@ public class FImagePanel extends JPanel {
|
||||
if (newScale != this.imageScale) {
|
||||
isResampleEnabled = true;
|
||||
this.imageScale = newScale;
|
||||
if (newScale == 0) { this.imageScale = 1; };
|
||||
if (newScale == 0) { this.imageScale = 1; }
|
||||
if (this.autoSizeMode == AutoSizeImageMode.SOURCE && newScale > 1) {
|
||||
this.imageScale = 1;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public final class FImageUtil {
|
||||
*/
|
||||
public static int getRotationToNearest(int requestedRotation, int nearestRotation) {
|
||||
// Ensure requested rotation falls within -360..0..360 degree range first.
|
||||
requestedRotation = requestedRotation - (360 * (requestedRotation / (int)360));
|
||||
requestedRotation = requestedRotation - (360 * (requestedRotation / 360));
|
||||
return (int)(Math.rint((double) requestedRotation / nearestRotation) * nearestRotation);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public enum CardZoomer {
|
||||
private boolean isMouseWheelEnabled = false;
|
||||
|
||||
// ctr
|
||||
private CardZoomer() {
|
||||
CardZoomer() {
|
||||
lblFlipcard.setIcon(FSkin.getIcon(FSkinProp.ICO_FLIPCARD));
|
||||
setMouseButtonListener();
|
||||
setMouseWheelListener();
|
||||
@@ -81,7 +81,7 @@ public enum CardZoomer {
|
||||
public void setCard(final CardStateView card, final boolean mayFlip) {
|
||||
this.thisCard = card;
|
||||
this.mayFlip = mayFlip;
|
||||
this.isInAltState = card == null ? false : card == card.getCard().getAlternateState();
|
||||
this.isInAltState = card != null && card == card.getCard().getAlternateState();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,11 +36,7 @@ public class PhaseLabel extends JLabel {
|
||||
this.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mousePressed(final MouseEvent e) {
|
||||
if (PhaseLabel.this.enabled) {
|
||||
PhaseLabel.this.enabled = false;
|
||||
} else {
|
||||
PhaseLabel.this.enabled = true;
|
||||
}
|
||||
PhaseLabel.this.enabled = !PhaseLabel.this.enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -65,7 +65,7 @@ public enum FView {
|
||||
// Tab overflow is for the +X display for extra tabs.
|
||||
private final JPanel pnlTabOverflow = new JPanel(new MigLayout("insets 0, gap 0, wrap"));
|
||||
|
||||
private FView() {
|
||||
FView() {
|
||||
frmSplash = new SplashFrame();
|
||||
frmDocument.setTitle("Forge: " + BuildInfo.getVersionString());
|
||||
JOptionPane.setRootFrame(frmDocument);
|
||||
|
||||
@@ -282,13 +282,13 @@ public class SimulateMatch {
|
||||
System.out.println(TextUtil.concatNoSpace("End Round - ", String.valueOf(curRound)));
|
||||
}
|
||||
curRound = tourney.getActiveRound();
|
||||
System.out.println("");
|
||||
System.out.println();
|
||||
System.out.println(TextUtil.concatNoSpace("Round ", String.valueOf(curRound) ," Pairings:"));
|
||||
|
||||
for(TournamentPairing pairing : tourney.getActivePairings()) {
|
||||
System.out.println(pairing.outputHeader());
|
||||
}
|
||||
System.out.println("");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
TournamentPairing pairing = tourney.getNextPairing();
|
||||
@@ -327,7 +327,7 @@ public class SimulateMatch {
|
||||
pairing.setWinner(tp);
|
||||
lastWinner = winner.getName();
|
||||
System.out.println(TextUtil.concatNoSpace("Match Winner - ", lastWinner, "!"));
|
||||
System.out.println("");
|
||||
System.out.println();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public class TimeLimitedCodeBlock {
|
||||
public static void runWithTimeout(final Runnable runnable, long timeout, TimeUnit timeUnit) throws Exception {
|
||||
runWithTimeout(new Callable<Object>() {
|
||||
@Override
|
||||
public Object call() throws Exception {
|
||||
public Object call() {
|
||||
runnable.run();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ public abstract class CardPanelContainer extends SkinnedPanel {
|
||||
}
|
||||
}
|
||||
|
||||
public static interface LayoutEventListener {
|
||||
public interface LayoutEventListener {
|
||||
void doingLayout();
|
||||
}
|
||||
|
||||
|
||||
@@ -151,8 +151,7 @@ public class ListCardArea extends FloatingCardArea {
|
||||
for(int i=index+1-(oldIndex>index?1:0); i<cardList.size(); i++) {
|
||||
if (!moveableCards.contains(cardList.get(i))) { bottomMove=false; break; }
|
||||
}
|
||||
if (toBottom && bottomMove) { return true; }
|
||||
return false;
|
||||
return toBottom && bottomMove;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -722,7 +722,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
return needLayoutRefresh;
|
||||
}
|
||||
|
||||
private static enum RowType {
|
||||
private enum RowType {
|
||||
Land,
|
||||
Creature,
|
||||
CreatureNonToken,
|
||||
|
||||
@@ -14,12 +14,10 @@ public class BoosterDraft1Test {
|
||||
|
||||
/**
|
||||
* Booster draft_1 test1.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*
|
||||
*/
|
||||
@Test(groups = { "UnitTest", "fast" }, timeOut = 1000, enabled = false)
|
||||
public void boosterDraft1Test1() throws Exception {
|
||||
public void boosterDraft1Test1() {
|
||||
final BoosterDraft draft = BoosterDraft.createDraft(LimitedPoolType.Full);
|
||||
if (draft == null) { return; }
|
||||
|
||||
|
||||
@@ -18,13 +18,9 @@ public class ActionPreCondition {
|
||||
throw new IllegalStateException( "Mock action " + this + " can only trigger during turn " + requiredTurn + " but it is already turn " + game.getPhaseHandler().getTurn() );
|
||||
}
|
||||
}
|
||||
|
||||
if( requiredPhaseType != null && requiredPhaseType != game.getPhaseHandler().getPhase() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return requiredPhaseType == null || requiredPhaseType == game.getPhaseHandler().getPhase();
|
||||
}
|
||||
|
||||
public ActionPreCondition turn( int turn ) {
|
||||
requiredTurn = turn;
|
||||
|
||||
@@ -10,7 +10,7 @@ public class DeclareBlockersAction extends BasePlayerAction {
|
||||
|
||||
public DeclareBlockersAction( PlayerSpecification player ) {
|
||||
super( player );
|
||||
blockingAssignments = ArrayListMultimap.<CardSpecification, CardSpecification>create();
|
||||
blockingAssignments = ArrayListMultimap.create();
|
||||
}
|
||||
|
||||
public DeclareBlockersAction block( CardSpecification attacker, CardSpecification blocker ) {
|
||||
|
||||
@@ -19,12 +19,10 @@ import java.io.IOException;
|
||||
public class FModelTest {
|
||||
/**
|
||||
* Set up before each test, creating a default model.
|
||||
*
|
||||
* @throws FileNotFoundException
|
||||
* indirectly
|
||||
*
|
||||
*/
|
||||
@BeforeTest
|
||||
public final void setUp() throws FileNotFoundException {
|
||||
public final void setUp() {
|
||||
// this.model = new FModel();
|
||||
}
|
||||
|
||||
@@ -61,12 +59,10 @@ public class FModelTest {
|
||||
|
||||
/**
|
||||
* Test getVersion.
|
||||
*
|
||||
* @throws FileNotFoundException
|
||||
* if something is really wrong
|
||||
*
|
||||
*/
|
||||
@Test(enabled = false)
|
||||
public final void test_getVersion() throws FileNotFoundException {
|
||||
public final void test_getVersion() {
|
||||
final String version = BuildInfo.getVersionString();
|
||||
|
||||
Assert.assertEquals(version, "GIT", "version is default");
|
||||
@@ -74,12 +70,10 @@ public class FModelTest {
|
||||
|
||||
/**
|
||||
* Test getPreferences.
|
||||
*
|
||||
* @throws FileNotFoundException
|
||||
* indirectly
|
||||
*
|
||||
*/
|
||||
@Test(enabled = false)
|
||||
public final void test_getPreferences() throws FileNotFoundException {
|
||||
public final void test_getPreferences() {
|
||||
final ForgePreferences prefs = FModel.getPreferences();
|
||||
Assert.assertNotNull(prefs, "prefs instance is not null");
|
||||
}
|
||||
|
||||
@@ -218,13 +218,13 @@ public class PlanarConquestGeneraterGA extends AbstractGeneticAlgorithm<Deck> {
|
||||
System.out.println(TextUtil.concatNoSpace("End Round - ", String.valueOf(curRound)));
|
||||
}
|
||||
curRound = tourney.getActiveRound();
|
||||
System.out.println("");
|
||||
System.out.println();
|
||||
System.out.println(TextUtil.concatNoSpace("Round ", String.valueOf(curRound) ," Pairings:"));
|
||||
|
||||
for(TournamentPairing pairing : tourney.getActivePairings()) {
|
||||
System.out.println(pairing.outputHeader());
|
||||
}
|
||||
System.out.println("");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
TournamentPairing pairing = tourney.getNextPairing();
|
||||
|
||||
Reference in New Issue
Block a user