From 77eff0984a27811b4e75174f971d240c17029821 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 18 Feb 2016 00:27:48 +0100 Subject: [PATCH] Some more changes to GUI to better support high screen resolutions. --- Mage.Client/serverlist.txt | 183 +- .../mage/client/dialog/PreferencesDialog.form | 2588 ++++++++++++++++- .../mage/client/dialog/PreferencesDialog.java | 132 +- .../java/mage/client/draft/DraftPane.java | 1 + .../java/mage/client/draft/DraftPanel.java | 3 +- .../java/mage/client/game/HelperPanel.java | 12 +- .../java/mage/client/game/PlayAreaPanel.java | 13 +- .../java/mage/client/util/GUISizeHelper.java | 23 +- .../mage/client/util/gui/GuiDisplayUtil.java | 15 +- .../org/mage/card/arcane/ManaSymbols.java | 23 +- .../plugins/card/info/CardInfoPaneImpl.java | 4 +- 11 files changed, 2673 insertions(+), 324 deletions(-) diff --git a/Mage.Client/serverlist.txt b/Mage.Client/serverlist.txt index f7ae4b8f22f..a4379a04bbd 100644 --- a/Mage.Client/serverlist.txt +++ b/Mage.Client/serverlist.txt @@ -1,177 +1,6 @@ - - -xmage.info - - - - - - - - -
-
-
-
- -

xmage.info

