Skip to content

Commit

Permalink
Some more changes to GUI to better support high screen resolutions.
Browse files Browse the repository at this point in the history
  • Loading branch information
LevelX2 committed Feb 19, 2016
1 parent 5943250 commit 35505b2
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 76 deletions.
41 changes: 24 additions & 17 deletions Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,7 @@
<Property name="paintLabels" type="boolean" value="true"/>
<Property name="paintTicks" type="boolean" value="true"/>
<Property name="snapToTicks" type="boolean" value="true"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The size of the card in hand"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The size of the card images in hand and on the stack"/>
<Property name="value" type="int" value="14"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
Expand All @@ -1673,8 +1673,8 @@
<Component class="javax.swing.JLabel" name="labelCardSizeHand">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Cards hand"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The size of the card in hand"/>
<Property name="text" type="java.lang.String" value="Hand cards and stack objects"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The size of the card images in hand and on the stack"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
Expand Down Expand Up @@ -1756,16 +1756,17 @@
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JSlider" name="sliderSymbolSize">
<Component class="javax.swing.JSlider" name="sliderStackWidth">
<Properties>
<Property name="majorTickSpacing" type="int" value="5"/>
<Property name="maximum" type="int" value="50"/>
<Property name="majorTickSpacing" type="int" value="20"/>
<Property name="maximum" type="int" value="90"/>
<Property name="minimum" type="int" value="10"/>
<Property name="minorTickSpacing" type="int" value="1"/>
<Property name="minorTickSpacing" type="int" value="5"/>
<Property name="paintLabels" type="boolean" value="true"/>
<Property name="paintTicks" type="boolean" value="true"/>
<Property name="snapToTicks" type="boolean" value="true"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The size of symbols"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The % size of the stack object area in relation to the hand card area size."/>
<Property name="value" type="int" value="30"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<EtchetBorder/>
Expand All @@ -1775,18 +1776,24 @@
<Dimension value="[150, 40]"/>
</Property>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="&lt;HTML&gt;The stack width in relation to the hand area width"/>
</AccessibilityProperties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="2" insetsBottom="2" insetsRight="2" anchor="11" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="labelSymbolSize">
<Component class="javax.swing.JLabel" name="labelStackWidth">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Symbol size"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The size of symbols"/>
<Property name="text" type="java.lang.String" value="Stack %width relatated to hand"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The % size of the stack object area in relation to the hand card area size."/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="&lt;HTML&gt;The stack width in relation to the hand area width"/>
</AccessibilityProperties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="3" ipadY="3" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="11" weightX="0.0" weightY="0.0"/>
Expand Down Expand Up @@ -2594,11 +2601,11 @@
<CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
</StatementProvider>
<Parameters>
<CodeExpression id="127_sliderSymbolSize">
<CodeVariable name="sliderSymbolSize" type="8194" declaredType="javax.swing.JSlider"/>
<CodeExpression id="127_sliderStackWidth">
<CodeVariable name="sliderStackWidth" type="8194" declaredType="javax.swing.JSlider"/>
<ExpressionOrigin>
<ExpressionProvider type="ComponentRef">
<ComponentRef name="sliderSymbolSize"/>
<ComponentRef name="sliderStackWidth"/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
Expand Down Expand Up @@ -2689,11 +2696,11 @@
<CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
</StatementProvider>
<Parameters>
<CodeExpression id="134_labelSymbolSize">
<CodeVariable name="labelSymbolSize" type="8194" declaredType="javax.swing.JLabel"/>
<CodeExpression id="134_labelStackWidth">
<CodeVariable name="labelStackWidth" type="8194" declaredType="javax.swing.JLabel"/>
<ExpressionOrigin>
<ExpressionProvider type="ComponentRef">
<ComponentRef name="labelSymbolSize"/>
<ComponentRef name="labelStackWidth"/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
Expand Down
55 changes: 29 additions & 26 deletions Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
public static final String KEY_GUI_CARD_EDITOR_SIZE = "guiCardEditorSize";
public static final String KEY_GUI_CARD_OFFSET_SIZE = "guiCardOffsetSize";

