From a64e31e6975514d0a147e5f062e84cccd8816c0f Mon Sep 17 00:00:00 2001 From: Ingmar Goudt Date: Tue, 26 Feb 2019 09:19:46 +0100 Subject: [PATCH] sonar fixed 25022019 --- .../client/deckeditor/DeckEditorPanel.java | 43 +++++----- .../collection/viewer/MageBook.java | 10 +-- .../mage/client/dialog/PreferencesDialog.java | 2 +- .../main/java/mage/client/game/GamePanel.java | 10 ++- .../java/mage/client/game/HelperPanel.java | 57 ++++++------- .../java/mage/client/game/PlayAreaPanel.java | 4 + .../plugins/adapters/MageActionCallback.java | 61 +++++++------- .../mage/client/plugins/impl/Plugins.java | 4 - .../client/remote/CallbackClientImpl.java | 82 ++++++++++--------- .../mage/client/table/MatchesTableModel.java | 3 +- .../mage/client/table/PlayersChatPanel.java | 3 +- .../java/mage/client/table/TableInfo.java | 3 - 12 files changed, 145 insertions(+), 137 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java b/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java index 4bb6aefe8a..88b3cc0d95 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java @@ -1,14 +1,5 @@ package mage.client.deckeditor; -import java.awt.*; -import java.awt.event.*; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.*; -import java.util.concurrent.*; -import javax.swing.*; -import javax.swing.filechooser.FileFilter; import mage.cards.Card; import mage.cards.Sets; import mage.cards.decks.Deck; @@ -36,6 +27,16 @@ import mage.view.CardView; import mage.view.SimpleCardView; import org.apache.log4j.Logger; +import javax.swing.*; +import javax.swing.filechooser.FileFilter; +import java.awt.*; +import java.awt.event.*; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.*; +import java.util.concurrent.*; + /** * @author BetaSteward_at_googlemail.com */ @@ -53,6 +54,7 @@ public class DeckEditorPanel extends javax.swing.JPanel { private javax.swing.Timer countdown; private UpdateDeckTask updateDeckTask; private int timeToSubmit = -1; + private final String LAST_DECK_FOLDER = "lastDeckFolder"; /** * Creates new form DeckEditorPanel @@ -152,7 +154,7 @@ public class DeckEditorPanel extends javax.swing.JPanel { case LIMITED_BUILDING: this.btnAddLand.setVisible(true); this.txtTimeRemaining.setVisible(true); - // Fall through to sideboarding + // Fall through to sideboarding case SIDEBOARDING: this.btnSubmit.setVisible(true); this.btnSubmitTimer.setVisible(true); @@ -664,6 +666,8 @@ public class DeckEditorPanel extends javax.swing.JPanel { case 2: btnImportFromClipboardActionWAppendPerformed(evt); break; + default: + break; } }); @@ -848,7 +852,7 @@ public class DeckEditorPanel extends javax.swing.JPanel { private void btnLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLoadActionPerformed //fcSelectDeck.setCurrentDirectory(new File()); - String lastFolder = MageFrame.getPreferences().get("lastDeckFolder", ""); + String lastFolder = MageFrame.getPreferences().get(LAST_DECK_FOLDER, ""); if (!lastFolder.isEmpty()) { fcSelectDeck.setCurrentDirectory(new File(lastFolder)); } @@ -887,7 +891,7 @@ public class DeckEditorPanel extends javax.swing.JPanel { // save last deck history try { - MageFrame.getPreferences().put("lastDeckFolder", file.getCanonicalPath()); + MageFrame.getPreferences().put(LAST_DECK_FOLDER, file.getCanonicalPath()); } catch (IOException ex) { logger.error("Error on save last load deck folder: " + ex.getMessage()); } @@ -902,7 +906,7 @@ public class DeckEditorPanel extends javax.swing.JPanel { }//GEN-LAST:event_btnLoadActionPerformed private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed - String lastFolder = MageFrame.getPreferences().get("lastDeckFolder", ""); + String lastFolder = MageFrame.getPreferences().get(LAST_DECK_FOLDER, ""); if (!lastFolder.isEmpty()) { fcSelectDeck.setCurrentDirectory(new File(lastFolder)); } @@ -942,7 +946,7 @@ public class DeckEditorPanel extends javax.swing.JPanel { MageFrame.getDesktop().setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } try { - MageFrame.getPreferences().put("lastDeckFolder", file.getCanonicalPath()); + MageFrame.getPreferences().put(LAST_DECK_FOLDER, file.getCanonicalPath()); } catch (IOException ex) { ex.printStackTrace(); } @@ -1057,6 +1061,7 @@ public class DeckEditorPanel extends javax.swing.JPanel { } refreshDeck(); } + // Variables declaration - do not modify//GEN-BEGIN:variables private mage.client.cards.BigCard bigCard; private javax.swing.JButton btnExit; @@ -1120,11 +1125,11 @@ class ImportFilter extends FileFilter { } if (ext != null) { if (ext.equalsIgnoreCase("dec") - || ext.equalsIgnoreCase("mwdeck") - || ext.equalsIgnoreCase("txt") - || ext.equalsIgnoreCase("dek") - || ext.equalsIgnoreCase("cod") - || ext.equalsIgnoreCase("o8d")) { + || ext.equalsIgnoreCase("mwdeck") + || ext.equalsIgnoreCase("txt") + || ext.equalsIgnoreCase("dek") + || ext.equalsIgnoreCase("cod") + || ext.equalsIgnoreCase("o8d")) { return true; } } diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java index 6ae066c816..1d37735879 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java @@ -52,15 +52,15 @@ public class MageBook extends JComponent { private static final long serialVersionUID = 1L; - public static final String LAYOUT_3x3 = "small"; + public static final String LAYOUT_3X3 = "small"; - public static final String LAYOUT_4x4 = "big"; + public static final String LAYOUT_4X4 = "big"; public MageBook(BigCard bigCard) { super(); this.bigCard = bigCard; this.setsToDisplay = ConstructedFormats.getSetsByFormat(ConstructedFormats.getDefault()); - boolean selected3x3 = MageFrame.getPreferences().get(CollectionViewerPanel.LAYOYT_CONFIG_KEY, MageBook.LAYOUT_3x3).equals(MageBook.LAYOUT_3x3); + boolean selected3x3 = MageFrame.getPreferences().get(CollectionViewerPanel.LAYOYT_CONFIG_KEY, MageBook.LAYOUT_3X3).equals(MageBook.LAYOUT_3X3); this.conf = selected3x3 ? new _3x3Configuration() : new _4x4Configuration(); initComponents(); } @@ -827,10 +827,10 @@ public class MageBook extends JComponent { public void updateSize(String size) { switch (size) { - case LAYOUT_3x3: + case LAYOUT_3X3: this.conf = new _3x3Configuration(); break; - case LAYOUT_4x4: + case LAYOUT_4X4: this.conf = new _4x4Configuration(); break; default: diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java index ef53c3308e..266d9540e6 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java @@ -829,7 +829,7 @@ public class PreferencesDialog extends javax.swing.JDialog { .add(cbAskMoveToGraveOrder)) ); - nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile"); + nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName(KEY_PERMANENTS_IN_ONE_PILE); main_battlefield.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Battlefield")); diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index 86ad18aa28..01bc3ebfb7 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -921,6 +921,8 @@ public final class GamePanel extends javax.swing.JPanel { case END_TURN: updateButton("Cleanup"); break; + default: + break; } } @@ -1027,6 +1029,8 @@ public final class GamePanel extends javax.swing.JPanel { case LOOKED_AT: cardInfoWindowDialog.loadCards((SimpleCardsView) cardsView, bigCard, gameId); break; + default: + break; } } } @@ -1810,8 +1814,8 @@ public final class GamePanel extends javax.swing.JPanel { } }; String[] phases = {"Untap", "Upkeep", "Draw", "Main1", - "Combat_Start", "Combat_Attack", "Combat_Block", "Combat_Damage", "Combat_End", - "Main2", "Cleanup", "Next_Turn"}; + "Combat_Start", "Combat_Attack", "Combat_Block", "Combat_Damage", "Combat_End", + "Main2", "Cleanup", "Next_Turn"}; for (String name : phases) { createPhaseButton(name, phasesMouseAdapter); } @@ -2214,6 +2218,8 @@ public final class GamePanel extends javax.swing.JPanel { case CMD_AUTO_ORDER_RESET_ALL: SessionHandler.sendPlayerAction(TRIGGER_AUTO_ORDER_RESET_ALL, gameId, null); break; + default: + break; } for (ShowCardsDialog dialog : pickTarget) { dialog.removeDialog(); diff --git a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java index c9a81633cc..45fc243a68 100644 --- a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java @@ -1,40 +1,23 @@ package mage.client.game; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.ArrayList; -import java.util.UUID; -import javax.swing.JButton; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.ScrollPaneConstants; -import javax.swing.SwingUtilities; -import javax.swing.ToolTipManager; -import javax.swing.UIManager; -import javax.swing.border.EmptyBorder; - import mage.client.SessionHandler; import mage.client.components.MageTextArea; import mage.client.constants.Constants; import mage.client.dialog.PreferencesDialog; import mage.client.game.FeedbackPanel.FeedbackMode; - -import static mage.client.game.FeedbackPanel.FeedbackMode.QUESTION; import mage.client.util.GUISizeHelper; import mage.constants.TurnPhase; -import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_NO; -import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_YES; -import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL; -import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_TEXT_NO; -import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_TEXT_YES; +import javax.swing.*; +import javax.swing.border.EmptyBorder; +import java.awt.*; +import java.awt.event.*; +import java.util.ArrayList; +import java.util.UUID; + +import static mage.client.game.FeedbackPanel.FeedbackMode.QUESTION; +import static mage.constants.PlayerAction.*; /** * Panel with buttons that copy the state of feedback panel. @@ -326,10 +309,18 @@ public class HelperPanel extends JPanel { this.buttonGrid.setPreferredSize(null); ArrayList buttons = new ArrayList<>(); - if (this.btnSpecial.isVisible()) { buttons.add(this.btnSpecial); } - if (this.btnLeft.isVisible()) { buttons.add(this.btnLeft); } - if (this.btnRight.isVisible()) { buttons.add(this.btnRight); } - if (this.btnUndo.isVisible()) { buttons.add(this.btnUndo); } + if (this.btnSpecial.isVisible()) { + buttons.add(this.btnSpecial); + } + if (this.btnLeft.isVisible()) { + buttons.add(this.btnLeft); + } + if (this.btnRight.isVisible()) { + buttons.add(this.btnRight); + } + if (this.btnUndo.isVisible()) { + buttons.add(this.btnUndo); + } // color panel on player's feedback waiting if (this.gameNeedFeedback) { @@ -360,10 +351,14 @@ public class HelperPanel extends JPanel { case COMBAT: backColor = ACTIVE_FEEDBACK_BACKGROUND_COLOR_BATTLE; break; + default: + break; } } this.mainPanel.setBackground(backColor); break; + default: + break; } } else { // inform about other players @@ -500,6 +495,8 @@ public class HelperPanel extends JPanel { case CMD_AUTO_ANSWER_RESET_ALL: SessionHandler.sendPlayerAction(REQUEST_AUTO_ANSWER_RESET_ALL, gameId, null); break; + default: + break; } } diff --git a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java index 57ced4260e..b266d991c8 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java @@ -168,6 +168,8 @@ public class PlayAreaPanel extends javax.swing.JPanel { SessionHandler.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_END_STEP_BEFORE_MY_NEXT_TURN, gameId, null); break; } + default: + break; } }; @@ -409,6 +411,8 @@ public class PlayAreaPanel extends javax.swing.JPanel { MageFrame.getInstance().showUserRequestDialog(message); break; } + default: + break; } }; diff --git a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java index 344e62c1b6..41d51c9ab2 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java +++ b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java @@ -1,22 +1,5 @@ package mage.client.plugins.adapters; -import java.awt.Component; -import java.awt.Image; -import java.awt.Point; -import java.awt.event.MouseEvent; -import java.awt.event.MouseWheelEvent; -import java.awt.image.BufferedImage; -import java.util.*; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.Popup; -import javax.swing.PopupFactory; -import javax.swing.SwingUtilities; import mage.cards.MageCard; import mage.cards.action.ActionCallback; import mage.cards.action.TransferData; @@ -42,6 +25,18 @@ import org.jdesktop.swingx.JXPanel; import org.mage.card.arcane.CardPanel; import org.mage.plugins.card.images.ImageCache; +import javax.swing.*; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseWheelEvent; +import java.awt.image.BufferedImage; +import java.util.*; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + /** * Class that handles the callbacks from the card panels to mage to display big * card images from the cards the mouse hovers on. Also handles tooltip text @@ -173,21 +168,21 @@ public class MageActionCallback implements ActionCallback { public void showPopup(final Component popupContainer, final Component infoPane) throws InterruptedException { final Component c = MageFrame.getUI().getComponent(MageComponents.DESKTOP_PANE); SwingUtilities.invokeLater(() -> { - if (!popupTextWindowOpen - || enlargedWindowState != EnlargedWindowState.CLOSED) { - return; - } - if (data.locationOnScreen == null) { - data.locationOnScreen = data.component.getLocationOnScreen(); - } + if (!popupTextWindowOpen + || enlargedWindowState != EnlargedWindowState.CLOSED) { + return; + } + if (data.locationOnScreen == null) { + data.locationOnScreen = data.component.getLocationOnScreen(); + } - Point location = new Point((int) data.locationOnScreen.getX() + data.popupOffsetX - 40, (int) data.locationOnScreen.getY() + data.popupOffsetY - 40); - location = GuiDisplayUtil.keepComponentInsideParent(location, parentPoint, infoPane, parentComponent); - location.translate(-parentPoint.x, -parentPoint.y); - popupContainer.setLocation(location); - popupContainer.setVisible(true); - c.repaint(); - } + Point location = new Point((int) data.locationOnScreen.getX() + data.popupOffsetX - 40, (int) data.locationOnScreen.getY() + data.popupOffsetY - 40); + location = GuiDisplayUtil.keepComponentInsideParent(location, parentPoint, infoPane, parentComponent); + location.translate(-parentPoint.x, -parentPoint.y); + popupContainer.setLocation(location); + popupContainer.setVisible(true); + c.repaint(); + } ); } }); @@ -500,7 +495,7 @@ public class MageActionCallback implements ActionCallback { * Show the big card image on mouse position while hovering over a card * * @param showAlternative defines if the original image (if it's a copied - * card) or the opposite side of a transformable card will be shown + * card) or the opposite side of a transformable card will be shown */ public void enlargeCard(EnlargeMode showAlternative) { if (enlargedWindowState == EnlargedWindowState.CLOSED) { @@ -598,6 +593,8 @@ public class MageActionCallback implements ActionCallback { } } break; + default: + break; } if (image == null) { image = mageCard.getImage(); diff --git a/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java b/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java index 1731b0b656..e63d104219 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java +++ b/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java @@ -69,15 +69,11 @@ public enum Plugins implements MagePlugins { @Override public void changeGUISize() { - setGUISize(); if (this.cardPlugin != null) { cardPlugin.changeGUISize(); } } - private void setGUISize() { - - } @Override public void updateGamePanel(Map ui) { diff --git a/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java b/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java index 894683a8be..6d54702565 100644 --- a/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java +++ b/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java @@ -1,10 +1,6 @@ package mage.client.remote; -import java.awt.event.KeyEvent; -import java.util.List; -import java.util.UUID; -import javax.swing.*; import mage.cards.decks.Deck; import mage.client.MageFrame; import mage.client.SessionHandler; @@ -28,8 +24,12 @@ import mage.view.*; import mage.view.ChatMessage.MessageType; import org.apache.log4j.Logger; +import javax.swing.*; +import java.awt.event.KeyEvent; +import java.util.List; +import java.util.UUID; + /** - * * @author BetaSteward_at_googlemail.com */ public class CallbackClientImpl implements CallbackClient { @@ -372,6 +372,8 @@ public class CallbackClientImpl implements CallbackClient { case USER_REQUEST_DIALOG: frame.showUserRequestDialog((UserRequestMessage) callback.getData()); break; + default: + break; } messageId = callback.getMessageId(); } catch (Exception ex) { @@ -400,36 +402,36 @@ public class CallbackClientImpl implements CallbackClient { switch (usedPanel.getChatType()) { case GAME: usedPanel.receiveMessage("", new StringBuilder("You may use hot keys to play faster:") - .append("
Turn mousewheel up (ALT-e) - enlarge image of card the mousepointer hovers over") - .append("
Turn mousewheel down (ALT-s) - enlarge original/alternate image of card the mousepointer hovers over") - .append("
") - .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_CONFIRM, 113))) - .append(" - Confirm \"Ok\", \"Yes\" or \"Done\" button") - .append("
") - .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_NEXT_TURN, 115))) - .append(" - Skip current turn but stop on declare attackers/blockers and something on the stack") - .append("
") - .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_END_STEP, 116))) - .append(" - Skip to next end step but stop on declare attackers/blockers and something on the stack") - .append("
") - .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_SKIP_STEP, 117))) - .append(" - Skip current turn but stop on declare attackers/blockers") - .append("
") - .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_MAIN_STEP, 118))) - .append(" - Skip to next main phase but stop on declare attackers/blockers and something on the stack") - .append("
") - .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_YOUR_TURN, 120))) - .append(" - Skip everything until your next turn") - .append("
") - .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_PRIOR_END, 122))) - .append(" - Skip everything until the end step just prior to your turn") - .append("
") - .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_CANCEL_SKIP, 114))) - .append(" - Undo F4/F5/F7/F9/F11") - .append("
") - .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_TOGGLE_MACRO, 119))) - .append(" - Toggle recording a sequence of actions to repeat. Will not pause if interrupted and can fail if a selected card changes such as when scrying top card to bottom.") - .append("
").append(System.getProperty("os.name").contains("Mac OS X") ? "Cmd" : "Ctrl").append(" + click - Hold priority while casting a spell or activating an ability").toString(), + .append("
Turn mousewheel up (ALT-e) - enlarge image of card the mousepointer hovers over") + .append("
Turn mousewheel down (ALT-s) - enlarge original/alternate image of card the mousepointer hovers over") + .append("
") + .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_CONFIRM, 113))) + .append(" - Confirm \"Ok\", \"Yes\" or \"Done\" button") + .append("
") + .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_NEXT_TURN, 115))) + .append(" - Skip current turn but stop on declare attackers/blockers and something on the stack") + .append("
") + .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_END_STEP, 116))) + .append(" - Skip to next end step but stop on declare attackers/blockers and something on the stack") + .append("
") + .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_SKIP_STEP, 117))) + .append(" - Skip current turn but stop on declare attackers/blockers") + .append("
") + .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_MAIN_STEP, 118))) + .append(" - Skip to next main phase but stop on declare attackers/blockers and something on the stack") + .append("
") + .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_YOUR_TURN, 120))) + .append(" - Skip everything until your next turn") + .append("
") + .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_PRIOR_END, 122))) + .append(" - Skip everything until the end step just prior to your turn") + .append("
") + .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_CANCEL_SKIP, 114))) + .append(" - Undo F4/F5/F7/F9/F11") + .append("
") + .append(KeyEvent.getKeyText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONTROL_TOGGLE_MACRO, 119))) + .append(" - Toggle recording a sequence of actions to repeat. Will not pause if interrupted and can fail if a selected card changes such as when scrying top card to bottom.") + .append("
").append(System.getProperty("os.name").contains("Mac OS X") ? "Cmd" : "Ctrl").append(" + click - Hold priority while casting a spell or activating an ability").toString(), null, MessageType.USER_INFO, ChatMessage.MessageColor.BLUE); break; case TOURNAMENT: @@ -438,12 +440,14 @@ public class CallbackClientImpl implements CallbackClient { break; case TABLES: usedPanel.receiveMessage("", new StringBuilder("Download card images by using the \"Images\" menu to the top right .") - .append("
Download icons and symbols by using the \"Symbols\" menu to the top right.") - .append("
\\list - Show a list of available chat commands.") - .append("
").append(IgnoreList.usage()) - .append("
Type \\w yourUserName profanity 0 (or 1 or 2) to turn off/on the profanity filter").toString(), + .append("
Download icons and symbols by using the \"Symbols\" menu to the top right.") + .append("
\\list - Show a list of available chat commands.") + .append("
").append(IgnoreList.usage()) + .append("
Type \\w yourUserName profanity 0 (or 1 or 2) to turn off/on the profanity filter").toString(), null, MessageType.USER_INFO, ChatMessage.MessageColor.BLUE); break; + default: + break; } } diff --git a/Mage.Client/src/main/java/mage/client/table/MatchesTableModel.java b/Mage.Client/src/main/java/mage/client/table/MatchesTableModel.java index 8cf2c28c47..b842686d6e 100644 --- a/Mage.Client/src/main/java/mage/client/table/MatchesTableModel.java +++ b/Mage.Client/src/main/java/mage/client/table/MatchesTableModel.java @@ -92,8 +92,9 @@ public class MatchesTableModel extends AbstractTableModel { } case 9: return matches[arg0].getGames(); + default: + return ""; } - return ""; } public java.util.List getListofGames(int row) { diff --git a/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java index 6bf3e0d156..032ef1ea65 100644 --- a/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java @@ -185,8 +185,9 @@ public class PlayersChatPanel extends javax.swing.JPanel { return players[rowIndex].getInfoGames(); case 9: return players[rowIndex].getInfoPing(); + default: + return ""; } - return ""; } @Override diff --git a/Mage.Client/src/main/java/mage/client/table/TableInfo.java b/Mage.Client/src/main/java/mage/client/table/TableInfo.java index 4839dbbc1c..a3570c4287 100644 --- a/Mage.Client/src/main/java/mage/client/table/TableInfo.java +++ b/Mage.Client/src/main/java/mage/client/table/TableInfo.java @@ -10,9 +10,6 @@ public class TableInfo { private List columns = new ArrayList<>(); - public TableInfo() { - - } public TableInfo addColumn(Integer index, Integer width, Class colClass, String headerName, String headerHint) { this.columns.add(new ColumnInfo(index, width, colClass, headerName, headerHint));