New Preferences dialog. Option for big card images in hand. Fixed Issue 80. Fixed Issue 165.

This commit is contained in:
magenoxx 2011-06-26 18:10:50 +04:00
parent 67c1fc8ffa
commit 51e3e238af
9 changed files with 878 additions and 601 deletions

View file

@ -8,6 +8,7 @@ resource-path=/home/loki/.wine/drive_c/Program Files/Wizards of the Coast/Magic
#symbols-resource-path=resources/images/symbols/
#resource-path=resources/images/
card-scaling-factor=0.4
hand-scaling-factor=1.3
# parameters for debugging and testing faster
default-deck-path=C:\\Users\\836D~1\\AppData\\Local\\Temp\\tempDeck1577fd51-f098-420e-8794-c22d2c0602d99142449166006085381.dck

View file

@ -761,7 +761,8 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
}//GEN-LAST:event_btnCollectionViewerActionPerformed
private void btnPreferencesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPreferencesActionPerformed
PhasesDialog.main(new String[]{});
//PhasesDialog.main(new String[]{});
PreferencesDialog.main(new String[]{});
}//GEN-LAST:event_btnPreferencesActionPerformed
public void exitApp() {

View file

@ -152,7 +152,7 @@ public class Cards extends javax.swing.JPanel {
if (!isVisibleIfEmpty) {
cardArea.setVisible(cards.size() > 0);
}
cardArea.setPreferredSize(new Dimension(cards.size() * (Config.dimensions.frameWidth + GAP_X), Config.dimensions.frameHeight));
cardArea.setPreferredSize(new Dimension((int)(cards.size() * (getCardDimension().getWidth() + GAP_X)), (int)(getCardDimension().getHeight())));
cardArea.revalidate();
cardArea.repaint();
this.revalidate();

View file

@ -1,326 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="mage.client.dialog.PhasesDialog">
<grid id="27dc6" binding="panel1" default-binding="true" layout-manager="FormLayout">
<rowspec value="center:d:noGrow"/>
<rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:258px:noGrow"/>
<rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/>
<colspec value="fill:324px:noGrow"/>
<constraints>
<xy x="20" y="20" width="338" height="328"/>
</constraints>
<properties>
<preferredSize width="324" height="324"/>
</properties>
<border type="none"/>
<children>
<component id="9fb3d" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms top="5" left="10" bottom="0" right="0"/>
</constraints>
<properties>
<maximumSize width="88" height="20"/>
<minimumSize width="88" height="20"/>
<preferredSize width="88" height="20"/>
<text value="Stop on (yes/no)"/>
</properties>
</component>
<grid id="fdb69" layout-manager="GridLayoutManager" row-count="8" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="9" fill="0" indent="1" use-parent-layout="false"/>
<forms top="0" left="18" bottom="0" right="0" defaultalign-horz="false" defaultalign-vert="false"/>
</constraints>
<properties>
<minimumSize width="0" height="0"/>
<preferredSize width="300" height="250"/>
</properties>
<border type="none"/>
<children>
<component id="7d72e" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="107" height="16"/>
</grid>
</constraints>
<properties>
<text value="Upkeep:"/>
</properties>
</component>
<component id="1c51d" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="107" height="16"/>
</grid>
</constraints>
<properties>
<text value="Draw:"/>
</properties>
</component>
<component id="223" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="107" height="16"/>
</grid>
</constraints>
<properties>
<text value="Main:"/>
</properties>
</component>
<component id="af314" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="107" height="16"/>
</grid>
</constraints>
<properties>
<text value="Before combat:"/>
</properties>
</component>
<component id="466d5" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="107" height="16"/>
</grid>
</constraints>
<properties>
<text value="End of combat:"/>
</properties>
</component>
<component id="9f357" class="javax.swing.JLabel">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="107" height="16"/>
</grid>
</constraints>
<properties>
<text value="Main 2:"/>
</properties>
</component>
<component id="8b3cb" class="javax.swing.JLabel">
<constraints>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="107" height="16"/>
</grid>
</constraints>
<properties>
<text value="End of turn:"/>
</properties>
</component>
<component id="f062b" class="javax.swing.JCheckBox" binding="checkBoxUpkeepYou" default-binding="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="d1440" class="javax.swing.JCheckBox" binding="checkBoxDrawYou">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="155dc" class="javax.swing.JCheckBox" binding="checkBoxMainYou">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="88fe1" class="javax.swing.JCheckBox" binding="checkBoxBeforeCYou">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="7b4cb" class="javax.swing.JCheckBox" binding="checkBoxEndCYou">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="97db2" class="javax.swing.JCheckBox" binding="checkBoxMain2You">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="8cc2a" class="javax.swing.JCheckBox" binding="checkBoxEndTurnYou">
<constraints>
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="b48fc" class="javax.swing.JCheckBox" binding="checkBoxUpkeepOthers">
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="55967" class="javax.swing.JCheckBox" binding="checkBoxDrawOthers">
<constraints>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="f142a" class="javax.swing.JCheckBox" binding="checkBoxMainOthers">
<constraints>
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="a600b" class="javax.swing.JCheckBox" binding="checkBoxBeforeCOthers">
<constraints>
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="e145c" class="javax.swing.JCheckBox" binding="checkBoxEndCOthers">
<constraints>
<grid row="5" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="2c120" class="javax.swing.JCheckBox" binding="checkBoxMain2Others">
<constraints>
<grid row="6" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="167d6" class="javax.swing.JCheckBox" binding="checkBoxEndTurnOthers">
<constraints>
<grid row="7" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="10" height="21"/>
</grid>
</constraints>
<properties>
<selected value="true"/>
<text value=""/>
</properties>
</component>
<component id="e8c16" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="107" height="0"/>
</grid>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="dd6f6" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="61" height="16"/>
</grid>
</constraints>
<properties>
<horizontalTextPosition value="0"/>
<text value="Your turn"/>
</properties>
</component>
<component id="75ed" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="61" height="16"/>
</grid>
</constraints>
<properties>
<horizontalTextPosition value="0"/>
<text value="Others turn"/>
</properties>
</component>
</children>
</grid>
<grid id="576d2" layout-manager="FlowLayout" hgap="5" vgap="5" flow-align="2">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<forms/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="322f" class="javax.swing.JButton" binding="OKButton" default-binding="true">
<constraints/>
<properties>
<inheritsPopupMenu value="true"/>
<label value="Save"/>
<text value="Save"/>
</properties>
</component>
<component id="5adbd" class="javax.swing.JButton" binding="cancelButton" default-binding="true">
<constraints/>
<properties>
<text value="&amp;Cancel"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</form>

View file

@ -1,265 +0,0 @@
package mage.client.dialog;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import mage.client.MageFrame;
import static mage.client.util.PhaseManager.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 12.12.10
* Time: 13:48
* To change this template use File | Settings | File Templates.
*/
public class PhasesDialog {
private JPanel panel1;
private JCheckBox checkBoxUpkeepYou;
private JCheckBox checkBoxUpkeepOthers;
private JCheckBox checkBoxDrawYou;
private JCheckBox checkBoxMainYou;
private JCheckBox checkBoxBeforeCYou;
private JCheckBox checkBoxEndCYou;
private JCheckBox checkBoxMain2You;
private JCheckBox checkBoxEndTurnYou;
private JCheckBox checkBoxDrawOthers;
private JCheckBox checkBoxMainOthers;
private JCheckBox checkBoxBeforeCOthers;
private JCheckBox checkBoxEndCOthers;
private JCheckBox checkBoxMain2Others;
private JCheckBox checkBoxEndTurnOthers;
private JButton OKButton;
private JButton cancelButton;
private static final JFrame fInstance = new JFrame("PhasesDialog");
private static final PhasesDialog dialog = new PhasesDialog();
static {
fInstance.setContentPane(dialog.panel1);
fInstance.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
fInstance.setLocation(300, 200);
fInstance.setResizable(false);
fInstance.setTitle("Configure phase stops");
fInstance.pack();
}
public static void main(String[] args) {
if (!fInstance.isVisible()) {
Preferences prefs = MageFrame.getPreferences();
load(prefs, dialog.checkBoxUpkeepYou, UPKEEP_YOU);
load(prefs, dialog.checkBoxDrawYou, DRAW_YOU);
load(prefs, dialog.checkBoxMainYou, MAIN_YOU);
load(prefs, dialog.checkBoxBeforeCYou, BEFORE_COMBAT_YOU);
load(prefs, dialog.checkBoxEndCYou, END_OF_COMBAT_YOU);
load(prefs, dialog.checkBoxMain2You, MAIN_2_YOU);
load(prefs, dialog.checkBoxEndTurnYou, END_OF_TURN_YOU);
load(prefs, dialog.checkBoxUpkeepOthers, UPKEEP_OTHERS);
load(prefs, dialog.checkBoxDrawOthers, DRAW_OTHERS);
load(prefs, dialog.checkBoxMainOthers, MAIN_OTHERS);
load(prefs, dialog.checkBoxBeforeCOthers, BEFORE_COMBAT_OTHERS);
load(prefs, dialog.checkBoxEndCOthers, END_OF_COMBAT_OTHERS);
load(prefs, dialog.checkBoxMain2Others, MAIN_2_OTHERS);
load(prefs, dialog.checkBoxEndTurnOthers, END_OF_TURN_OTHERS);
fInstance.setVisible(true);
} else {
fInstance.requestFocus();
}
}
private static void load(Preferences prefs, JCheckBox checkBox, String propName) {
String prop = prefs.get(propName, PHASE_ON);
checkBox.setSelected(prop.equals(PHASE_ON));
}
private static void save(Preferences prefs, JCheckBox checkBox, String propName) {
prefs.put(propName, checkBox.isSelected() ? PHASE_ON : PHASE_OFF);
}
public PhasesDialog() {
OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Preferences prefs = MageFrame.getPreferences();
save(prefs, dialog.checkBoxUpkeepYou, "upkeepYou");
save(prefs, dialog.checkBoxDrawYou, "drawYou");
save(prefs, dialog.checkBoxMainYou, "mainYou");
save(prefs, dialog.checkBoxBeforeCYou, "beforeCombatYou");
save(prefs, dialog.checkBoxEndCYou, "endOfCombatYou");
save(prefs, dialog.checkBoxMain2You, "main2You");
save(prefs, dialog.checkBoxEndTurnYou, "endOfTurnYou");
save(prefs, dialog.checkBoxUpkeepOthers, UPKEEP_OTHERS);
save(prefs, dialog.checkBoxDrawOthers, DRAW_OTHERS);
save(prefs, dialog.checkBoxMainOthers, MAIN_OTHERS);
save(prefs, dialog.checkBoxBeforeCOthers, BEFORE_COMBAT_OTHERS);
save(prefs, dialog.checkBoxEndCOthers, END_OF_COMBAT_OTHERS);
save(prefs, dialog.checkBoxMain2Others, MAIN_2_OTHERS);
save(prefs, dialog.checkBoxEndTurnOthers, END_OF_TURN_OTHERS);
try {
prefs.flush();
} catch (BackingStoreException ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(null, "Error: couldn't save phase stops. Please try again.");
}
fInstance.setVisible(false);
}
});
cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
fInstance.setVisible(false);
}
});
}
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
$$$setupUI$$$();
}
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
panel1 = new JPanel();
panel1.setLayout(new FormLayout("fill:324px:noGrow", "center:d:noGrow,top:4dlu:noGrow,center:258px:noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow"));
panel1.setPreferredSize(new Dimension(324, 324));
final JLabel label1 = new JLabel();
label1.setMaximumSize(new Dimension(88, 20));
label1.setMinimumSize(new Dimension(88, 20));
label1.setPreferredSize(new Dimension(88, 20));
label1.setText("Stop on (yes/no)");
CellConstraints cc = new CellConstraints();
panel1.add(label1, new CellConstraints(1, 1, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(5, 10, 0, 0)));
final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(8, 3, new Insets(0, 0, 0, 0), -1, -1));
panel2.setMinimumSize(new Dimension(0, 0));
panel2.setPreferredSize(new Dimension(300, 250));
panel1.add(panel2, new CellConstraints(1, 3, 1, 1, CellConstraints.LEFT, CellConstraints.TOP, new Insets(0, 18, 0, 0)));
final JLabel label2 = new JLabel();
label2.setText("Upkeep:");
panel2.add(label2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(107, 16), null, 0, false));
final JLabel label3 = new JLabel();
label3.setText("Draw:");
panel2.add(label3, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(107, 16), null, 0, false));
final JLabel label4 = new JLabel();
label4.setText("Main:");
panel2.add(label4, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(107, 16), null, 0, false));
final JLabel label5 = new JLabel();
label5.setText("Before combat:");
panel2.add(label5, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(107, 16), null, 0, false));
final JLabel label6 = new JLabel();
label6.setText("End of combat:");
panel2.add(label6, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(107, 16), null, 0, false));
final JLabel label7 = new JLabel();
label7.setText("Main 2:");
panel2.add(label7, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(107, 16), null, 0, false));
final JLabel label8 = new JLabel();
label8.setText("End of turn:");
panel2.add(label8, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(107, 16), null, 0, false));
checkBoxUpkeepYou = new JCheckBox();
checkBoxUpkeepYou.setSelected(true);
checkBoxUpkeepYou.setText("");
panel2.add(checkBoxUpkeepYou, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxDrawYou = new JCheckBox();
checkBoxDrawYou.setSelected(true);
checkBoxDrawYou.setText("");
panel2.add(checkBoxDrawYou, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxMainYou = new JCheckBox();
checkBoxMainYou.setSelected(true);
checkBoxMainYou.setText("");
panel2.add(checkBoxMainYou, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxBeforeCYou = new JCheckBox();
checkBoxBeforeCYou.setSelected(true);
checkBoxBeforeCYou.setText("");
panel2.add(checkBoxBeforeCYou, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxEndCYou = new JCheckBox();
checkBoxEndCYou.setSelected(true);
checkBoxEndCYou.setText("");
panel2.add(checkBoxEndCYou, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxMain2You = new JCheckBox();
checkBoxMain2You.setSelected(true);
checkBoxMain2You.setText("");
panel2.add(checkBoxMain2You, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxEndTurnYou = new JCheckBox();
checkBoxEndTurnYou.setSelected(true);
checkBoxEndTurnYou.setText("");
panel2.add(checkBoxEndTurnYou, new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxUpkeepOthers = new JCheckBox();
checkBoxUpkeepOthers.setSelected(true);
checkBoxUpkeepOthers.setText("");
panel2.add(checkBoxUpkeepOthers, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxDrawOthers = new JCheckBox();
checkBoxDrawOthers.setSelected(true);
checkBoxDrawOthers.setText("");
panel2.add(checkBoxDrawOthers, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxMainOthers = new JCheckBox();
checkBoxMainOthers.setSelected(true);
checkBoxMainOthers.setText("");
panel2.add(checkBoxMainOthers, new GridConstraints(3, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxBeforeCOthers = new JCheckBox();
checkBoxBeforeCOthers.setSelected(true);
checkBoxBeforeCOthers.setText("");
panel2.add(checkBoxBeforeCOthers, new GridConstraints(4, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxEndCOthers = new JCheckBox();
checkBoxEndCOthers.setSelected(true);
checkBoxEndCOthers.setText("");
panel2.add(checkBoxEndCOthers, new GridConstraints(5, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxMain2Others = new JCheckBox();
checkBoxMain2Others.setSelected(true);
checkBoxMain2Others.setText("");
panel2.add(checkBoxMain2Others, new GridConstraints(6, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
checkBoxEndTurnOthers = new JCheckBox();
checkBoxEndTurnOthers.setSelected(true);
checkBoxEndTurnOthers.setText("");
panel2.add(checkBoxEndTurnOthers, new GridConstraints(7, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(10, 21), null, 0, false));
final JLabel label9 = new JLabel();
label9.setText("");
panel2.add(label9, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(107, 0), null, 0, false));
final JLabel label10 = new JLabel();
label10.setHorizontalTextPosition(0);
label10.setText("Your turn");
panel2.add(label10, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(61, 16), null, 0, false));
final JLabel label11 = new JLabel();
label11.setHorizontalTextPosition(0);
label11.setText("Others turn");
panel2.add(label11, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(61, 16), null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 5));
panel1.add(panel3, cc.xy(1, 5));
OKButton = new JButton();
OKButton.setInheritsPopupMenu(true);
OKButton.setLabel("Save");
OKButton.setText("Save");
panel3.add(OKButton);
cancelButton = new JButton();
cancelButton.setText("Cancel");
cancelButton.setMnemonic('C');
cancelButton.setDisplayedMnemonicIndex(0);
panel3.add(cancelButton);
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return panel1;
}
}

View file

@ -0,0 +1,385 @@
<?xml version="1.1" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" value="Preferences"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jTabbedPane1" alignment="0" pref="448" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="320" max="32767" attributes="0"/>
<Component id="saveButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="exitButton" min="-2" pref="55" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jTabbedPane1" min="-2" pref="292" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="exitButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="saveButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Main">
<Property name="tabTitle" type="java.lang.String" value="Main"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel3" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="173" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Hand"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="showToolTipsInHand" min="-2" max="-2" attributes="0"/>
<Component id="displayBigCardsInHand" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="170" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="showToolTipsInHand" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="displayBigCardsInHand" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JCheckBox" name="showToolTipsInHand">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Show tooltips"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="showToolTipsInHandActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="displayBigCardsInHand">
<Properties>
<Property name="text" type="java.lang.String" value="Use big images (for high resolution screens)"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="displayBigCardsInHandActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Phases">
<Property name="tabTitle" type="java.lang.String" value="Phases"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="77" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="checkBoxDrawYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxUpkeepYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMainYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxBeforeCYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndOfCYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMain2You" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndTurnYou" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="78" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="checkBoxUpkeepOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxBeforeCOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMainOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndOfCOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxDrawOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMain2Others" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndTurnOthers" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Component id="jLabel4" alignment="0" max="32767" attributes="1"/>
<Component id="jLabel3" alignment="0" max="32767" attributes="1"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="109" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="checkBoxUpkeepOthers" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<Component id="jLabel9" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="checkBoxUpkeepYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxDrawYou" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxDrawOthers" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel4" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMainYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMainOthers" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel5" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxBeforeCYou" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Component id="checkBoxBeforeCOthers" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndOfCYou" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndOfCOthers" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMain2You" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMain2Others" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="checkBoxEndTurnYou" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndTurnOthers" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="24" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Choose phases MAGE will stop on:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Upkeep:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="Draw:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="Main:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" value="Before combat:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="End of combat:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value="Main 2:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" value="End of turn:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<Properties>
<Property name="text" type="java.lang.String" value="Your turn"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="text" type="java.lang.String" value="Opponent(s) turn"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxUpkeepYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxDrawYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxMainYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxBeforeCYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxEndOfCYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxMain2You">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxEndTurnYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxUpkeepOthers">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxDrawOthers">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxMainOthers">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxBeforeCOthers">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxEndOfCOthers">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxMain2Others">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxEndTurnOthers">
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="saveButton">
<Properties>
<Property name="label" type="java.lang.String" value="Save"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="exitButton">
<Properties>
<Property name="label" type="java.lang.String" value="Exit"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="exitButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

View file

@ -0,0 +1,463 @@
/*
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
/*
* PreferencesDialog.java
*
* Created on 26.06.2011, 16:35:40
*/
package mage.client.dialog;
import java.util.prefs.BackingStoreException;
import mage.client.MageFrame;
import javax.swing.*;
import java.util.prefs.Preferences;
import static mage.client.util.PhaseManager.*;
import static mage.client.util.PhaseManager.END_OF_TURN_OTHERS;
/**
* Preferences dialog.
*
* @author nantuko
*/
public class PreferencesDialog extends javax.swing.JDialog {
public static final String KEY_HAND_USE_BIG_CARDS = "handUseBigCards";
/** Creates new form PreferencesDialog */
public PreferencesDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jPanel3 = new javax.swing.JPanel();
showToolTipsInHand = new javax.swing.JCheckBox();
displayBigCardsInHand = new javax.swing.JCheckBox();
jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
checkBoxUpkeepYou = new javax.swing.JCheckBox();
checkBoxDrawYou = new javax.swing.JCheckBox();
checkBoxMainYou = new javax.swing.JCheckBox();
checkBoxBeforeCYou = new javax.swing.JCheckBox();
checkBoxEndOfCYou = new javax.swing.JCheckBox();
checkBoxMain2You = new javax.swing.JCheckBox();
checkBoxEndTurnYou = new javax.swing.JCheckBox();
checkBoxUpkeepOthers = new javax.swing.JCheckBox();
checkBoxDrawOthers = new javax.swing.JCheckBox();
checkBoxMainOthers = new javax.swing.JCheckBox();
checkBoxBeforeCOthers = new javax.swing.JCheckBox();
checkBoxEndOfCOthers = new javax.swing.JCheckBox();
checkBoxMain2Others = new javax.swing.JCheckBox();
checkBoxEndTurnOthers = new javax.swing.JCheckBox();
saveButton = new javax.swing.JButton();
exitButton = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Preferences");
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Hand"));
showToolTipsInHand.setSelected(true);
showToolTipsInHand.setText("Show tooltips");
showToolTipsInHand.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
showToolTipsInHandActionPerformed(evt);
}
});
displayBigCardsInHand.setText("Use big images (for high resolution screens)");
displayBigCardsInHand.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
displayBigCardsInHandActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(showToolTipsInHand)
.addComponent(displayBigCardsInHand))
.addContainerGap(170, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(showToolTipsInHand)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(displayBigCardsInHand)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(173, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Main", jPanel1);
jLabel1.setText("Choose phases MAGE will stop on:");
jLabel2.setText("Upkeep:");
jLabel3.setText("Draw:");
jLabel4.setText("Main:");
jLabel5.setText("Before combat:");
jLabel6.setText("End of combat:");
jLabel7.setText("Main 2:");
jLabel8.setText("End of turn:");
jLabel9.setText("Your turn");
jLabel10.setText("Opponent(s) turn");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(20, 20, 20)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel8))
.addGap(77, 77, 77)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(2, 2, 2)
.addComponent(jLabel9)
.addGap(32, 32, 32)
.addComponent(jLabel10))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(13, 13, 13)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxDrawYou)
.addComponent(checkBoxUpkeepYou)
.addComponent(checkBoxMainYou)
.addComponent(checkBoxBeforeCYou)
.addComponent(checkBoxEndOfCYou)
.addComponent(checkBoxMain2You)
.addComponent(checkBoxEndTurnYou))
.addGap(78, 78, 78)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxUpkeepOthers)
.addComponent(checkBoxBeforeCOthers)
.addComponent(checkBoxMainOthers)
.addComponent(checkBoxEndOfCOthers)
.addComponent(checkBoxDrawOthers)
.addComponent(checkBoxMain2Others)
.addComponent(checkBoxEndTurnOthers)))))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)))
.addContainerGap(109, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(checkBoxUpkeepOthers))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(20, 20, 20))
.addComponent(jLabel9))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxUpkeepYou)
.addComponent(jLabel2))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel3)
.addComponent(checkBoxDrawYou)
.addComponent(checkBoxDrawOthers))
.addGap(4, 4, 4)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel4)
.addComponent(checkBoxMainYou)
.addComponent(checkBoxMainOthers))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxBeforeCYou, javax.swing.GroupLayout.Alignment.TRAILING)))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(checkBoxBeforeCOthers)))
.addGap(7, 7, 7)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel6)
.addComponent(checkBoxEndOfCYou)
.addComponent(checkBoxEndOfCOthers))
.addGap(9, 9, 9)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel7)
.addComponent(checkBoxMain2You)
.addComponent(checkBoxMain2Others))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxEndTurnYou)
.addComponent(jLabel8)
.addComponent(checkBoxEndTurnOthers))
.addContainerGap(24, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Phases", jPanel2);
saveButton.setLabel("Save");
saveButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveButtonActionPerformed(evt);
}
});
exitButton.setLabel("Exit");
exitButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 448, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(320, Short.MAX_VALUE)
.addComponent(saveButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 292, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(exitButton)
.addComponent(saveButton))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
Preferences prefs = MageFrame.getPreferences();
save(prefs, dialog.checkBoxUpkeepYou, UPKEEP_YOU);
save(prefs, dialog.checkBoxDrawYou, DRAW_YOU);
save(prefs, dialog.checkBoxMainYou, MAIN_YOU);
save(prefs, dialog.checkBoxBeforeCYou, BEFORE_COMBAT_YOU);
save(prefs, dialog.checkBoxEndOfCYou, END_OF_COMBAT_YOU);
save(prefs, dialog.checkBoxMain2You, MAIN_2_YOU);
save(prefs, dialog.checkBoxEndTurnYou, END_OF_TURN_YOU);
save(prefs, dialog.checkBoxUpkeepOthers, UPKEEP_OTHERS);
save(prefs, dialog.checkBoxDrawOthers, DRAW_OTHERS);
save(prefs, dialog.checkBoxMainOthers, MAIN_OTHERS);
save(prefs, dialog.checkBoxBeforeCOthers, BEFORE_COMBAT_OTHERS);
save(prefs, dialog.checkBoxEndOfCOthers, END_OF_COMBAT_OTHERS);
save(prefs, dialog.checkBoxMain2Others, MAIN_2_OTHERS);
save(prefs, dialog.checkBoxEndTurnOthers, END_OF_TURN_OTHERS);
save(prefs, dialog.displayBigCardsInHand, KEY_HAND_USE_BIG_CARDS, "true", "false");
try {
prefs.flush();
} catch (BackingStoreException ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(null, "Error: couldn't save phase stops. Please try again.");
}
dialog.setVisible(false);
}//GEN-LAST:event_saveButtonActionPerformed
private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitButtonActionPerformed
dialog.setVisible(false);
}//GEN-LAST:event_exitButtonActionPerformed
private void showToolTipsInHandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showToolTipsInHandActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_showToolTipsInHandActionPerformed
private void displayBigCardsInHandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displayBigCardsInHandActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_displayBigCardsInHandActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
if (!dialog.isVisible()) {
Preferences prefs = MageFrame.getPreferences();
load(prefs, dialog.checkBoxUpkeepYou, UPKEEP_YOU);
load(prefs, dialog.checkBoxDrawYou, DRAW_YOU);
load(prefs, dialog.checkBoxMainYou, MAIN_YOU);
load(prefs, dialog.checkBoxBeforeCYou, BEFORE_COMBAT_YOU);
load(prefs, dialog.checkBoxEndOfCYou, END_OF_COMBAT_YOU);
load(prefs, dialog.checkBoxMain2You, MAIN_2_YOU);
load(prefs, dialog.checkBoxEndTurnYou, END_OF_TURN_YOU);
load(prefs, dialog.checkBoxUpkeepOthers, UPKEEP_OTHERS);
load(prefs, dialog.checkBoxDrawOthers, DRAW_OTHERS);
load(prefs, dialog.checkBoxMainOthers, MAIN_OTHERS);
load(prefs, dialog.checkBoxBeforeCOthers, BEFORE_COMBAT_OTHERS);
load(prefs, dialog.checkBoxEndOfCOthers, END_OF_COMBAT_OTHERS);
load(prefs, dialog.checkBoxMain2Others, MAIN_2_OTHERS);
load(prefs, dialog.checkBoxEndTurnOthers, END_OF_TURN_OTHERS);
load(prefs, dialog.displayBigCardsInHand, KEY_HAND_USE_BIG_CARDS, "true");
dialog.setLocation(300, 200);
dialog.reset();
dialog.setVisible(true);
} else {
dialog.requestFocus();
}
}
});
}
private static void load(Preferences prefs, JCheckBox checkBox, String propName, String yesValue) {
String prop = prefs.get(propName, yesValue);
checkBox.setSelected(prop.equals(yesValue));
}
private static void load(Preferences prefs, JCheckBox checkBox, String propName) {
load(prefs, checkBox, propName, PHASE_ON);
}
private static void save(Preferences prefs, JCheckBox checkBox, String propName) {
save(prefs, checkBox, propName, PHASE_ON, PHASE_OFF);
}
private static void save(Preferences prefs, JCheckBox checkBox, String propName, String yesValue, String onValue) {
prefs.put(propName, checkBox.isSelected() ? yesValue : onValue);
}
public void reset() {
jTabbedPane1.setSelectedIndex(0);
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox checkBoxBeforeCOthers;
private javax.swing.JCheckBox checkBoxBeforeCYou;
private javax.swing.JCheckBox checkBoxDrawOthers;
private javax.swing.JCheckBox checkBoxDrawYou;
private javax.swing.JCheckBox checkBoxEndOfCOthers;
private javax.swing.JCheckBox checkBoxEndOfCYou;
private javax.swing.JCheckBox checkBoxEndTurnOthers;
private javax.swing.JCheckBox checkBoxEndTurnYou;
private javax.swing.JCheckBox checkBoxMain2Others;
private javax.swing.JCheckBox checkBoxMain2You;
private javax.swing.JCheckBox checkBoxMainOthers;
private javax.swing.JCheckBox checkBoxMainYou;
private javax.swing.JCheckBox checkBoxUpkeepOthers;
private javax.swing.JCheckBox checkBoxUpkeepYou;
private javax.swing.JCheckBox displayBigCardsInHand;
private javax.swing.JButton exitButton;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JButton saveButton;
private javax.swing.JCheckBox showToolTipsInHand;
// End of variables declaration//GEN-END:variables
private static final PreferencesDialog dialog = new PreferencesDialog(new javax.swing.JFrame(), true);
static {
dialog.setResizable(false);
}
}