public static final String KEY_GUI_SYMBOL_SIZE = "guiSymbolSize";
public static final String KEY_GUI_STACK_WIDTH = "guiStackWidth";
public static final String KEY_GUI_TOOLTIP_SIZE = "guiTooltipSize";
public static final String KEY_GUI_DIALOG_FONT_SIZE = "guiDialogFontSize";
public static final String KEY_GUI_FEEDBACK_AREA_SIZE = "guiFeedbackAreaSize";
Expand Down Expand Up @@ -388,8 +388,8 @@ private void initComponents() {
labelCardSizeOtherZones = new javax.swing.JLabel();
sliderCardSizeBattlefield = new javax.swing.JSlider();
labelCardSizeBattlefield = new javax.swing.JLabel();
sliderSymbolSize = new javax.swing.JSlider();
labelSymbolSize = new javax.swing.JLabel();
sliderStackWidth = new javax.swing.JSlider();
labelStackWidth = new javax.swing.JLabel();
sliderGameFeedbackArea = new javax.swing.JSlider();
labelGameFeedback = new javax.swing.JLabel();
sliderTooltipSize = new javax.swing.JSlider();
Expand Down Expand Up @@ -918,7 +918,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
sliderCardSizeHand.setPaintLabels(true);
sliderCardSizeHand.setPaintTicks(true);
sliderCardSizeHand.setSnapToTicks(true);
sliderCardSizeHand.setToolTipText("<HTML>The size of the card in hand");
sliderCardSizeHand.setToolTipText("<HTML>The size of the card images in hand and on the stack");
sliderCardSizeHand.setValue(14);
sliderCardSizeHand.setBorder(javax.swing.BorderFactory.createEtchedBorder());
sliderCardSizeHand.setMinimumSize(new java.awt.Dimension(150, 40));
Expand All @@ -931,8 +931,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
guiSizeGame.add(sliderCardSizeHand, gridBagConstraints);

labelCardSizeHand.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
labelCardSizeHand.setText("Cards hand");
labelCardSizeHand.setToolTipText("<HTML>The size of the card in hand");
labelCardSizeHand.setText("Hand cards and stack objects");
labelCardSizeHand.setToolTipText("<HTML>The size of the card images in hand and on the stack");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
Expand Down Expand Up @@ -999,34 +999,37 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
guiSizeGame.add(labelCardSizeBattlefield, gridBagConstraints);

sliderSymbolSize.setMajorTickSpacing(5);
sliderSymbolSize.setMaximum(50);
sliderSymbolSize.setMinimum(10);
sliderSymbolSize.setMinorTickSpacing(1);
sliderSymbolSize.setPaintLabels(true);
sliderSymbolSize.setPaintTicks(true);
sliderSymbolSize.setSnapToTicks(true);
sliderSymbolSize.setToolTipText("<HTML>The size of symbols");
sliderSymbolSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
sliderSymbolSize.setMinimumSize(new java.awt.Dimension(150, 40));
sliderStackWidth.setMajorTickSpacing(20);
sliderStackWidth.setMaximum(90);
sliderStackWidth.setMinimum(10);
sliderStackWidth.setMinorTickSpacing(5);
sliderStackWidth.setPaintLabels(true);
sliderStackWidth.setPaintTicks(true);
sliderStackWidth.setSnapToTicks(true);
sliderStackWidth.setToolTipText("<HTML>The % size of the stack object area in relation to the hand card area size.");
sliderStackWidth.setValue(30);
sliderStackWidth.setBorder(javax.swing.BorderFactory.createEtchedBorder());
sliderStackWidth.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(2, 2, 2, 2);
guiSizeGame.add(sliderSymbolSize, gridBagConstraints);
guiSizeGame.add(sliderStackWidth, gridBagConstraints);
sliderStackWidth.getAccessibleContext().setAccessibleDescription("<HTML>The stack width in relation to the hand area width");

labelSymbolSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
labelSymbolSize.setText("Symbol size");
labelSymbolSize.setToolTipText("<HTML>The size of symbols");
labelStackWidth.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
labelStackWidth.setText("Stack %width relatated to hand");
labelStackWidth.setToolTipText("<HTML>The % size of the stack object area in relation to the hand card area size.");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 3;
gridBagConstraints.ipadx = 3;
gridBagConstraints.ipady = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
guiSizeGame.add(labelSymbolSize, gridBagConstraints);
guiSizeGame.add(labelStackWidth, gridBagConstraints);
labelStackWidth.getAccessibleContext().setAccessibleDescription("<HTML>The stack width in relation to the hand area width");

sliderGameFeedbackArea.setMajorTickSpacing(5);
sliderGameFeedbackArea.setMaximum(50);
Expand Down Expand Up @@ -2366,8 +2369,8 @@ private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
save(prefs, dialog.sliderEditorCardOffset, KEY_GUI_CARD_OFFSET_SIZE, "true", "false", UPDATE_CACHE_POLICY);
sizeGUIChanged = true;
}
if (getCachedValue(KEY_GUI_SYMBOL_SIZE, 14) != dialog.sliderSymbolSize.getValue()) {
save(prefs, dialog.sliderSymbolSize, KEY_GUI_SYMBOL_SIZE, "true", "false", UPDATE_CACHE_POLICY);
if (getCachedValue(KEY_GUI_STACK_WIDTH, 30) != dialog.sliderStackWidth.getValue()) {
save(prefs, dialog.sliderStackWidth, KEY_GUI_STACK_WIDTH, "true", "false", UPDATE_CACHE_POLICY);
sizeGUIChanged = true;
}
if (getCachedValue(KEY_GUI_TOOLTIP_SIZE, 14) != dialog.sliderTooltipSize.getValue()) {
Expand Down Expand Up @@ -2874,7 +2877,7 @@ private static void loadGuiSize(Preferences prefs) {
load(prefs, dialog.sliderCardSizeHand, KEY_GUI_CARD_HAND_SIZE, "14");
load(prefs, dialog.sliderEditorCardSize, KEY_GUI_CARD_EDITOR_SIZE, "14");
load(prefs, dialog.sliderEditorCardOffset, KEY_GUI_CARD_OFFSET_SIZE, "14");
load(prefs, dialog.sliderSymbolSize, KEY_GUI_SYMBOL_SIZE, "14");
load(prefs, dialog.sliderStackWidth, KEY_GUI_STACK_WIDTH, "14");
load(prefs, dialog.sliderDialogFont, KEY_GUI_DIALOG_FONT_SIZE, "14");
load(prefs, dialog.sliderTooltipSize, KEY_GUI_TOOLTIP_SIZE, "14");
load(prefs, dialog.sliderGameFeedbackArea, KEY_GUI_FEEDBACK_AREA_SIZE, "14");
Expand Down Expand Up @@ -3367,7 +3370,7 @@ public static UserData getUserData() {
private javax.swing.JLabel labelEditorCardSize;
private javax.swing.JLabel labelGameFeedback;
private javax.swing.JLabel labelPreferedImageLanguage;
private javax.swing.JLabel labelSymbolSize;
private javax.swing.JLabel labelStackWidth;
private javax.swing.JLabel labelTooltipSize;
private javax.swing.JLabel lblProxyPassword;
private javax.swing.JLabel lblProxyPort;
Expand Down Expand Up @@ -3398,7 +3401,7 @@ public static UserData getUserData() {
private javax.swing.JSlider sliderEditorCardSize;
private javax.swing.JSlider sliderFontSize;
private javax.swing.JSlider sliderGameFeedbackArea;
private javax.swing.JSlider sliderSymbolSize;
private javax.swing.JSlider sliderStackWidth;
private javax.swing.JSlider sliderTooltipSize;
private javax.swing.JPanel sounds_backgroundMusic;
private javax.swing.JPanel sounds_clips;
Expand Down
Loading

0 comments on commit 35505b2

Please sign in to comment.