-
- -
-
-
-
-
-
-
-
-
- - -
-
- -
- - - +XMage.de 1 (Europe/Germany) fast :xmage.de:17171 +woogerworks (North America/USA) :xmage.woogerworks.info:17171 +XMage Testserver (Europe/France) 1.4.8v0 :176.31.186.181:17171 +XMage BR (South America/Brazil) :ec2-54-233-67-0.sa-east-1.compute.amazonaws.com:17171 +Seedds Server (Asia) :115.29.203.80:17171 +localhost -> connect to your local server (must be started):localhost:17171 diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form index 53abe0437b7..efd01d0832b 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form @@ -1,6 +1,6 @@ -
+ @@ -40,8 +40,8 @@ - - + + @@ -115,17 +115,14 @@ - + - - + + + - - - - - + @@ -387,8 +384,6 @@ - - @@ -410,11 +405,9 @@ - + - - @@ -437,19 +430,19 @@ - + - + - + @@ -474,14 +467,14 @@ - + - + @@ -511,14 +504,14 @@ - + - + @@ -551,19 +544,19 @@ - + - + - + @@ -588,14 +581,14 @@ - + - + @@ -605,6 +598,1027 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -626,11 +1640,9 @@ - + - - @@ -654,14 +1666,14 @@ - + - + @@ -691,14 +1703,14 @@ - + - + @@ -728,14 +1740,14 @@ - + - + @@ -765,7 +1777,7 @@ - + @@ -777,7 +1789,7 @@ - + @@ -802,14 +1814,14 @@ - + - + @@ -817,7 +1829,7 @@ - + @@ -843,25 +1855,1479 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1013,7 +3479,7 @@ - + @@ -1697,17 +4163,17 @@ - - - + + + - - - + + + @@ -2841,6 +5307,15 @@ + + + + + + + + + @@ -2850,6 +5325,15 @@ + + + + + + + + + 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 a830c2759fe..a31f8cc44a5 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java @@ -543,13 +543,11 @@ public class PreferencesDialog extends javax.swing.JDialog { main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(main_cardLayout.createSequentialGroup() .add(6, 6, 6) - .add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(tooltipDelayLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, tooltipDelay, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(main_cardLayout.createSequentialGroup() - .add(showCardName) - .add(0, 0, Short.MAX_VALUE))) - .addContainerGap()) + .add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) + .add(tooltipDelayLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.LEADING, showCardName) + .add(tooltipDelay, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(183, Short.MAX_VALUE)) ); main_cardLayout.setVerticalGroup( main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -737,12 +735,20 @@ public class PreferencesDialog extends javax.swing.JDialog { tabGuiSize.setMaximumSize(new java.awt.Dimension(527, 423)); tabGuiSize.setMinimumSize(new java.awt.Dimension(527, 423)); - tabGuiSize.setLayout(new java.awt.GridBagLayout()); + java.awt.GridBagLayout tabGuiSizeLayout = new java.awt.GridBagLayout(); + tabGuiSizeLayout.columnWidths = new int[] {0}; + tabGuiSizeLayout.rowHeights = new int[] {0, 20, 0}; + tabGuiSizeLayout.columnWeights = new double[] {1.0}; + tabGuiSizeLayout.rowWeights = new double[] {1.0, 0.0, 1.0}; + tabGuiSize.setLayout(tabGuiSizeLayout); guiSizeBasic.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Size basic elements")); guiSizeBasic.setMinimumSize(new java.awt.Dimension(600, 180)); guiSizeBasic.setPreferredSize(new java.awt.Dimension(600, 180)); - guiSizeBasic.setLayout(new java.awt.GridBagLayout()); + java.awt.GridBagLayout guiSizeBasicLayout = new java.awt.GridBagLayout(); + guiSizeBasicLayout.columnWeights = new double[] {1.0, 1.0, 1.0}; + guiSizeBasicLayout.rowWeights = new double[] {1.0, 0.2, 1.0, 0.2}; + guiSizeBasic.setLayout(guiSizeBasicLayout); sliderFontSize.setMajorTickSpacing(5); sliderFontSize.setMaximum(50); @@ -755,15 +761,19 @@ public class PreferencesDialog extends javax.swing.JDialog { sliderFontSize.setBorder(javax.swing.BorderFactory.createEtchedBorder()); sliderFontSize.setMinimumSize(new java.awt.Dimension(150, 40)); gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeBasic.add(sliderFontSize, gridBagConstraints); fontSizeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - fontSizeLabel.setText("Size of table font"); + fontSizeLabel.setText("Tables"); fontSizeLabel.setToolTipText("The size of the font used to display table text."); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; gridBagConstraints.ipadx = 3; gridBagConstraints.ipady = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; @@ -782,12 +792,13 @@ public class PreferencesDialog extends javax.swing.JDialog { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeBasic.add(sliderChatFontSize, gridBagConstraints); chatFontSizeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - chatFontSizeLabel.setText("Size of chat font"); + chatFontSizeLabel.setText("Chat"); chatFontSizeLabel.setToolTipText("The size of the font used to display the chat text"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; @@ -810,12 +821,13 @@ public class PreferencesDialog extends javax.swing.JDialog { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeBasic.add(sliderDialogFont, gridBagConstraints); labelDialogFont.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - labelDialogFont.setText("Font size of messages and menues"); + labelDialogFont.setText("Messages and menues"); labelDialogFont.setToolTipText("The size of the font of messages and menues"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; @@ -838,15 +850,18 @@ public class PreferencesDialog extends javax.swing.JDialog { sliderEditorCardSize.setMinimumSize(new java.awt.Dimension(150, 40)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeBasic.add(sliderEditorCardSize, gridBagConstraints); labelEditorCardSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - labelEditorCardSize.setText("Size of editor and drafted cards"); + labelEditorCardSize.setText("Cards in editor and draft panel"); labelEditorCardSize.setToolTipText("The size of the card in editor and the picked zone of the draft panel\n"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 3; gridBagConstraints.ipadx = 3; gridBagConstraints.ipady = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; @@ -865,12 +880,13 @@ public class PreferencesDialog extends javax.swing.JDialog { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeBasic.add(sliderEditorCardOffset, gridBagConstraints); labelEditorCardOffset.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - labelEditorCardOffset.setText("Size of card offset"); + labelEditorCardOffset.setText("Card offset editor and draft"); labelEditorCardOffset.setToolTipText("The vertical offset of card images in editor areas\n"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; @@ -883,14 +899,17 @@ public class PreferencesDialog extends javax.swing.JDialog { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(11, 10, 0, 10); + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; tabGuiSize.add(guiSizeBasic, gridBagConstraints); guiSizeGame.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Size game elements")); guiSizeGame.setMinimumSize(new java.awt.Dimension(600, 180)); guiSizeGame.setPreferredSize(new java.awt.Dimension(600, 180)); - guiSizeGame.setLayout(new java.awt.GridBagLayout()); + java.awt.GridBagLayout guiSizeGameLayout = new java.awt.GridBagLayout(); + guiSizeGameLayout.columnWeights = new double[] {1.0, 1.0, 1.0}; + guiSizeGameLayout.rowWeights = new double[] {1.0, 0.2, 1.0, 0.2}; + guiSizeGame.setLayout(guiSizeGameLayout); sliderCardSizeHand.setMajorTickSpacing(5); sliderCardSizeHand.setMaximum(50); @@ -906,12 +925,13 @@ public class PreferencesDialog extends javax.swing.JDialog { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(6, 4, 6, 4); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeGame.add(sliderCardSizeHand, gridBagConstraints); labelCardSizeHand.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - labelCardSizeHand.setText("Size of hand cards"); + labelCardSizeHand.setText("Cards hand"); labelCardSizeHand.setToolTipText("The size of the card in hand"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; @@ -934,12 +954,13 @@ public class PreferencesDialog extends javax.swing.JDialog { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(5, 3, 5, 3); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeGame.add(sliderCardSizeOtherZones, gridBagConstraints); labelCardSizeOtherZones.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - labelCardSizeOtherZones.setText("Size of other zone cards"); + labelCardSizeOtherZones.setText("Cards other zones"); labelCardSizeOtherZones.setToolTipText("The size of card in other game zone (e.g. graveyard, revealed cards etc.)"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; @@ -962,12 +983,13 @@ public class PreferencesDialog extends javax.swing.JDialog { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(5, 3, 5, 3); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeGame.add(sliderCardSizeBattlefield, gridBagConstraints); labelCardSizeBattlefield.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - labelCardSizeBattlefield.setText("Size of permanents"); + labelCardSizeBattlefield.setText("Permanents"); labelCardSizeBattlefield.setToolTipText("The maximum size of permanents on the battlefield"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; @@ -989,9 +1011,10 @@ public class PreferencesDialog extends javax.swing.JDialog { sliderSymbolSize.setMinimumSize(new java.awt.Dimension(150, 40)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 3; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(5, 3, 5, 3); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeGame.add(sliderSymbolSize, gridBagConstraints); labelSymbolSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); @@ -999,6 +1022,7 @@ public class PreferencesDialog extends javax.swing.JDialog { labelSymbolSize.setToolTipText("The size of symbols"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 3; gridBagConstraints.ipadx = 3; gridBagConstraints.ipady = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; @@ -1016,17 +1040,18 @@ public class PreferencesDialog extends javax.swing.JDialog { sliderGameFeedbackArea.setMinimumSize(new java.awt.Dimension(150, 40)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 3; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(5, 3, 5, 3); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeGame.add(sliderGameFeedbackArea, gridBagConstraints); labelGameFeedback.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - labelGameFeedback.setText("Size game feedback area"); + labelGameFeedback.setText("Dialog area"); labelGameFeedback.setToolTipText("The size of the game feedback area (buttons and messages above the hand area)"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 4; + gridBagConstraints.gridy = 3; gridBagConstraints.ipadx = 3; gridBagConstraints.ipady = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; @@ -1046,17 +1071,18 @@ public class PreferencesDialog extends javax.swing.JDialog { sliderTooltipSize.setMinimumSize(new java.awt.Dimension(150, 40)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 3; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.insets = new java.awt.Insets(5, 3, 5, 3); + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); guiSizeGame.add(sliderTooltipSize, gridBagConstraints); labelTooltipSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - labelTooltipSize.setText("Tooltip size"); + labelTooltipSize.setText("Tooltip window"); labelTooltipSize.setToolTipText("The size of the tooltip window for cards or permanents"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 4; + gridBagConstraints.gridy = 3; gridBagConstraints.ipadx = 3; gridBagConstraints.ipady = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; @@ -1064,9 +1090,9 @@ public class PreferencesDialog extends javax.swing.JDialog { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(6, 10, 86, 10); + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; tabGuiSize.add(guiSizeGame, gridBagConstraints); tabsPanel.addTab("GUI Size", tabGuiSize); @@ -1279,7 +1305,7 @@ public class PreferencesDialog extends javax.swing.JDialog { .add(jLabelEndOfTurn) .add(checkBoxEndTurnOthers)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) - .add(phases_stopSettings, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE) + .add(phases_stopSettings, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE) .addContainerGap()) ); @@ -2058,15 +2084,15 @@ public class PreferencesDialog extends javax.swing.JDialog { tabAvatars.setLayout(tabAvatarsLayout); tabAvatarsLayout.setHorizontalGroup( tabAvatarsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(org.jdesktop.layout.GroupLayout.TRAILING, tabAvatarsLayout.createSequentialGroup() - .add(avatarPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 527, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(0, 0, Short.MAX_VALUE)) + .add(tabAvatarsLayout.createSequentialGroup() + .add(avatarPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 528, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(0, 1, Short.MAX_VALUE)) ); tabAvatarsLayout.setVerticalGroup( tabAvatarsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(org.jdesktop.layout.GroupLayout.TRAILING, tabAvatarsLayout.createSequentialGroup() - .add(avatarPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 423, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(0, 0, Short.MAX_VALUE)) + .add(tabAvatarsLayout.createSequentialGroup() + .add(avatarPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 484, Short.MAX_VALUE) + .addContainerGap()) ); tabsPanel.addTab("Avatars", tabAvatars); @@ -2255,6 +2281,9 @@ public class PreferencesDialog extends javax.swing.JDialog { tabsPanel.addTab("Connection", tabConnection); saveButton.setLabel("Save"); + saveButton.setMaximumSize(new java.awt.Dimension(100, 30)); + saveButton.setMinimumSize(new java.awt.Dimension(100, 30)); + saveButton.setPreferredSize(new java.awt.Dimension(100, 30)); saveButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); saveButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -2263,6 +2292,9 @@ public class PreferencesDialog extends javax.swing.JDialog { }); exitButton.setLabel("Exit"); + exitButton.setMaximumSize(new java.awt.Dimension(100, 30)); + exitButton.setMinimumSize(new java.awt.Dimension(100, 30)); + exitButton.setPreferredSize(new java.awt.Dimension(100, 30)); exitButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); exitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -2288,8 +2320,8 @@ public class PreferencesDialog extends javax.swing.JDialog { .add(tabsPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(saveButton) - .add(exitButton)) + .add(saveButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(exitButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); diff --git a/Mage.Client/src/main/java/mage/client/draft/DraftPane.java b/Mage.Client/src/main/java/mage/client/draft/DraftPane.java index 04438f81e18..d3862c5d509 100644 --- a/Mage.Client/src/main/java/mage/client/draft/DraftPane.java +++ b/Mage.Client/src/main/java/mage/client/draft/DraftPane.java @@ -72,6 +72,7 @@ public class DraftPane extends MagePane { @Override public void changeGUISize() { super.changeGUISize(); //To change body of generated methods, choose Tools | Templates. + draftPanel1.changeGUISize(); } public void showDraft(UUID draftId) { diff --git a/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java b/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java index 468cf211e6e..109e3c9e916 100644 --- a/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java +++ b/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java @@ -69,6 +69,7 @@ import mage.client.dialog.PreferencesDialog; import mage.client.plugins.impl.Plugins; import mage.client.util.CardsViewUtil; import mage.client.util.Event; +import mage.client.util.GUISizeHelper; import mage.client.util.ImageHelper; import mage.client.util.Listener; import mage.client.util.audio.AudioManager; @@ -177,7 +178,7 @@ public class DraftPanel extends javax.swing.JPanel { } private void setGUISize() { - + GUISizeHelper.changePopupMenuFont(popupMenuPickedArea); } public synchronized void showDraft(UUID draftId) { 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 5dc9fe001e2..fb1b2ee442e 100644 --- a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java @@ -113,16 +113,8 @@ public class HelperPanel extends JPanel { } private void setGUISize() { - for (Component comp : popupMenuAskNo.getComponents()) { - if (comp instanceof JMenuItem) { - comp.setFont(GUISizeHelper.menuFont); - } - } - for (Component comp : popupMenuAskYes.getComponents()) { - if (comp instanceof JMenuItem) { - comp.setFont(GUISizeHelper.menuFont); - } - } + GUISizeHelper.changePopupMenuFont(popupMenuAskNo); + GUISizeHelper.changePopupMenuFont(popupMenuAskYes); } private void initComponents() { 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 15b5a8d75f5..20fe42c3815 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java @@ -28,7 +28,6 @@ package mage.client.game; import java.awt.Color; -import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -148,17 +147,7 @@ public class PlayAreaPanel extends javax.swing.JPanel { } private void setGUISize() { - for (Component comp : popupMenu.getComponents()) { - if (comp instanceof JMenuItem) { - comp.setFont(GUISizeHelper.menuFont); - if (comp instanceof JMenu) { - comp.setFont(GUISizeHelper.menuFont); - for (Component subComp : ((JMenu) comp).getMenuComponents()) { - subComp.setFont(GUISizeHelper.menuFont); - } - } - } - } + GUISizeHelper.changePopupMenuFont(popupMenu); } private void addPopupMenuPlayer(boolean allowRequestToShowHandCards) { diff --git a/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java b/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java index 86b4b4c090d..0aa26ff4edc 100644 --- a/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java +++ b/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java @@ -5,8 +5,12 @@ */ package mage.client.util; +import java.awt.Component; import java.awt.Dimension; import java.awt.Font; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; import mage.client.MageFrame; import mage.client.dialog.PreferencesDialog; @@ -40,6 +44,7 @@ public class GUISizeHelper { public static int flagHeight; public static int cardTooltipFontSize = 15; + public static Font chatFont = new java.awt.Font("Arial", 0, 12); public static Font tableFont = new java.awt.Font("Arial", 0, 12); public static Font balloonTooltipFont = new java.awt.Font("Arial", 0, 12); @@ -110,15 +115,15 @@ public class GUISizeHelper { basicSymbolSize = "large"; } if (symbolSize < 16) { - symbolTooltipSize = 15; symbolPaySize = 15; symbolCardSize = 15; } else { - symbolTooltipSize = symbolSize; symbolPaySize = symbolSize; symbolCardSize = symbolSize; } + cardTooltipFontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_TOOLTIP_SIZE, 14); + symbolTooltipSize = cardTooltipFontSize; int handCardSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_HAND_SIZE, 14); handCardDimension = new Dimension(CARD_IMAGE_WIDTH * handCardSize / 42, CARD_IMAGE_HEIGHT * handCardSize / 42); @@ -133,4 +138,18 @@ public class GUISizeHelper { editorCardDimension = new Dimension(CARD_IMAGE_WIDTH * editorCardSize / 42, CARD_IMAGE_HEIGHT * editorCardSize / 42); editorCardOffsetSize = 2 * PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_OFFSET_SIZE, 14) - 10; } + + public static void changePopupMenuFont(JPopupMenu popupMenu) { + for (Component comp : popupMenu.getComponents()) { + if (comp instanceof JMenuItem) { + comp.setFont(GUISizeHelper.menuFont); + if (comp instanceof JMenu) { + comp.setFont(GUISizeHelper.menuFont); + for (Component subComp : ((JMenu) comp).getMenuComponents()) { + subComp.setFont(GUISizeHelper.menuFont); + } + } + } + } + } } 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 a0e2c6d2dd2..18e336b3f1f 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 @@ -224,27 +224,28 @@ public class GuiDisplayUtil { buffer.append(" [").append(card.getId().toString().substring(0, 3)).append("]"); } buffer.append(""); if (!card.isSplitCard()) { buffer.append(castingCost); } buffer.append(""); buffer.append("
"); + String imageSize = " width=" + GUISizeHelper.cardTooltipFontSize + " height=" + GUISizeHelper.cardTooltipFontSize + ">"; if (card.getColor().isWhite()) { - buffer.append("W"); + buffer.append("W"); + buffer.append("U").append(imageSize); } if (card.getColor().isBlack()) { - buffer.append("B"); + buffer.append("B").append(imageSize); } if (card.getColor().isRed()) { - buffer.append("R"); + buffer.append("R").append(imageSize); } if (card.getColor().isGreen()) { - buffer.append("G"); + buffer.append("G").append(imageSize); } if (!card.getColor().isColorless()) { buffer.append("  "); @@ -273,7 +274,7 @@ public class GuiDisplayUtil { rarity = card.getRarity().getCode(); } if (card.getExpansionSetCode() != null) { - buffer.append(ManaSymbols.replaceSetCodeWithHTML(card.getExpansionSetCode().toUpperCase(), rarity)); + buffer.append(ManaSymbols.replaceSetCodeWithHTML(card.getExpansionSetCode().toUpperCase(), rarity, GUISizeHelper.symbolTooltipSize)); } buffer.append("
"); diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java b/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java index 0b14259b4db..cfd3ee6834b 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java @@ -27,8 +27,8 @@ public class ManaSymbols { private static boolean smallSymbolsFound = false; private static boolean mediumSymbolsFound = false; - private static final Map SET_IMAGES = new HashMap<>(); - private static final Map SET_IMAGES_EXIST = new HashMap<>(); + private static final Map setImages = new HashMap<>(); + private static final Map setImagesExist = new HashMap<>(); private static final Pattern REPLACE_SYMBOLS_PATTERN = Pattern.compile("\\{([^}/]*)/?([^}]*)\\}"); private static String cachedPath; private static final String[] symbols = new String[]{"0", "1", "10", "11", "12", "15", "16", "2", "3", "4", "5", "6", "7", "8", "9", "B", "BG", @@ -55,10 +55,10 @@ public class ManaSymbols { if (h > 0) { Rectangle r = new Rectangle(21, (int) (h * 21.0f / width)); BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r); - SET_IMAGES.put(set, resized); + setImages.put(set, resized); } } else { - SET_IMAGES.put(set, image); + setImages.put(set, image); } } catch (Exception e) { } @@ -111,7 +111,7 @@ public class ManaSymbols { Image image = UI.getImageIcon(file.getAbsolutePath()).getImage(); int width = image.getWidth(null); int height = image.getHeight(null); - SET_IMAGES_EXIST.put(set, new Dimension(width, height)); + setImagesExist.put(set, new Dimension(width, height)); } catch (Exception e) { } } @@ -256,19 +256,20 @@ public class ManaSymbols { return replaced; } - public static String replaceSetCodeWithHTML(String set, String rarity) { + public static String replaceSetCodeWithHTML(String set, String rarity, int size) { String _set = set; - if (SET_IMAGES_EXIST.containsKey(_set)) { - Integer width = SET_IMAGES_EXIST.get(_set).width; - Integer height = SET_IMAGES_EXIST.get(_set).height; - return "" + rarity + " "; + if (setImagesExist.containsKey(_set)) { + int factor = size / 15 + 1; + Integer width = setImagesExist.get(_set).width * factor; + Integer height = setImagesExist.get(_set).height * factor; + return "" + rarity + ""; } else { return set; } } public static Image getSetSymbolImage(String set) { - return SET_IMAGES.get(set); + return setImages.get(set); } public static BufferedImage getSizedManaSymbol(String symbol) { diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java index bb9f9014be9..19a33bed518 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java @@ -47,8 +47,8 @@ public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane { } private void setGUISize() { - addWidth = 20 * GUISizeHelper.cardTooltipFontSize; - addHeight = 12 * GUISizeHelper.cardTooltipFontSize; + addWidth = 20 * GUISizeHelper.cardTooltipFontSize - 50; + addHeight = 12 * GUISizeHelper.cardTooltipFontSize - 20; setSize = true; }