mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Some more changes to GUI to better support high screen resolutions.
This commit is contained in:
parent
1a12c2b08f
commit
f7a7b2e7a0
16 changed files with 464 additions and 141 deletions
|
|
@ -1068,11 +1068,9 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
if (setActive) {
|
||||
setActive(tablesPane);
|
||||
} else // if other panel was already shown, mamke sure it's topmost again
|
||||
{
|
||||
if (topPanebefore != null) {
|
||||
if (topPanebefore != null) {
|
||||
setActive(topPanebefore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void hideGames() {
|
||||
|
|
@ -1470,7 +1468,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
|
||||
Plugins.getInstance().changeGUISize();
|
||||
CountryUtil.changeGUISize();
|
||||
for (Component component : desktopPane.getComponents()) {
|
||||
if (component instanceof MageDialog) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Card.java
|
||||
*
|
||||
* Created on 17-Dec-2009, 9:20:50 PM
|
||||
|
|
@ -222,6 +222,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis
|
|||
|
||||
@Override
|
||||
public void updateImage() {
|
||||
|
||||
}
|
||||
|
||||
protected String getText(String cardType) {
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ public class Cards extends javax.swing.JPanel {
|
|||
for (MageCard mageCard : cards.values()) {
|
||||
mageCard.setCardBounds(0, 0, getCardDimension().width, getCardDimension().height);
|
||||
mageCard.updateImage();
|
||||
mageCard.doLayout();
|
||||
}
|
||||
layoutCards();
|
||||
sizeCards(cardDimension);
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@
|
|||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="cards" alignment="1" pref="239" max="32767" attributes="0"/>
|
||||
<Component id="cards" alignment="0" pref="163" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="cards" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cards" alignment="0" pref="67" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import javax.swing.event.InternalFrameAdapter;
|
|||
import javax.swing.event.InternalFrameEvent;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.util.Config;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.SettingsManager;
|
||||
import mage.client.util.gui.GuiDisplayUtil;
|
||||
|
|
@ -106,12 +107,25 @@ public class CardInfoWindowDialog extends MageDialog {
|
|||
// no icon yet
|
||||
}
|
||||
this.setTitelBarToolTip(name);
|
||||
setGUISize();
|
||||
}
|
||||
|
||||
public void cleanUp() {
|
||||
cards.cleanUp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
this.validate();
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
cards.setCardDimension(GUISizeHelper.otherZonesCardDimension);
|
||||
cards.changeGUISize();
|
||||
}
|
||||
|
||||
public void loadCards(ExileView exile, BigCard bigCard, UUID gameId) {
|
||||
boolean changed = cards.loadCards(exile, bigCard, gameId, true);
|
||||
String titel = name + " (" + exile.size() + ")";
|
||||
|
|
@ -204,11 +218,11 @@ public class CardInfoWindowDialog extends MageDialog {
|
|||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(cards, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE)
|
||||
.addComponent(cards, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(cards, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cards, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
pack();
|
||||
|
|
|
|||
|
|
@ -372,6 +372,14 @@
|
|||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="tabGuiSize">
|
||||
<Properties>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[527, 423]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[527, 423]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||
<JTabbedPaneConstraints tabName="GUI Size">
|
||||
|
|
@ -383,11 +391,11 @@
|
|||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="guiSize_font" pref="507" max="32767" attributes="0"/>
|
||||
<Component id="guiSize_font1" max="32767" attributes="0"/>
|
||||
<Component id="guiSizeBasic" pref="507" max="32767" attributes="0"/>
|
||||
<Component id="guiSizeGame" alignment="0" pref="507" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
|
@ -397,20 +405,20 @@
|
|||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="guiSize_font" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
|
||||
<Component id="guiSize_font1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="66" max="32767" attributes="0"/>
|
||||
<Component id="guiSizeBasic" min="-2" pref="106" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="guiSizeGame" min="-2" pref="191" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="109" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="guiSize_font">
|
||||
<Container class="javax.swing.JPanel" name="guiSizeBasic">
|
||||
<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="Size elements">
|
||||
<TitledBorder title="Size basic elements">
|
||||
<Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
|
|
@ -430,7 +438,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="<HTML>Size of the font."/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the font used to display table text."/>
|
||||
<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/>
|
||||
|
|
@ -467,7 +475,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="<HTML>Size of the chat font."/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the font used to display the chat text"/>
|
||||
<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/>
|
||||
|
|
@ -479,7 +487,7 @@
|
|||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="-1" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="3" insetsRight="3" anchor="11" weightX="0.0" weightY="0.0"/>
|
||||
<GridBagConstraints gridX="4" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="3" insetsRight="3" anchor="11" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
|
|
@ -491,7 +499,7 @@
|
|||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="-1" 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"/>
|
||||
<GridBagConstraints gridX="4" gridY="-1" 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"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
|
|
@ -504,7 +512,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="<HTML>Size of the font."/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the font of messages and menues"/>
|
||||
<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/>
|
||||
|
|
@ -516,25 +524,28 @@
|
|||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="3" insetsRight="3" anchor="11" weightX="0.0" weightY="0.0"/>
|
||||
<GridBagConstraints gridX="2" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="3" insetsRight="3" anchor="11" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelDialogFont">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" value="Size of dialog font"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the font used to display table text."/>
|
||||
<Property name="text" type="java.lang.String" value="Font size of messages and menues"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the font of messages and menues"/>
|
||||
</Properties>
|
||||
<AccessibilityProperties>
|
||||
<Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="<HTML>The size of the font used to display messages or menus."/>
|
||||
</AccessibilityProperties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="-1" 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"/>
|
||||
<GridBagConstraints gridX="2" gridY="-1" 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"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="guiSize_font1">
|
||||
<Container class="javax.swing.JPanel" name="guiSizeGame">
|
||||
<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">
|
||||
|
|
@ -558,7 +569,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="<HTML>Size of the font."/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the card in hand"/>
|
||||
<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">
|
||||
|
|
@ -579,7 +590,7 @@
|
|||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" value="Size of hand cards"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the hand cards"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the card in hand"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
|
|
@ -587,7 +598,7 @@
|
|||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSlider" name="sliderTooltipSize">
|
||||
<Component class="javax.swing.JSlider" name="sliderCardSizeOtherZones">
|
||||
<Properties>
|
||||
<Property name="majorTickSpacing" type="int" value="5"/>
|
||||
<Property name="maximum" type="int" value="50"/>
|
||||
|
|
@ -596,8 +607,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="<HTML>Size of the font."/>
|
||||
<Property name="value" type="int" value="14"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of card in other game zone (e.g. graveyard, revealed cards etc.)"/>
|
||||
<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/>
|
||||
|
|
@ -613,11 +623,11 @@
|
|||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelTooltipSize">
|
||||
<Component class="javax.swing.JLabel" name="labelCardSizeOtherZones">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" value="Tooltip size"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the hand cards"/>
|
||||
<Property name="text" type="java.lang.String" value="Size of other zone cards"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of card in other game zone (e.g. graveyard, revealed cards etc.)"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
|
|
@ -625,6 +635,43 @@
|
|||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSlider" name="sliderCardSizeBattlefield">
|
||||
<Properties>
|
||||
<Property name="majorTickSpacing" type="int" value="5"/>
|
||||
<Property name="maximum" type="int" value="50"/>
|
||||
<Property name="minimum" type="int" value="10"/>
|
||||
<Property name="minorTickSpacing" type="int" value="1"/>
|
||||
<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="<HTML>The maximum size of permanents on the battlefield"/>
|
||||
<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/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[150, 40]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="4" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="3" insetsRight="3" anchor="11" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelCardSizeBattlefield">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" value="Size of permanents"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The maximum size of permanents on the battlefield"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="4" gridY="1" 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"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSlider" name="sliderSymbolSize">
|
||||
<Properties>
|
||||
<Property name="majorTickSpacing" type="int" value="5"/>
|
||||
|
|
@ -634,7 +681,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="<HTML>Size of the font."/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of symbols"/>
|
||||
<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/>
|
||||
|
|
@ -646,7 +693,7 @@
|
|||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="-1" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="3" insetsRight="3" anchor="11" weightX="0.0" weightY="0.0"/>
|
||||
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="3" insetsRight="3" anchor="11" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
|
|
@ -654,7 +701,7 @@
|
|||
<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="<HTML>The size of the font used to display the chat text"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of symbols"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
|
|
@ -662,6 +709,84 @@
|
|||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSlider" name="sliderGameFeedbackArea">
|
||||
<Properties>
|
||||
<Property name="majorTickSpacing" type="int" value="5"/>
|
||||
<Property name="maximum" type="int" value="50"/>
|
||||
<Property name="minimum" type="int" value="10"/>
|
||||
<Property name="minorTickSpacing" type="int" value="1"/>
|
||||
<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="<HTML>The size of the game feedback area (buttons and messages above the hand area)"/>
|
||||
<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/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[150, 40]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="2" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="3" insetsRight="3" anchor="11" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelGameFeedback">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" value="Size game feedback area"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the game feedback area (buttons and messages above the hand area)"/>
|
||||
</Properties>
|
||||
<AccessibilityProperties>
|
||||
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value=""/>
|
||||
</AccessibilityProperties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="2" gridY="-1" 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"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSlider" name="sliderTooltipSize">
|
||||
<Properties>
|
||||
<Property name="majorTickSpacing" type="int" value="5"/>
|
||||
<Property name="maximum" type="int" value="50"/>
|
||||
<Property name="minimum" type="int" value="10"/>
|
||||
<Property name="minorTickSpacing" type="int" value="1"/>
|
||||
<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="<HTML>The size of the tooltip window for cards or permanents"/>
|
||||
<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">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[150, 40]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="4" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="3" insetsRight="3" anchor="11" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelTooltipSize">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" value="Tooltip size"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>The size of the tooltip window for cards or permanents"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="4" gridY="4" 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"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
|
|
|||
|
|
@ -98,6 +98,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
public static final String KEY_GUI_SYMBOL_SIZE = "guiSymbolSize";
|
||||
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";
|
||||
public static final String KEY_GUI_CARD_OTHER_ZONES_SIZE = "guiCardOtherZonesSize";
|
||||
public static final String KEY_GUI_CARD_BATTLEFIELD_SIZE = "guiCardBattlefield";
|
||||
|
||||
public static final String KEY_GAME_LOG_AUTO_SAVE = "gameLogAutoSave";
|
||||
public static final String KEY_DRAFT_LOG_AUTO_SAVE = "draftLogAutoSave";
|
||||
|
|
@ -265,7 +268,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
public static final String KEY_CONNECT_AUTO_CONNECT = "autoConnect";
|
||||
public static final String KEY_CONNECT_FLAG = "connectFlag";
|
||||
|
||||
private static final Map<String, String> cache = new HashMap<>();
|
||||
private static final Map<String, String> CACHE = new HashMap<>();
|
||||
|
||||
private static final Boolean UPDATE_CACHE_POLICY = Boolean.TRUE;
|
||||
|
||||
|
|
@ -275,7 +278,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
public static String PHASE_ON = "on";
|
||||
public static String PHASE_OFF = "off";
|
||||
|
||||
private static final Map<Integer, JPanel> panels = new HashMap<>();
|
||||
private static final Map<Integer, JPanel> PANELS = new HashMap<>();
|
||||
|
||||
private static final Border GREEN_BORDER = BorderFactory.createLineBorder(Color.GREEN, 3);
|
||||
private static final Border BLACK_BORDER = BorderFactory.createLineBorder(Color.BLACK, 3);
|
||||
|
|
@ -363,20 +366,26 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
cbGameLogAutoSave = new javax.swing.JCheckBox();
|
||||
cbDraftLogAutoSave = new javax.swing.JCheckBox();
|
||||
tabGuiSize = new javax.swing.JPanel();
|
||||
guiSize_font = new javax.swing.JPanel();
|
||||
guiSizeBasic = new javax.swing.JPanel();
|
||||
sliderFontSize = new javax.swing.JSlider();
|
||||
fontSizeLabel = new javax.swing.JLabel();
|
||||
sliderChatFontSize = new javax.swing.JSlider();
|
||||
chatFontSizeLabel = new javax.swing.JLabel();
|
||||
sliderDialogFont = new javax.swing.JSlider();
|
||||
labelDialogFont = new javax.swing.JLabel();
|
||||
guiSize_font1 = new javax.swing.JPanel();
|
||||
guiSizeGame = new javax.swing.JPanel();
|
||||
sliderCardSizeHand = new javax.swing.JSlider();
|
||||
labelCardSizeHand = new javax.swing.JLabel();
|
||||
sliderTooltipSize = new javax.swing.JSlider();
|
||||
labelTooltipSize = new javax.swing.JLabel();
|
||||
sliderCardSizeOtherZones = new javax.swing.JSlider();
|
||||
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();
|
||||
sliderGameFeedbackArea = new javax.swing.JSlider();
|
||||
labelGameFeedback = new javax.swing.JLabel();
|
||||
sliderTooltipSize = new javax.swing.JSlider();
|
||||
labelTooltipSize = new javax.swing.JLabel();
|
||||
tabPhases = new javax.swing.JPanel();
|
||||
jLabelHeadLine = new javax.swing.JLabel();
|
||||
jLabelYourTurn = new javax.swing.JLabel();
|
||||
|
|
@ -718,8 +727,11 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
tabsPanel.addTab("Main", tabMain);
|
||||
|
||||
guiSize_font.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Size elements"));
|
||||
guiSize_font.setLayout(new java.awt.GridBagLayout());
|
||||
tabGuiSize.setMaximumSize(new java.awt.Dimension(527, 423));
|
||||
tabGuiSize.setMinimumSize(new java.awt.Dimension(527, 423));
|
||||
|
||||
guiSizeBasic.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Size basic elements"));
|
||||
guiSizeBasic.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
sliderFontSize.setMajorTickSpacing(5);
|
||||
sliderFontSize.setMaximum(50);
|
||||
|
|
@ -728,13 +740,13 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderFontSize.setPaintLabels(true);
|
||||
sliderFontSize.setPaintTicks(true);
|
||||
sliderFontSize.setSnapToTicks(true);
|
||||
sliderFontSize.setToolTipText("<HTML>Size of the font.");
|
||||
sliderFontSize.setToolTipText("<HTML>The size of the font used to display table text.");
|
||||
sliderFontSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderFontSize.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
guiSize_font.add(sliderFontSize, gridBagConstraints);
|
||||
guiSizeBasic.add(sliderFontSize, gridBagConstraints);
|
||||
|
||||
fontSizeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
fontSizeLabel.setText("Size of table font");
|
||||
|
|
@ -744,7 +756,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSize_font.add(fontSizeLabel, gridBagConstraints);
|
||||
guiSizeBasic.add(fontSizeLabel, gridBagConstraints);
|
||||
|
||||
sliderChatFontSize.setMajorTickSpacing(5);
|
||||
sliderChatFontSize.setMaximum(50);
|
||||
|
|
@ -753,24 +765,25 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderChatFontSize.setPaintLabels(true);
|
||||
sliderChatFontSize.setPaintTicks(true);
|
||||
sliderChatFontSize.setSnapToTicks(true);
|
||||
sliderChatFontSize.setToolTipText("<HTML>Size of the chat font.");
|
||||
sliderChatFontSize.setToolTipText("<HTML>The size of the font used to display the chat text");
|
||||
sliderChatFontSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderChatFontSize.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
guiSize_font.add(sliderChatFontSize, gridBagConstraints);
|
||||
guiSizeBasic.add(sliderChatFontSize, gridBagConstraints);
|
||||
|
||||
chatFontSizeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
chatFontSizeLabel.setText("Size of chat font");
|
||||
chatFontSizeLabel.setToolTipText("<HTML>The size of the font used to display the chat text");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSize_font.add(chatFontSizeLabel, gridBagConstraints);
|
||||
guiSizeBasic.add(chatFontSizeLabel, gridBagConstraints);
|
||||
|
||||
sliderDialogFont.setMajorTickSpacing(5);
|
||||
sliderDialogFont.setMaximum(50);
|
||||
|
|
@ -779,26 +792,28 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderDialogFont.setPaintLabels(true);
|
||||
sliderDialogFont.setPaintTicks(true);
|
||||
sliderDialogFont.setSnapToTicks(true);
|
||||
sliderDialogFont.setToolTipText("<HTML>Size of the font.");
|
||||
sliderDialogFont.setToolTipText("<HTML>The size of the font of messages and menues");
|
||||
sliderDialogFont.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderDialogFont.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
guiSize_font.add(sliderDialogFont, gridBagConstraints);
|
||||
guiSizeBasic.add(sliderDialogFont, gridBagConstraints);
|
||||
|
||||
labelDialogFont.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelDialogFont.setText("Size of dialog font");
|
||||
labelDialogFont.setToolTipText("<HTML>The size of the font used to display table text.");
|
||||
labelDialogFont.setText("Font size of messages and menues");
|
||||
labelDialogFont.setToolTipText("<HTML>The size of the font of messages and menues");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSize_font.add(labelDialogFont, gridBagConstraints);
|
||||
guiSizeBasic.add(labelDialogFont, gridBagConstraints);
|
||||
labelDialogFont.getAccessibleContext().setAccessibleDescription("<HTML>The size of the font used to display messages or menus.");
|
||||
|
||||
guiSize_font1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Size game elements"));
|
||||
guiSize_font1.setLayout(new java.awt.GridBagLayout());
|
||||
guiSizeGame.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Size game elements"));
|
||||
guiSizeGame.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
sliderCardSizeHand.setMajorTickSpacing(5);
|
||||
sliderCardSizeHand.setMaximum(50);
|
||||
|
|
@ -807,7 +822,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderCardSizeHand.setPaintLabels(true);
|
||||
sliderCardSizeHand.setPaintTicks(true);
|
||||
sliderCardSizeHand.setSnapToTicks(true);
|
||||
sliderCardSizeHand.setToolTipText("<HTML>Size of the font.");
|
||||
sliderCardSizeHand.setToolTipText("<HTML>The size of the card in hand");
|
||||
sliderCardSizeHand.setValue(14);
|
||||
sliderCardSizeHand.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderCardSizeHand.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
|
|
@ -816,47 +831,74 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
guiSize_font1.add(sliderCardSizeHand, gridBagConstraints);
|
||||
guiSizeGame.add(sliderCardSizeHand, gridBagConstraints);
|
||||
|
||||
labelCardSizeHand.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelCardSizeHand.setText("Size of hand cards");
|
||||
labelCardSizeHand.setToolTipText("<HTML>The size of the hand cards");
|
||||
labelCardSizeHand.setToolTipText("<HTML>The size of the card in hand");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSize_font1.add(labelCardSizeHand, gridBagConstraints);
|
||||
guiSizeGame.add(labelCardSizeHand, gridBagConstraints);
|
||||
|
||||
sliderTooltipSize.setMajorTickSpacing(5);
|
||||
sliderTooltipSize.setMaximum(50);
|
||||
sliderTooltipSize.setMinimum(10);
|
||||
sliderTooltipSize.setMinorTickSpacing(1);
|
||||
sliderTooltipSize.setPaintLabels(true);
|
||||
sliderTooltipSize.setPaintTicks(true);
|
||||
sliderTooltipSize.setSnapToTicks(true);
|
||||
sliderTooltipSize.setToolTipText("<HTML>Size of the font.");
|
||||
sliderTooltipSize.setValue(14);
|
||||
sliderTooltipSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderTooltipSize.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
sliderCardSizeOtherZones.setMajorTickSpacing(5);
|
||||
sliderCardSizeOtherZones.setMaximum(50);
|
||||
sliderCardSizeOtherZones.setMinimum(10);
|
||||
sliderCardSizeOtherZones.setMinorTickSpacing(1);
|
||||
sliderCardSizeOtherZones.setPaintLabels(true);
|
||||
sliderCardSizeOtherZones.setPaintTicks(true);
|
||||
sliderCardSizeOtherZones.setSnapToTicks(true);
|
||||
sliderCardSizeOtherZones.setToolTipText("<HTML>The size of card in other game zone (e.g. graveyard, revealed cards etc.)");
|
||||
sliderCardSizeOtherZones.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderCardSizeOtherZones.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
guiSize_font1.add(sliderTooltipSize, gridBagConstraints);
|
||||
guiSizeGame.add(sliderCardSizeOtherZones, gridBagConstraints);
|
||||
|
||||
labelTooltipSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelTooltipSize.setText("Tooltip size");
|
||||
labelTooltipSize.setToolTipText("<HTML>The size of the hand cards");
|
||||
labelCardSizeOtherZones.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelCardSizeOtherZones.setText("Size of other zone cards");
|
||||
labelCardSizeOtherZones.setToolTipText("<HTML>The size of card in other game zone (e.g. graveyard, revealed cards etc.)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSize_font1.add(labelTooltipSize, gridBagConstraints);
|
||||
guiSizeGame.add(labelCardSizeOtherZones, gridBagConstraints);
|
||||
|
||||
sliderCardSizeBattlefield.setMajorTickSpacing(5);
|
||||
sliderCardSizeBattlefield.setMaximum(50);
|
||||
sliderCardSizeBattlefield.setMinimum(10);
|
||||
sliderCardSizeBattlefield.setMinorTickSpacing(1);
|
||||
sliderCardSizeBattlefield.setPaintLabels(true);
|
||||
sliderCardSizeBattlefield.setPaintTicks(true);
|
||||
sliderCardSizeBattlefield.setSnapToTicks(true);
|
||||
sliderCardSizeBattlefield.setToolTipText("<HTML>The maximum size of permanents on the battlefield");
|
||||
sliderCardSizeBattlefield.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderCardSizeBattlefield.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
guiSizeGame.add(sliderCardSizeBattlefield, gridBagConstraints);
|
||||
|
||||
labelCardSizeBattlefield.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelCardSizeBattlefield.setText("Size of permanents");
|
||||
labelCardSizeBattlefield.setToolTipText("<HTML>The maximum size of permanents on the battlefield");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSizeGame.add(labelCardSizeBattlefield, gridBagConstraints);
|
||||
|
||||
sliderSymbolSize.setMajorTickSpacing(5);
|
||||
sliderSymbolSize.setMaximum(50);
|
||||
|
|
@ -865,24 +907,82 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderSymbolSize.setPaintLabels(true);
|
||||
sliderSymbolSize.setPaintTicks(true);
|
||||
sliderSymbolSize.setSnapToTicks(true);
|
||||
sliderSymbolSize.setToolTipText("<HTML>Size of the font.");
|
||||
sliderSymbolSize.setToolTipText("<HTML>The size of symbols");
|
||||
sliderSymbolSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderSymbolSize.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
guiSize_font1.add(sliderSymbolSize, gridBagConstraints);
|
||||
guiSizeGame.add(sliderSymbolSize, gridBagConstraints);
|
||||
|
||||
labelSymbolSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelSymbolSize.setText("Symbol size");
|
||||
labelSymbolSize.setToolTipText("<HTML>The size of the font used to display the chat text");
|
||||
labelSymbolSize.setToolTipText("<HTML>The size of symbols");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSize_font1.add(labelSymbolSize, gridBagConstraints);
|
||||
guiSizeGame.add(labelSymbolSize, gridBagConstraints);
|
||||
|
||||
sliderGameFeedbackArea.setMajorTickSpacing(5);
|
||||
sliderGameFeedbackArea.setMaximum(50);
|
||||
sliderGameFeedbackArea.setMinimum(10);
|
||||
sliderGameFeedbackArea.setMinorTickSpacing(1);
|
||||
sliderGameFeedbackArea.setPaintLabels(true);
|
||||
sliderGameFeedbackArea.setPaintTicks(true);
|
||||
sliderGameFeedbackArea.setSnapToTicks(true);
|
||||
sliderGameFeedbackArea.setToolTipText("<HTML>The size of the game feedback area (buttons and messages above the hand area)");
|
||||
sliderGameFeedbackArea.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderGameFeedbackArea.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
guiSizeGame.add(sliderGameFeedbackArea, gridBagConstraints);
|
||||
|
||||
labelGameFeedback.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelGameFeedback.setText("Size game feedback area");
|
||||
labelGameFeedback.setToolTipText("<HTML>The size of the game feedback area (buttons and messages above the hand area)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSizeGame.add(labelGameFeedback, gridBagConstraints);
|
||||
labelGameFeedback.getAccessibleContext().setAccessibleName("");
|
||||
|
||||
sliderTooltipSize.setMajorTickSpacing(5);
|
||||
sliderTooltipSize.setMaximum(50);
|
||||
sliderTooltipSize.setMinimum(10);
|
||||
sliderTooltipSize.setMinorTickSpacing(1);
|
||||
sliderTooltipSize.setPaintLabels(true);
|
||||
sliderTooltipSize.setPaintTicks(true);
|
||||
sliderTooltipSize.setSnapToTicks(true);
|
||||
sliderTooltipSize.setToolTipText("<HTML>The size of the tooltip window for cards or permanents");
|
||||
sliderTooltipSize.setValue(14);
|
||||
sliderTooltipSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderTooltipSize.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
guiSizeGame.add(sliderTooltipSize, gridBagConstraints);
|
||||
|
||||
labelTooltipSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelTooltipSize.setText("Tooltip size");
|
||||
labelTooltipSize.setToolTipText("<HTML>The size of the tooltip window for cards or permanents");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSizeGame.add(labelTooltipSize, gridBagConstraints);
|
||||
|
||||
org.jdesktop.layout.GroupLayout tabGuiSizeLayout = new org.jdesktop.layout.GroupLayout(tabGuiSize);
|
||||
tabGuiSize.setLayout(tabGuiSizeLayout);
|
||||
|
|
@ -891,18 +991,18 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.add(tabGuiSizeLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(tabGuiSizeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(guiSize_font, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 507, Short.MAX_VALUE)
|
||||
.add(guiSize_font1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.add(guiSizeBasic, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 507, Short.MAX_VALUE)
|
||||
.add(guiSizeGame, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 507, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
tabGuiSizeLayout.setVerticalGroup(
|
||||
tabGuiSizeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(tabGuiSizeLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(guiSize_font, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(14, 14, 14)
|
||||
.add(guiSize_font1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(66, Short.MAX_VALUE))
|
||||
.add(guiSizeBasic, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(guiSizeGame, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 191, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(109, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
tabsPanel.addTab("GUI Size", tabGuiSize);
|
||||
|
|
@ -2174,6 +2274,18 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
save(prefs, dialog.sliderDialogFont, KEY_GUI_DIALOG_FONT_SIZE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
sizeGUIChanged = true;
|
||||
}
|
||||
if (getCachedValue(KEY_GUI_FEEDBACK_AREA_SIZE, 14) != dialog.sliderGameFeedbackArea.getValue()) {
|
||||
save(prefs, dialog.sliderGameFeedbackArea, KEY_GUI_FEEDBACK_AREA_SIZE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
sizeGUIChanged = true;
|
||||
}
|
||||
if (getCachedValue(KEY_GUI_CARD_OTHER_ZONES_SIZE, 14) != dialog.sliderCardSizeOtherZones.getValue()) {
|
||||
save(prefs, dialog.sliderCardSizeOtherZones, KEY_GUI_CARD_OTHER_ZONES_SIZE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
sizeGUIChanged = true;
|
||||
}
|
||||
if (getCachedValue(KEY_GUI_CARD_BATTLEFIELD_SIZE, 14) != dialog.sliderCardSizeBattlefield.getValue()) {
|
||||
save(prefs, dialog.sliderCardSizeBattlefield, KEY_GUI_CARD_BATTLEFIELD_SIZE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
sizeGUIChanged = true;
|
||||
}
|
||||
if (sizeGUIChanged) {
|
||||
// do as worker job
|
||||
GUISizeHelper.changeGUISize();
|
||||
|
|
@ -2273,7 +2385,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}
|
||||
|
||||
private void useConfigurablePath() {
|
||||
String path = cache.get(KEY_CARD_IMAGES_PATH);
|
||||
String path = CACHE.get(KEY_CARD_IMAGES_PATH);
|
||||
dialog.txtImageFolderPath.setText(path);
|
||||
txtImageFolderPath.setEnabled(true);
|
||||
btnBrowseImageLocation.setEnabled(true);
|
||||
|
|
@ -2338,7 +2450,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}
|
||||
|
||||
private void useSelectBackgroundImage() {
|
||||
String path = cache.get(KEY_BACKGROUND_IMAGE);
|
||||
String path = CACHE.get(KEY_BACKGROUND_IMAGE);
|
||||
dialog.txtBackgroundImagePath.setText(path);
|
||||
txtBackgroundImagePath.setEnabled(true);
|
||||
btnBrowseBackgroundImage.setEnabled(true);
|
||||
|
|
@ -2360,7 +2472,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
private void useSelectedOrRandom() {
|
||||
cbUseRandomBattleImage.setEnabled(true);
|
||||
String temp = cache.get(KEY_BATTLEFIELD_IMAGE_RANDOM);
|
||||
String temp = CACHE.get(KEY_BATTLEFIELD_IMAGE_RANDOM);
|
||||
if (temp != null) {
|
||||
if (temp.equals("true")) {
|
||||
useRandomBattleField();
|
||||
|
|
@ -2650,6 +2762,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
load(prefs, dialog.sliderSymbolSize, KEY_GUI_SYMBOL_SIZE, "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");
|
||||
load(prefs, dialog.sliderCardSizeOtherZones, KEY_GUI_CARD_OTHER_ZONES_SIZE, "14");
|
||||
load(prefs, dialog.sliderCardSizeBattlefield, KEY_GUI_CARD_BATTLEFIELD_SIZE, "14");
|
||||
}
|
||||
|
||||
private static void loadImagesSettings(Preferences prefs) {
|
||||
|
|
@ -2912,21 +3027,21 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}
|
||||
|
||||
public static String getCachedValue(String key, String def) {
|
||||
if (cache.containsKey(key)) {
|
||||
return cache.get(key);
|
||||
if (CACHE.containsKey(key)) {
|
||||
return CACHE.get(key);
|
||||
} else {
|
||||
Preferences prefs = MageFrame.getPreferences();
|
||||
String value = prefs.get(key, def);
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
cache.put(key, value);
|
||||
CACHE.put(key, value);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
private static void updateCache(String key, String value) {
|
||||
cache.put(key, value);
|
||||
CACHE.put(key, value);
|
||||
}
|
||||
|
||||
public static void saveValue(String key, String value) {
|
||||
|
|
@ -2974,17 +3089,17 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
public void setSelectedId(int id) {
|
||||
if (id >= MIN_AVATAR_ID && id <= MAX_AVATAR_ID) {
|
||||
for (JPanel panel : panels.values()) {
|
||||
for (JPanel panel : PANELS.values()) {
|
||||
panel.setBorder(BLACK_BORDER);
|
||||
}
|
||||
PreferencesDialog.selectedAvatarId = id;
|
||||
panels.get(PreferencesDialog.selectedAvatarId).setBorder(GREEN_BORDER);
|
||||
PANELS.get(PreferencesDialog.selectedAvatarId).setBorder(GREEN_BORDER);
|
||||
}
|
||||
}
|
||||
|
||||
private void addAvatar(JPanel jPanel, final int id, boolean selected, boolean locked) {
|
||||
String path = "/avatars/" + String.valueOf(id) + ".jpg";
|
||||
panels.put(id, jPanel);
|
||||
PANELS.put(id, jPanel);
|
||||
Image image = ImageHelper.getImageFromResources(path);
|
||||
|
||||
Rectangle r = new Rectangle(jPanel.getWidth() - 5, jPanel.getHeight() - 5);
|
||||
|
|
@ -3088,8 +3203,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JPanel connection_servers;
|
||||
private javax.swing.JButton exitButton;
|
||||
private javax.swing.JLabel fontSizeLabel;
|
||||
private javax.swing.JPanel guiSize_font;
|
||||
private javax.swing.JPanel guiSize_font1;
|
||||
private javax.swing.JPanel guiSizeBasic;
|
||||
private javax.swing.JPanel guiSizeGame;
|
||||
private javax.swing.JLabel jLabel11;
|
||||
private javax.swing.JLabel jLabel14;
|
||||
private javax.swing.JLabel jLabel15;
|
||||
|
|
@ -3129,8 +3244,11 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JPanel jPanel31;
|
||||
private javax.swing.JPanel jPanel32;
|
||||
private javax.swing.JPanel jPanel33;
|
||||
private javax.swing.JLabel labelCardSizeBattlefield;
|
||||
private javax.swing.JLabel labelCardSizeHand;
|
||||
private javax.swing.JLabel labelCardSizeOtherZones;
|
||||
private javax.swing.JLabel labelDialogFont;
|
||||
private javax.swing.JLabel labelGameFeedback;
|
||||
private javax.swing.JLabel labelPreferedImageLanguage;
|
||||
private javax.swing.JLabel labelSymbolSize;
|
||||
private javax.swing.JLabel labelTooltipSize;
|
||||
|
|
@ -3154,10 +3272,13 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JCheckBox showAbilityPickerForced;
|
||||
private javax.swing.JCheckBox showCardName;
|
||||
private javax.swing.JCheckBox showPlayerNamesPermanently;
|
||||
private javax.swing.JSlider sliderCardSizeBattlefield;
|
||||
private javax.swing.JSlider sliderCardSizeHand;
|
||||
private javax.swing.JSlider sliderCardSizeOtherZones;
|
||||
private javax.swing.JSlider sliderChatFontSize;
|
||||
private javax.swing.JSlider sliderDialogFont;
|
||||
private javax.swing.JSlider sliderFontSize;
|
||||
private javax.swing.JSlider sliderGameFeedbackArea;
|
||||
private javax.swing.JSlider sliderSymbolSize;
|
||||
private javax.swing.JSlider sliderTooltipSize;
|
||||
private javax.swing.JPanel sounds_backgroundMusic;
|
||||
|
|
|
|||
|
|
@ -122,11 +122,13 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
sortLayout();
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
jScrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(GUISizeHelper.scrollBarSize, 0));
|
||||
jScrollPane.getHorizontalScrollBar().setPreferredSize(new Dimension(0, GUISizeHelper.scrollBarSize));
|
||||
cardDimension = GUISizeHelper.battlefieldCardDimension;
|
||||
}
|
||||
|
||||
public void update(Map<UUID, PermanentView> battlefield) {
|
||||
|
|
|
|||
|
|
@ -332,8 +332,23 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
for (PlayAreaPanel playAreaPanel : players.values()) {
|
||||
playAreaPanel.changeGUISize();
|
||||
}
|
||||
|
||||
stack.setPreferredSize(new java.awt.Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight + 25));
|
||||
|
||||
feedbackPanel.changeGUISize();
|
||||
|
||||
for (CardInfoWindowDialog cardInfoWindowDialog : exiles.values()) {
|
||||
cardInfoWindowDialog.changeGUISize();
|
||||
}
|
||||
for (CardInfoWindowDialog cardInfoWindowDialog : revealed.values()) {
|
||||
cardInfoWindowDialog.changeGUISize();
|
||||
}
|
||||
for (CardInfoWindowDialog cardInfoWindowDialog : lookedAt.values()) {
|
||||
cardInfoWindowDialog.changeGUISize();
|
||||
}
|
||||
for (CardInfoWindowDialog cardInfoWindowDialog : graveyardWindows.values()) {
|
||||
cardInfoWindowDialog.changeGUISize();
|
||||
}
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
|
|
@ -1543,7 +1558,6 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
});
|
||||
|
||||
stack.setPreferredSize(new java.awt.Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight + 25));
|
||||
stack.setBackgroundColor(new Color(0, 0, 0, 0));
|
||||
|
||||
btnStopReplay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/control_stop.png")));
|
||||
|
|
|
|||
|
|
@ -50,4 +50,6 @@ public interface MagePlugins {
|
|||
BufferedImage getOriginalImage(CardView card);
|
||||
|
||||
ActionCallback getActionCallback();
|
||||
|
||||
void changeGUISize();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class Plugins implements MagePlugins {
|
|||
public static final String PLUGINS_DIRECTORY = "plugins/";
|
||||
|
||||
private static final MagePlugins fINSTANCE = new Plugins();
|
||||
private static final Logger logger = Logger.getLogger(Plugins.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(Plugins.class);
|
||||
private static PluginManager pm;
|
||||
|
||||
private ThemePlugin themePlugin = null;
|
||||
|
|
@ -51,13 +51,13 @@ public class Plugins implements MagePlugins {
|
|||
|
||||
@Override
|
||||
public void loadPlugins() {
|
||||
logger.info("Loading plugins...");
|
||||
LOGGER.info("Loading plugins...");
|
||||
pm = PluginManagerFactory.createPluginManager();
|
||||
pm.addPluginsFrom(new File(PLUGINS_DIRECTORY).toURI());
|
||||
this.cardPlugin = new CardPluginImpl();
|
||||
this.counterPlugin = pm.getPlugin(CounterPlugin.class);
|
||||
this.themePlugin = new ThemePluginImpl();
|
||||
logger.info("Done.");
|
||||
LOGGER.info("Done.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -67,6 +67,18 @@ public class Plugins implements MagePlugins {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
if (this.cardPlugin != null) {
|
||||
cardPlugin.changeGUISize();
|
||||
}
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateGamePanel(Map<String, JComponent> ui) {
|
||||
if (MageFrame.isLite() || MageFrame.isGray() || themePlugin == null) {
|
||||
|
|
@ -135,7 +147,7 @@ public class Plugins implements MagePlugins {
|
|||
try {
|
||||
return this.counterPlugin.getGamePlayed();
|
||||
} catch (PluginException e) {
|
||||
logger.fatal(e.getMessage());
|
||||
LOGGER.fatal(e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
|
@ -150,7 +162,7 @@ public class Plugins implements MagePlugins {
|
|||
try {
|
||||
this.counterPlugin.addGamePlayed();
|
||||
} catch (PluginException e) {
|
||||
logger.fatal(e.getMessage());
|
||||
LOGGER.fatal(e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ public class GUISizeHelper {
|
|||
public static Font gameDialogAreaFontSmall = new java.awt.Font("Arial", 0, 12);
|
||||
|
||||
public static Dimension handCardDimension;
|
||||
public static Dimension otherZonesCardDimension;
|
||||
public static Dimension battlefieldCardDimension;
|
||||
|
||||
public static int getTableRowHeight() {
|
||||
int fontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_TABLE_FONT_SIZE, 14);
|
||||
|
|
@ -110,8 +112,12 @@ public class GUISizeHelper {
|
|||
cardTooltipFontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_TOOLTIP_SIZE, 14);
|
||||
|
||||
int handCardSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_HAND_SIZE, 14);
|
||||
int width = CARD_IMAGE_WIDTH * handCardSize / 42;
|
||||
int height = CARD_IMAGE_HEIGHT * handCardSize / 42;
|
||||
handCardDimension = new Dimension(width, height);
|
||||
handCardDimension = new Dimension(CARD_IMAGE_WIDTH * handCardSize / 42, CARD_IMAGE_HEIGHT * handCardSize / 42);
|
||||
|
||||
int otherZonesCardSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_OTHER_ZONES_SIZE, 14);
|
||||
otherZonesCardDimension = new Dimension(CARD_IMAGE_WIDTH * otherZonesCardSize / 42, CARD_IMAGE_HEIGHT * otherZonesCardSize / 42);
|
||||
|
||||
int battlefieldCardSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_BATTLEFIELD_SIZE, 14);
|
||||
battlefieldCardDimension = new Dimension(CARD_IMAGE_WIDTH * battlefieldCardSize / 42, CARD_IMAGE_HEIGHT * battlefieldCardSize / 42);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ import net.java.truevfs.access.TFile;
|
|||
import org.apache.log4j.Logger;
|
||||
import org.mage.card.arcane.ScaledImagePanel.MultipassType;
|
||||
import org.mage.card.arcane.ScaledImagePanel.ScalingType;
|
||||
import static org.mage.plugins.card.constants.Constants.THUMBNAIL_SIZE_FULL;
|
||||
import org.mage.plugins.card.dl.sources.DirectLinksForDownload;
|
||||
import org.mage.plugins.card.images.ImageCache;
|
||||
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
|
||||
|
|
@ -275,8 +276,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
|
||||
titleText = new GlowText();
|
||||
setText(gameCard);
|
||||
int fontSize = (int) dimension.getHeight() / 11;
|
||||
titleText.setFont(getFont().deriveFont(Font.BOLD, fontSize));
|
||||
// int fontSize = (int) cardHeight / 11;
|
||||
// titleText.setFont(getFont().deriveFont(Font.BOLD, fontSize));
|
||||
titleText.setForeground(Color.white);
|
||||
titleText.setGlow(Color.black, TEXT_GLOW_SIZE, TEXT_GLOW_INTENSITY);
|
||||
titleText.setWrap(true);
|
||||
|
|
@ -288,7 +289,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
} else if (CardUtil.isPlaneswalker(gameCard)) {
|
||||
ptText.setText(gameCard.getLoyalty());
|
||||
}
|
||||
ptText.setFont(getFont().deriveFont(Font.BOLD, fontSize));
|
||||
// ptText.setFont(getFont().deriveFont(Font.BOLD, fontSize));
|
||||
ptText.setForeground(Color.white);
|
||||
ptText.setGlow(Color.black, TEXT_GLOW_SIZE, TEXT_GLOW_INTENSITY);
|
||||
add(ptText);
|
||||
|
|
@ -587,18 +588,24 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
titleText.setVisible(showText);
|
||||
ptText.setVisible(showText);
|
||||
|
||||
int titleX = Math.round(cardWidth * (20f / 480));
|
||||
int titleY = Math.round(cardHeight * (9f / 680)) + yTextOffset;
|
||||
titleText.setBounds(cardXOffset + titleX, cardYOffset + titleY, cardWidth - titleX, cardHeight - titleY);
|
||||
if (showText) {
|
||||
int fontSize = (int) cardHeight / 11;
|
||||
titleText.setFont(getFont().deriveFont(Font.BOLD, fontSize));
|
||||
|
||||
Dimension ptSize = ptText.getPreferredSize();
|
||||
ptText.setSize(ptSize.width, ptSize.height);
|
||||
int ptX = Math.round(cardWidth * (420f / 480)) - ptSize.width / 2;
|
||||
int ptY = Math.round(cardHeight * (675f / 680)) - ptSize.height;
|
||||
int titleX = Math.round(cardWidth * (20f / 480));
|
||||
int titleY = Math.round(cardHeight * (9f / 680)) + yTextOffset;
|
||||
titleText.setBounds(cardXOffset + titleX, cardYOffset + titleY, cardWidth - titleX, cardHeight - titleY);
|
||||
|
||||
int offsetX = Math.round((CARD_SIZE_FULL.width - cardWidth) / 10.0f);
|
||||
ptText.setFont(getFont().deriveFont(Font.BOLD, fontSize));
|
||||
Dimension ptSize = ptText.getPreferredSize();
|
||||
ptText.setSize(ptSize.width, ptSize.height);
|
||||
int ptX = Math.round(cardWidth * (420f / 480)) - ptSize.width / 2;
|
||||
int ptY = Math.round(cardHeight * (675f / 680)) - ptSize.height;
|
||||
|
||||
ptText.setLocation(cardXOffset + ptX - TEXT_GLOW_SIZE / 2 - offsetX, cardYOffset + ptY - TEXT_GLOW_SIZE / 2);
|
||||
int offsetX = Math.round((CARD_SIZE_FULL.width - cardWidth) / 10.0f);
|
||||
|
||||
ptText.setLocation(cardXOffset + ptX - TEXT_GLOW_SIZE / 2 - offsetX, cardYOffset + ptY - TEXT_GLOW_SIZE / 2);
|
||||
}
|
||||
|
||||
if (isAnimationPanel || cardWidth < 200) {
|
||||
imagePanel.setScalingType(ScalingType.nearestNeighbor);
|
||||
|
|
@ -724,6 +731,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
BufferedImage srcImage;
|
||||
if (gameCard.isFaceDown()) {
|
||||
srcImage = getFaceDownImage();
|
||||
} else if (cardWidth > THUMBNAIL_SIZE_FULL.width) {
|
||||
srcImage = ImageCache.getImage(gameCard, cardWidth, cardHeight);
|
||||
} else {
|
||||
srcImage = ImageCache.getThumbnail(gameCard);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import javax.swing.JDialog;
|
|||
import javax.swing.JLayeredPane;
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.cards.action.ActionCallback;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.constants.Rarity;
|
||||
import mage.interfaces.plugin.CardPlugin;
|
||||
import mage.utils.CardUtil;
|
||||
|
|
@ -30,7 +31,6 @@ import net.xeoh.plugins.base.annotations.meta.Author;
|
|||
import org.apache.log4j.Logger;
|
||||
import org.mage.card.arcane.Animation;
|
||||
import org.mage.card.arcane.CardPanel;
|
||||
import org.mage.plugins.card.constants.Constants;
|
||||
import org.mage.plugins.card.dl.DownloadGui;
|
||||
import org.mage.plugins.card.dl.DownloadJob;
|
||||
import org.mage.plugins.card.dl.Downloader;
|
||||
|
|
@ -65,7 +65,9 @@ public class CardPluginImpl implements CardPlugin {
|
|||
private static final float ATTACHMENT_SPACING_Y = 0.13f;
|
||||
|
||||
private int landStackMax = 5;
|
||||
private int cardWidthMin = 50, cardWidthMax = Constants.CARD_SIZE_FULL.width;
|
||||
// private int cardWidthMin = 50, cardWidthMax = Constants.CARD_SIZE_FULL.width;
|
||||
private int cardWidthMin = 50, cardWidthMax = (int) GUISizeHelper.battlefieldCardDimension.getWidth();
|
||||
|
||||
private boolean stackVertical = false;
|
||||
|
||||
private int playAreaWidth, playAreaHeight;
|
||||
|
|
@ -74,6 +76,10 @@ public class CardPluginImpl implements CardPlugin {
|
|||
private int stackSpacingX, stackSpacingY, attachmentSpacingY;
|
||||
private List<Row> rows = new ArrayList<>();
|
||||
|
||||
public CardPluginImpl() {
|
||||
setGUISize();
|
||||
}
|
||||
|
||||
@Init
|
||||
public void init() {
|
||||
}
|
||||
|
|
@ -88,6 +94,16 @@ public class CardPluginImpl implements CardPlugin {
|
|||
return "[Card plugin, version 0.7]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
cardWidthMin = 50;
|
||||
cardWidthMax = (int) GUISizeHelper.battlefieldCardDimension.getWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MagePermanent getMagePermanent(PermanentView permanent, Dimension dimension, UUID gameId, ActionCallback callback, boolean canBeFoil, boolean loadImage) {
|
||||
CardPanel cardPanel = new CardPanel(permanent, gameId, loadImage, callback, false, dimension);
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ import org.mage.plugins.card.utils.CardImageUtils;
|
|||
*/
|
||||
public class ImageCache {
|
||||
|
||||
private static final Logger log = Logger.getLogger(ImageCache.class);
|
||||
private static final Logger LOGGER = Logger.getLogger(ImageCache.class);
|
||||
|
||||
private static final Map<String, BufferedImage> imageCache;
|
||||
private static final Map<String, BufferedImage> IMAGE_CACHE;
|
||||
|
||||
/**
|
||||
* Common pattern for keys. Format: "<cardname>#<setname>#<collectorID>"
|
||||
|
|
@ -51,7 +51,7 @@ public class ImageCache {
|
|||
private static final Pattern KEY_PATTERN = Pattern.compile("(.*)#(.*)#(.*)#(.*)#(.*)");
|
||||
|
||||
static {
|
||||
imageCache = new MapMaker().softValues().makeComputingMap(new Function<String, BufferedImage>() {
|
||||
IMAGE_CACHE = new MapMaker().softValues().makeComputingMap(new Function<String, BufferedImage>() {
|
||||
@Override
|
||||
public BufferedImage apply(String key) {
|
||||
try {
|
||||
|
|
@ -112,7 +112,7 @@ public class ImageCache {
|
|||
}
|
||||
}
|
||||
if (exists) {
|
||||
log.debug("loading thumbnail for " + key + ", path=" + thumbnailPath);
|
||||
LOGGER.debug("loading thumbnail for " + key + ", path=" + thumbnailPath);
|
||||
return loadImage(thumbnailFile);
|
||||
} else {
|
||||
BufferedImage image = loadImage(file);
|
||||
|
|
@ -120,7 +120,7 @@ public class ImageCache {
|
|||
if (image == null) {
|
||||
return null;
|
||||
}
|
||||
log.debug("creating thumbnail for " + key);
|
||||
LOGGER.debug("creating thumbnail for " + key);
|
||||
return makeThumbnail(image, thumbnailPath);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -202,7 +202,7 @@ public class ImageCache {
|
|||
*/
|
||||
private static BufferedImage getImage(String key) {
|
||||
try {
|
||||
BufferedImage image = imageCache.get(key);
|
||||
BufferedImage image = IMAGE_CACHE.get(key);
|
||||
return image;
|
||||
} catch (NullPointerException ex) {
|
||||
// unfortunately NullOutputException, thrown when apply() returns
|
||||
|
|
@ -214,7 +214,7 @@ public class ImageCache {
|
|||
if (ex.getCause() instanceof NullPointerException) {
|
||||
return null;
|
||||
}
|
||||
log.error(ex, ex);
|
||||
LOGGER.error(ex, ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -249,7 +249,7 @@ public class ImageCache {
|
|||
}
|
||||
BufferedImage image = null;
|
||||
if (!file.exists()) {
|
||||
log.debug("File does not exist: " + file.toString());
|
||||
LOGGER.debug("File does not exist: " + file.toString());
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
|
|
@ -257,7 +257,7 @@ public class ImageCache {
|
|||
image = ImageIO.read(inputStream);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e, e);
|
||||
LOGGER.error(e, e);
|
||||
}
|
||||
|
||||
return image;
|
||||
|
|
@ -274,7 +274,7 @@ public class ImageCache {
|
|||
ImageIO.write(image, "jpg", outputStream);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e, e);
|
||||
LOGGER.error(e, e);
|
||||
imageFile.delete();
|
||||
}
|
||||
return image;
|
||||
|
|
@ -345,10 +345,10 @@ public class ImageCache {
|
|||
if (Constants.THUMBNAIL_SIZE_FULL.width + 10 > width) {
|
||||
return getThumbnail(card);
|
||||
}
|
||||
String key = getKey(card, card.getName(), "");
|
||||
String key = getKey(card, card.getName(), Integer.toString(width));
|
||||
BufferedImage original = getImage(key);
|
||||
if (original == null) {
|
||||
log.debug(key + " not found");
|
||||
LOGGER.debug(key + " not found");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -365,7 +365,7 @@ public class ImageCache {
|
|||
TFile file = new TFile(path);
|
||||
return file;
|
||||
} catch (NullPointerException ex) {
|
||||
log.warn("Imagefile does not exist: " + path);
|
||||
LOGGER.warn("Imagefile does not exist: " + path);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue