diff --git a/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java b/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java index 2261c9e2a7..9f41899a3a 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java @@ -1,14 +1,9 @@ package mage.client.util.gui; -import java.awt.*; -import java.util.ArrayList; -import java.util.Locale; -import javax.swing.*; -import mage.client.dialog.PreferencesDialog; -import static mage.client.dialog.PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE; import mage.client.MageFrame; +import mage.client.dialog.PreferencesDialog; +import mage.client.table.PlayersChatPanel; import mage.client.util.GUISizeHelper; -import mage.client.table.*; import mage.constants.*; import mage.view.CardView; import mage.view.CounterView; @@ -17,6 +12,13 @@ import org.jdesktop.swingx.JXPanel; import org.mage.card.arcane.ManaSymbols; import org.mage.card.arcane.UI; +import javax.swing.*; +import java.awt.*; +import java.util.ArrayList; +import java.util.Locale; + +import static mage.client.dialog.PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE; + public final class GuiDisplayUtil { private static final Font cardNameFont = new Font("Calibri", Font.BOLD, 15); @@ -30,32 +32,32 @@ public final class GuiDisplayUtil { } public static void restoreDividerLocations(Rectangle bounds, String lastDividerLocation, JComponent component) { - String currentBounds = Double.toString(bounds.getWidth()) + 'x' + Double.toString(bounds.getHeight()); - String savedBounds = PreferencesDialog.getCachedValue(KEY_MAGE_PANEL_LAST_SIZE, null); - // use divider positions only if screen size is the same as it was the time the settings were saved - if (savedBounds != null && savedBounds.equals(currentBounds)) { - if (lastDividerLocation != null && component != null) { - if (component instanceof JSplitPane) { - JSplitPane jSplitPane = (JSplitPane) component; - jSplitPane.setDividerLocation(Integer.parseInt(lastDividerLocation)); - } + String currentBounds = Double.toString(bounds.getWidth()) + 'x' + bounds.getHeight(); + String savedBounds = PreferencesDialog.getCachedValue(KEY_MAGE_PANEL_LAST_SIZE, null); + // use divider positions only if screen size is the same as it was the time the settings were saved + if (savedBounds != null && savedBounds.equals(currentBounds)) { + if (lastDividerLocation != null && component != null) { + if (component instanceof JSplitPane) { + JSplitPane jSplitPane = (JSplitPane) component; + jSplitPane.setDividerLocation(Integer.parseInt(lastDividerLocation)); + } - if (component instanceof PlayersChatPanel) { - PlayersChatPanel playerChatPanel = (PlayersChatPanel) component; - playerChatPanel.setSplitDividerLocation(Integer.parseInt(lastDividerLocation)); - } + if (component instanceof PlayersChatPanel) { + PlayersChatPanel playerChatPanel = (PlayersChatPanel) component; + playerChatPanel.setSplitDividerLocation(Integer.parseInt(lastDividerLocation)); + } + } } - } } public static void saveCurrentBoundsToPrefs() { - Rectangle rec = MageFrame.getDesktop().getBounds(); - String currentBounds = Double.toString(rec.getWidth()) + 'x' + Double.toString(rec.getHeight()); - PreferencesDialog.saveValue(KEY_MAGE_PANEL_LAST_SIZE, currentBounds); + Rectangle rec = MageFrame.getDesktop().getBounds(); + String currentBounds = Double.toString(rec.getWidth()) + 'x' + rec.getHeight(); + PreferencesDialog.saveValue(KEY_MAGE_PANEL_LAST_SIZE, currentBounds); } public static void saveDividerLocationToPrefs(String dividerPrefKey, int position) { - PreferencesDialog.saveValue(dividerPrefKey, Integer.toString(position)); + PreferencesDialog.saveValue(dividerPrefKey, Integer.toString(position)); } public static JXPanel getDescription(CardView card, int width, int height) { @@ -204,6 +206,10 @@ public final class GuiDisplayUtil { return textLines; } + public static String getHintIconHtml(String iconName, int symbolSize) { + return ""; + } + public static StringBuilder getRulefromCardView(CardView card, TextLines textLines) { String manaCost = ""; for (String m : card.getManaCost()) { @@ -236,7 +242,7 @@ public final class GuiDisplayUtil { buffer.append("