View file

@ -42,6 +42,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.prefs.Preferences;
import javax.swing.*;
import javax.swing.border.Border;
@ -52,11 +53,7 @@ import mage.Constants;
import mage.client.MageFrame;
import mage.client.cards.Cards;
import mage.client.chat.ChatPanel;
import mage.client.dialog.CombatDialog;
import mage.client.dialog.ExileZoneDialog;
import mage.client.dialog.PickChoiceDialog;
import mage.client.dialog.PickNumberDialog;
import mage.client.dialog.ShowCardsDialog;
import mage.client.dialog.*;
import mage.client.game.FeedbackPanel.FeedbackMode;
import mage.client.plugins.impl.Plugins;
import mage.remote.Session;
@ -84,7 +81,17 @@ public class GamePanel extends javax.swing.JPanel {
private CombatDialog combat;
private PickNumberDialog pickNumber;
private static final Dimension handCardDimension = new Dimension(75, (int)(75 * 3.5f / 2.5f));
private static final int HAND_CARD_WIDTH = 75;
private static final Dimension handCardDimension = new Dimension(HAND_CARD_WIDTH, (int)(HAND_CARD_WIDTH * 3.5f / 2.5f));
private static final Dimension handCardDimensionBig;
static {
double factor = Config.handScalingFactor;
if (factor < 1) factor = 1;
if (factor > 2) factor = 2;
int width = (int)(factor * HAND_CARD_WIDTH);
handCardDimensionBig = new Dimension(width, (int)(width * 3.5f / 2.5f));
}
/** Creates new form GamePanel */
public GamePanel() {
@ -293,7 +300,7 @@ public class GamePanel extends javax.swing.JPanel {
} else {
this.hand.loadCards(game.getHand(), bigCard, gameId);
int count = game.getHand().size();
hand.setPreferredSize(new java.awt.Dimension((handCardDimension.width + 5) * count + 5, handCardDimension.height + 20)); // for scroll
hand.setPreferredSize(new java.awt.Dimension((getHandCardDimension().width + 5) * count + 5, getHandCardDimension().height + 20)); // for scroll
}
if (game.getPhase() != null)
this.txtPhase.setText(game.getPhase().toString());
@ -535,7 +542,7 @@ public class GamePanel extends javax.swing.JPanel {
gameChatPanel.disableInput();
jTabbedPane1 = new JTabbedPane();
hand.setCardDimension(handCardDimension);
hand.setCardDimension(getHandCardDimension());
jSplitPane1.setBorder(null);
jSplitPane1.setDividerSize(7);
@ -834,6 +841,15 @@ public class GamePanel extends javax.swing.JPanel {
session.previousPlay(gameId);
}//GEN-LAST:event_btnPreviousPlayActionPerformed
private Dimension getHandCardDimension() {
Preferences pref = MageFrame.getPreferences();
String useBigCards = pref.get(PreferencesDialog.KEY_HAND_USE_BIG_CARDS, "false");
if (useBigCards.equals("true")) {
return handCardDimensionBig;
}
return handCardDimension;
}
private class HandContainer extends JPanel {
public HandContainer(Cards hand) {

View file

@ -48,6 +48,7 @@ public class Config {
public static final String serverName;
public static final int port;
public static final double cardScalingFactor;
public static final double handScalingFactor;
public static final CardDimensions dimensions;
public static final String defaultGameType;
@ -66,6 +67,7 @@ public class Config {
port = Integer.parseInt(p.getProperty("port"));
remoteServer = p.getProperty("remote-server");
cardScalingFactor = Double.valueOf(p.getProperty("card-scaling-factor"));
handScalingFactor = Double.valueOf(p.getProperty("hand-scaling-factor"));
defaultGameType = p.getProperty("default-game-type", "Human");
defaultDeckPath = p.getProperty("default-deck-path");
defaultOtherPlayerIndex = p.getProperty("default-other-player-index");