Some more changes to GUI to better support high screen resolutions.

This commit is contained in:
LevelX2 2016-02-14 13:41:43 +01:00
parent a2d4c4738a
commit 1835671f3d
22 changed files with 1366 additions and 859 deletions

View file

@ -123,6 +123,7 @@ import mage.client.util.gui.ArrowBuilder;
import mage.client.util.gui.countryBox.CountryUtil;
import mage.client.util.stats.UpdateMemUsageTask;
import mage.components.ImagePanel;
import mage.constants.PlayerAction;
import mage.interfaces.MageClient;
import mage.interfaces.callback.CallbackClient;
import mage.interfaces.callback.ClientCallback;
@ -141,8 +142,8 @@ import net.java.truevfs.access.TConfig;
import net.java.truevfs.kernel.spec.FsAccessOption;
import org.apache.log4j.Logger;
import org.mage.card.arcane.ManaSymbols;
import org.mage.plugins.card.constants.Constants;
import org.mage.plugins.card.images.DownloadPictures;
import org.mage.plugins.card.info.CardInfoPaneImpl;
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
/**
@ -186,6 +187,8 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
private final BalloonTip balloonTip;
private List<CardInfo> missingCards;
/**
* @return the session
*/
@ -402,7 +405,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
if (cardInfoPane == null) {
return;
}
cardInfoPane.setSize(Constants.TOOLTIP_WIDTH_MIN, Constants.TOOLTIP_HEIGHT_MIN);
// cardInfoPane.setSize(Constants.TOOLTIP_WIDTH_MIN, Constants.TOOLTIP_HEIGHT_MIN);
cardInfoPane.setLocation(40, 40);
cardInfoPane.setBackground(new Color(0, 0, 0, 0));
@ -411,15 +414,14 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
popupContainer.add(cardInfoPane);
popupContainer.setVisible(false);
popupContainer.setBounds(0, 0,
Constants.TOOLTIP_WIDTH_MIN + Constants.TOOLTIP_BORDER_WIDTH,
Constants.TOOLTIP_HEIGHT_MIN + Constants.TOOLTIP_BORDER_WIDTH);
// popupContainer.setBounds(0, 0,
// Constants.TOOLTIP_WIDTH_MIN + Constants.TOOLTIP_BORDER_WIDTH,
// Constants.TOOLTIP_HEIGHT_MIN + Constants.TOOLTIP_BORDER_WIDTH);
desktopPane.add(popupContainer, JLayeredPane.POPUP_LAYER);
UI.addComponent(MageComponents.CARD_INFO_PANE, cardInfoPane);
UI.addComponent(MageComponents.POPUP_CONTAINER, popupContainer);
// preview panel normal
JPanel cardPreviewContainer = new JPanel();
cardPreviewContainer.setOpaque(false);
@ -530,7 +532,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
MagePane window = (MagePane) windows[i];
if (window.isVisible()) {
menuItem = new MagePaneMenuItem(window);
menuItem.setFont(GUISizeHelper.getToolbarFont());
menuItem.setFont(GUISizeHelper.menuFont);
menuItem.setState(i == 0);
menuItem.addActionListener(new ActionListener() {
@Override
@ -566,28 +568,29 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
private void checkForNewImages() {
long beforeCall = System.currentTimeMillis();
List<CardInfo> cards = CardRepository.instance.findCards(new CardCriteria());
missingCards = CardRepository.instance.findCards(new CardCriteria());
LOGGER.info("Card pool load time: " + ((System.currentTimeMillis() - beforeCall) / 1000 + " seconds"));
beforeCall = System.currentTimeMillis();
if (DownloadPictures.checkForNewCards(cards)) {
if (DownloadPictures.checkForNewCards(missingCards)) {
LOGGER.info("Card images checking time: " + ((System.currentTimeMillis() - beforeCall) / 1000 + " seconds"));
if (JOptionPane.showConfirmDialog(this, "New cards are available. Do you want to download the images?", "New images available", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
DownloadPictures.startDownload(null, cards);
}
UserRequestMessage message = new UserRequestMessage("New images available", "Card images are missing (" + missingCards.size() + "). Do you want to download the images?"
+ "<br><br><i>You can deactivate the image download check on apllication start in the preferences.</i>");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_DOWNLOAD_CARD_IMAGES);
showUserRequestDialog(message);
}
}
public void btnImagesActionPerformed(java.awt.event.ActionEvent evt) {
List<CardInfo> cards = CardRepository.instance.findCards(new CardCriteria());
DownloadPictures.startDownload(null, cards);
}
public void btnSymbolsActionPerformed(java.awt.event.ActionEvent evt) {
if (JOptionPane.showConfirmDialog(this, "Do you want to download game symbols and additional image files?", "Download additional resources", JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION) {
Plugins.getInstance().downloadSymbols();
}
UserRequestMessage message = new UserRequestMessage("Download additional resources", "Do you want to download game symbols and additional image files?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_DOWNLOAD_SYMBOLS);
showUserRequestDialog(message);
}
public static void setActive(MagePane frame) {
@ -985,15 +988,14 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
private void btnConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConnectActionPerformed
if (session.isConnected()) {
if (JOptionPane.showConfirmDialog(this, "Are you sure you want to disconnect?", "Confirm disconnect", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
session.disconnect(false);
tablesPane.clearChat();
showMessage("You have disconnected");
}
UserRequestMessage message = new UserRequestMessage("Confirm disconnect", "Are you sure you want to disconnect?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_DISCONNECT);
showUserRequestDialog(message);
} else {
connectDialog.showDialog();
}
setWindowTitle();
}
}//GEN-LAST:event_btnConnectActionPerformed
public void btnAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAboutActionPerformed
@ -1027,18 +1029,16 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
public void exitApp() {
if (session.isConnected()) {
if (JOptionPane.showConfirmDialog(this, "You are currently connected. Are you sure you want to disconnect?", "Confirm disconnect", JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
return;
UserRequestMessage message = new UserRequestMessage("Confirm disconnect", "You are currently connected. Are you sure you want to disconnect?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_EXIT);
MageFrame.getInstance().showUserRequestDialog(message);
} else {
UserRequestMessage message = new UserRequestMessage("Confirm exit", "Are you sure you want to exit?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_EXIT);
MageFrame.getInstance().showUserRequestDialog(message);
}
session.disconnect(false);
} else if (JOptionPane.showConfirmDialog(this, "Are you sure you want to exit?", "Confirm exit", JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
return;
}
CardRepository.instance.closeDB();
tablesPane.cleanUp();
Plugins.getInstance().shutdown();
dispose();
System.exit(0);
}
public void enableButtons() {
@ -1068,10 +1068,12 @@ 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) {
setActive(topPanebefore);
}
}
}
public void hideGames() {
JInternalFrame[] windows = desktopPane.getAllFramesInLayer(JLayeredPane.DEFAULT_LAYER);
@ -1356,20 +1358,23 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
disableButtons();
hideGames();
hideTables();
if (errorCall && JOptionPane.showConfirmDialog(MageFrame.this, "The connection to server was lost. Reconnect?", "Warning", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
if (performConnect()) {
enableButtons();
}
if (errorCall) {
UserRequestMessage message = new UserRequestMessage("Connection lost", "The connection to server was lost. Reconnect?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_RECONNECT);
showUserRequestDialog(message);
} else {
session.disconnect(false);
}
}
});
}
);
}
}
@Override
public void showMessage(final String message) {
public void showMessage(final String message
) {
if (SwingUtilities.isEventDispatchThread()) {
JOptionPane.showMessageDialog(desktopPane, message);
} else {
@ -1383,7 +1388,8 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
}
@Override
public void showError(final String message) {
public void showError(final String message
) {
if (SwingUtilities.isEventDispatchThread()) {
JOptionPane.showMessageDialog(desktopPane, message, "Error", JOptionPane.ERROR_MESSAGE);
} else {
@ -1397,10 +1403,71 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
}
@Override
public void processCallback(ClientCallback callback) {
public void processCallback(ClientCallback callback
) {
callbackClient.processCallback(callback);
}
public void sendUserReplay(PlayerAction playerAction, UserRequestMessage userRequestMessage) {
switch (playerAction) {
case CLIENT_DOWNLOAD_SYMBOLS:
Plugins.getInstance().downloadSymbols();
break;
case CLIENT_DOWNLOAD_CARD_IMAGES:
DownloadPictures.startDownload(null, missingCards);
break;
case CLIENT_DISCONNECT:
session.disconnect(false);
tablesPane.clearChat();
showMessage("You have disconnected");
setWindowTitle();
break;
case CLIENT_QUIT_TOURNAMENT:
MageFrame.getSession().quitTournament(userRequestMessage.getTournamentId());
break;
case CLIENT_QUIT_DRAFT_TOURNAMENT:
MageFrame.getSession().quitDraft(userRequestMessage.getTournamentId());
MageFrame.removeDraft(userRequestMessage.getTournamentId());
break;
case CLIENT_CONCEDE_GAME:
MageFrame.getSession().sendPlayerAction(PlayerAction.CONCEDE, userRequestMessage.getGameId(), null);
break;
case CLIENT_CONCEDE_MATCH:
MageFrame.getSession().quitMatch(userRequestMessage.getGameId());
break;
case CLIENT_STOP_WATCHING:
session.stopWatching(userRequestMessage.getGameId());
removeGame(userRequestMessage.getGameId());
break;
case CLIENT_EXIT:
if (session.isConnected()) {
session.disconnect(false);
}
CardRepository.instance.closeDB();
tablesPane.cleanUp();
Plugins.getInstance().shutdown();
dispose();
System.exit(0);
break;
case CLIENT_REMOVE_TABLE:
session.removeTable(userRequestMessage.getRoomId(), userRequestMessage.getTableId());
break;
case CLIENT_RECONNECT:
if (performConnect()) {
enableButtons();
}
break;
case CLIENT_REPLAY_ACTION:
session.stopReplay(userRequestMessage.getGameId());
break;
default:
if (session != null && playerAction != null) {
session.sendPlayerAction(playerAction, userRequestMessage.getGameId(), userRequestMessage.getRelatedUserId());
}
}
}
public void changeGUISize() {
setGUISize();
@ -1416,12 +1483,22 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
for (ChatPanelBasic chatPanel : getChatPanels().values()) {
chatPanel.changeGUISize(GUISizeHelper.chatFont);
}
try {
CardInfoPaneImpl cardInfoPane = (CardInfoPaneImpl) UI.getComponent(MageComponents.CARD_INFO_PANE);
if (cardInfoPane != null) {
cardInfoPane.changeGUISize();
}
} catch (Exception ex) {
}
this.revalidate();
this.repaint();
}
private void setGUISize() {
Font font = GUISizeHelper.getToolbarFont();
Font font = GUISizeHelper.menuFont;
mageToolbar.setFont(font);
int newHeight = font.getSize() + 6;
Dimension mageToolbarDimension = mageToolbar.getPreferredSize();
@ -1445,7 +1522,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
component.setMaximumSize(d);
}
}
balloonTip.setFont(GUISizeHelper.tooltipFont);
balloonTip.setFont(GUISizeHelper.balloonTooltipFont);
}
}

View file

@ -15,7 +15,7 @@
<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_layoutCodeTarget" type="java.lang.Integer" value="2"/>
<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"/>
@ -25,23 +25,23 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="403" 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="32767" attributes="0"/>
<Component id="saveButton" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="exitButton" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
</Group>
<Component id="tabsPanel" alignment="0" pref="0" max="32767" attributes="0"/>
<Component id="tabsPanel" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="tabsPanel" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace max="32767" 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"/>
<Component id="exitButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -50,6 +50,11 @@
</Layout>
<SubComponents>
<Container class="javax.swing.JTabbedPane" name="tabsPanel">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[532, 451]"/>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
@ -70,10 +75,7 @@
<Group type="103" groupAlignment="0" attributes="0">
<Component id="main_card" alignment="1" max="32767" attributes="0"/>
<Component id="main_gamelog" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="main_game" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="main_game" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -88,7 +90,7 @@
<Component id="main_game" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="main_gamelog" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="45" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -116,7 +118,7 @@
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="tooltipDelayLabel" pref="481" max="32767" attributes="0"/>
<Component id="tooltipDelayLabel" max="32767" attributes="0"/>
<Component id="tooltipDelay" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="showCardName" min="-2" max="-2" attributes="0"/>
@ -197,7 +199,7 @@
<Component id="showPlayerNamesPermanently" alignment="0" max="32767" attributes="0"/>
<Component id="nonLandPermanentsInOnePile" alignment="0" max="32767" attributes="0"/>
<Component id="showAbilityPickerForced" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="cbConfirmEmptyManaPool" alignment="0" pref="485" max="32767" attributes="0"/>
<Component id="cbConfirmEmptyManaPool" alignment="0" max="32767" attributes="0"/>
<Component id="cbAllowRequestToShowHandCards" alignment="0" max="32767" attributes="0"/>
<Component id="cbShowStormCounter" alignment="0" max="32767" attributes="0"/>
<Component id="cbAskMoveToGraveOrder" alignment="0" max="32767" attributes="0"/>
@ -328,7 +330,7 @@
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="cbDraftLogAutoSave" max="32767" attributes="0"/>
<Component id="cbGameLogAutoSave" pref="473" max="32767" attributes="0"/>
<Component id="cbGameLogAutoSave" max="32767" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
@ -383,7 +385,10 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="guiSize_font" pref="506" max="32767" 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"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@ -392,8 +397,10 @@
<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" pref="216" max="-2" attributes="0"/>
<EmptySpace pref="211" max="32767" 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"/>
</Group>
</Group>
</DimensionLayout>
@ -451,6 +458,97 @@
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JSlider" name="sliderChatFontSize">
<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="&lt;HTML&gt;Size of the chat font."/>
<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="-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"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="chatFontSizeLabel">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Size of chat font"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The size of the font used to display the chat text"/>
</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"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JSlider" name="sliderDialogFont">
<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="&lt;HTML&gt;Size of the font."/>
<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="-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"/>
</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="&lt;HTML&gt;The size of the font used to display table text."/>
</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="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">
<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 game elements">
<Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<EtchetBorder/>
</Border>
</TitledBorder>
</Border>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Component class="javax.swing.JSlider" name="sliderCardSizeHand">
<Properties>
<Property name="majorTickSpacing" type="int" value="5"/>
@ -473,7 +571,7 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="3" 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"/>
<GridBagConstraints gridX="0" 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>
@ -485,11 +583,49 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="3" 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="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"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JSlider" name="sliderChatFontSize">
<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="&lt;HTML&gt;Size of the font."/>
<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="2" 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="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="&lt;HTML&gt;The size of the hand cards"/>
</Properties>
<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="sliderSymbolSize">
<Properties>
<Property name="majorTickSpacing" type="int" value="5"/>
<Property name="maximum" type="int" value="50"/>
@ -514,10 +650,10 @@
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="chatFontSizeLabel">
<Component class="javax.swing.JLabel" name="labelSymbolSize">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Size of chat font"/>
<Property name="text" type="java.lang.String" value="Symbol size"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;The size of the font used to display the chat text"/>
</Properties>
<Constraints>
@ -680,7 +816,7 @@
<Component id="checkBoxEndTurnOthers" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="phases_stopSettings" max="32767" attributes="0"/>
<Component id="phases_stopSettings" pref="188" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@ -939,7 +1075,7 @@
<Component id="cbPreferedImageLanguage" min="-2" pref="153" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="188" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
@ -1364,7 +1500,7 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="avatarPane" min="-2" pref="527" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
@ -1372,7 +1508,10 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="avatarPane" alignment="0" pref="438" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="avatarPane" min="-2" pref="423" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
@ -1435,12 +1574,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1468,12 +1607,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1501,12 +1640,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1534,7 +1673,7 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@ -1567,12 +1706,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1600,12 +1739,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1633,12 +1772,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1666,12 +1805,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1699,12 +1838,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1732,12 +1871,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1765,12 +1904,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1798,12 +1937,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1831,12 +1970,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1864,12 +2003,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1897,12 +2036,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1930,12 +2069,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1963,12 +2102,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1996,12 +2135,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -2029,12 +2168,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -2062,12 +2201,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -2095,12 +2234,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -2128,12 +2267,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -2161,12 +2300,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -2191,12 +2330,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="110" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -2246,7 +2385,7 @@
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="pnlProxySettings" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="127" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -2361,7 +2500,7 @@
<Component id="rememberPswd" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="25" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -2459,7 +2598,7 @@
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="lblURLServerList" max="32767" attributes="0"/>
<Component id="txtURLServerList" pref="28" max="32767" attributes="0"/>
<Component id="txtURLServerList" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel17" min="-2" max="-2" attributes="0"/>

View file

@ -28,12 +28,12 @@
<Group type="103" groupAlignment="1" attributes="0">
<Component id="lblText" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="289" max="32767" attributes="0"/>
<Component id="btn3" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="btn3" pref="0" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btn2" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="btn2" pref="0" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btn1" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="btn1" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
@ -44,12 +44,12 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="lblText" pref="96" max="32767" attributes="0"/>
<Component id="lblText" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btn1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btn2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btn3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btn1" alignment="3" max="32767" attributes="0"/>
<Component id="btn2" alignment="3" max="32767" attributes="0"/>
<Component id="btn3" alignment="3" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
</Group>
@ -61,11 +61,29 @@
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="message to the user"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 60]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 60]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 60]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="btn3">
<Properties>
<Property name="text" type="java.lang.String" value="btn3"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 50]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[75, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 50]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btn3ActionPerformed"/>
@ -74,6 +92,15 @@
<Component class="javax.swing.JButton" name="btn2">
<Properties>
<Property name="text" type="java.lang.String" value="btn2"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 50]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[75, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 50]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btn2ActionPerformed"/>
@ -82,6 +109,15 @@
<Component class="javax.swing.JButton" name="btn1">
<Properties>
<Property name="text" type="java.lang.String" value="btn1"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 50]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[75, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 50]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btn1ActionPerformed"/>

View file

@ -25,19 +25,21 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
/*
* ErrorDialog.java
*
* Created on Dec 23, 2009, 11:01:32 AM
*/
package mage.client.dialog;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.JComponent;
import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
import javax.swing.plaf.basic.BasicInternalFrameUI;
import mage.client.MageFrame;
import mage.client.util.GUISizeHelper;
import mage.constants.PlayerAction;
import mage.remote.Session;
import mage.view.UserRequestMessage;
/**
@ -48,15 +50,43 @@ public class UserRequestDialog extends MageDialog {
private UserRequestMessage userRequestMessage;
/** Creates new form AskDialog */
/**
* Creates new form AskDialog
*/
public UserRequestDialog() {
initComponents();
setGUISize();
}
private void setGUISize() {
Font font = GUISizeHelper.gameRequestsFont;
lblText.setFont(font);
lblText.setMaximumSize(new Dimension(300 + font.getSize() * 15, 20 + font.getSize() * 5));
lblText.setMinimumSize(new Dimension(300 + font.getSize() * 15, 20 + font.getSize() * 5));
lblText.setPreferredSize(new Dimension(300 + font.getSize() * 15, 20 + font.getSize() * 5));
btn1.setFont(font);
btn1.setMinimumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
btn1.setMaximumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
btn1.setPreferredSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
btn2.setFont(font);
btn2.setMinimumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
btn2.setMaximumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
btn2.setPreferredSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
btn3.setFont(font);
btn3.setMinimumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
btn3.setMaximumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
btn3.setPreferredSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
JComponent c = (BasicInternalFrameTitlePane) ((BasicInternalFrameUI) this.getUI()).getNorthPane();
c.setMinimumSize(new Dimension(c.getMinimumSize().width, font.getSize() + 10));
c.setMaximumSize(new Dimension(c.getMaximumSize().width, font.getSize() + 10));
c.setPreferredSize(new Dimension(c.getPreferredSize().width, font.getSize() + 10));
c.setFont(font);
}
public void showDialog(UserRequestMessage userRequestMessage) {
this.userRequestMessage = userRequestMessage;
this.setTitle(userRequestMessage.getTitel());
String text = "<html><p style=\"text-align:center; margin-left:50px; margin-right:50px\">" + userRequestMessage.getMessage() + "</p></html>";
String text = "<html><p style=\"text-align:center; margin-left:10px; margin-right:10px\">" + userRequestMessage.getMessage() + "</p></html>";
this.lblText.setText(text);
if (userRequestMessage.getButton1Text() != null) {
this.btn1.setText(userRequestMessage.getButton1Text());
@ -80,10 +110,10 @@ public class UserRequestDialog extends MageDialog {
this.setVisible(true);
}
/** 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.
/**
* 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
@ -99,8 +129,14 @@ public class UserRequestDialog extends MageDialog {
lblText.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lblText.setText("message to the user");
lblText.setMaximumSize(new java.awt.Dimension(400, 60));
lblText.setMinimumSize(new java.awt.Dimension(400, 60));
lblText.setPreferredSize(new java.awt.Dimension(400, 60));
btn3.setText("btn3");
btn3.setMaximumSize(new java.awt.Dimension(150, 50));
btn3.setMinimumSize(new java.awt.Dimension(75, 25));
btn3.setPreferredSize(new java.awt.Dimension(150, 50));
btn3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn3ActionPerformed(evt);
@ -108,6 +144,9 @@ public class UserRequestDialog extends MageDialog {
});
btn2.setText("btn2");
btn2.setMaximumSize(new java.awt.Dimension(150, 50));
btn2.setMinimumSize(new java.awt.Dimension(75, 25));
btn2.setPreferredSize(new java.awt.Dimension(150, 50));
btn2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn2ActionPerformed(evt);
@ -115,6 +154,9 @@ public class UserRequestDialog extends MageDialog {
});
btn1.setText("btn1");
btn1.setMaximumSize(new java.awt.Dimension(150, 50));
btn1.setMinimumSize(new java.awt.Dimension(75, 25));
btn1.setPreferredSize(new java.awt.Dimension(150, 50));
btn1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn1ActionPerformed(evt);
@ -130,24 +172,24 @@ public class UserRequestDialog extends MageDialog {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(lblText, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(0, 289, Short.MAX_VALUE)
.addComponent(btn3, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(btn3, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btn2, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(btn1, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(lblText, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE)
.addComponent(lblText, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btn1)
.addComponent(btn2)
.addComponent(btn3))
.addComponent(btn1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(12, 12, 12))
);
@ -176,10 +218,7 @@ public class UserRequestDialog extends MageDialog {
}//GEN-LAST:event_btn3ActionPerformed
private void sendUserReplay(PlayerAction playerAction) {
Session session = MageFrame.getSession();
if (session != null && playerAction != null) {
session.sendPlayerAction(playerAction, userRequestMessage.getGameId(), userRequestMessage.getRelatedUserId());
}
MageFrame.getInstance().sendUserReplay(playerAction, userRequestMessage);
}
// Variables declaration - do not modify//GEN-BEGIN:variables

View file

@ -57,7 +57,6 @@ import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.KeyStroke;
import javax.swing.Timer;
@ -74,12 +73,14 @@ import mage.client.util.ImageHelper;
import mage.client.util.Listener;
import mage.client.util.audio.AudioManager;
import mage.client.util.gui.BufferedImageBuilder;
import mage.constants.PlayerAction;
import mage.remote.Session;
import mage.view.CardsView;
import mage.view.DraftPickView;
import mage.view.DraftView;
import mage.view.SimpleCardView;
import mage.view.SimpleCardsView;
import mage.view.UserRequestMessage;
import org.apache.log4j.Logger;
/**
@ -910,10 +911,11 @@ public class DraftPanel extends javax.swing.JPanel {
}// </editor-fold>//GEN-END:initComponents
private void btnQuitTournamentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuitTournamentActionPerformed
if (JOptionPane.showConfirmDialog(this, "Are you sure you want to quit the tournament?", "Confirm quit tournament", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
MageFrame.getSession().quitDraft(draftId);
MageFrame.removeDraft(draftId);
}
UserRequestMessage message = new UserRequestMessage("Confirm quit tournament", "Are you sure you want to quit the draft tournament?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_QUIT_DRAFT_TOURNAMENT);
message.setTournamentId(draftId);
MageFrame.getInstance().showUserRequestDialog(message);
}//GEN-LAST:event_btnQuitTournamentActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables

View file

@ -141,6 +141,7 @@ import mage.view.MatchView;
import mage.view.PlayerView;
import mage.view.RevealedView;
import mage.view.SimpleCardsView;
import mage.view.UserRequestMessage;
import org.apache.log4j.Logger;
import org.mage.card.arcane.CardPanel;
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
@ -1051,10 +1052,6 @@ public final class GamePanel extends javax.swing.JPanel {
ArrowBuilder.getBuilder().removeAllArrows(gameId);
}
public int modalQuestion(String message, String title) {
return JOptionPane.showConfirmDialog(this, message, title, JOptionPane.YES_NO_OPTION);
}
public void select(String message, GameView gameView, int messageId, Map<String, Serializable> options) {
updateGame(gameView, options);
boolean controllingPlayer = false;
@ -1875,9 +1872,11 @@ public final class GamePanel extends javax.swing.JPanel {
}
private void btnConcedeActionPerformed(java.awt.event.ActionEvent evt) {
if (modalQuestion("Are you sure you want to concede?", "Confirm concede") == JOptionPane.YES_OPTION) {
session.sendPlayerAction(PlayerAction.CONCEDE, gameId, null);
}
UserRequestMessage message = new UserRequestMessage("Confirm concede", "Are you sure you want to concede?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_CONCEDE_GAME);
message.setGameId(gameId);
MageFrame.getInstance().showUserRequestDialog(message);
}
private void btnEndTurnActionPerformed(java.awt.event.ActionEvent evt) {
@ -1941,17 +1940,22 @@ public final class GamePanel extends javax.swing.JPanel {
}
private void btnStopWatchingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStopWatchingActionPerformed
if (modalQuestion("Are you sure you want to stop watching?", "Stop watching") == JOptionPane.YES_OPTION) {
session.stopWatching(gameId);
this.removeGame();
}
UserRequestMessage message = new UserRequestMessage("Stop watching", "Are you sure you want to stop watching?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_STOP_WATCHING);
message.setGameId(gameId);
MageFrame.getInstance().showUserRequestDialog(message);
}//GEN-LAST:event_btnStopWatchingActionPerformed
private void btnStopReplayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStopReplayActionPerformed
if (replayTask != null && !replayTask.isDone()) {
replayTask.cancel(true);
} else if (modalQuestion("Are you sure you want to stop replay?", "Stop replay") == JOptionPane.YES_OPTION) {
session.stopReplay(gameId);
} else {
UserRequestMessage message = new UserRequestMessage("Stop replay", "Are you sure you want to stop replay?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_REPLAY_ACTION);
message.setGameId(gameId);
MageFrame.getInstance().showUserRequestDialog(message);
}
}//GEN-LAST:event_btnStopReplayActionPerformed

View file

@ -44,7 +44,6 @@ import javax.swing.GroupLayout.Alignment;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.MenuSelectionManager;
@ -59,6 +58,7 @@ import static mage.client.dialog.PreferencesDialog.KEY_GAME_MANA_AUTOPAYMENT_ONL
import mage.client.util.GUISizeHelper;
import mage.constants.PlayerAction;
import mage.view.PlayerView;
import mage.view.UserRequestMessage;
/**
*
@ -421,15 +421,19 @@ public class PlayAreaPanel extends javax.swing.JPanel {
public void actionPerformed(ActionEvent e) {
switch (e.getActionCommand()) {
case "Game": {
if (JOptionPane.showConfirmDialog(PlayAreaPanel.this, "Are you sure you want to concede the game?", "Confirm concede game", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
MageFrame.getSession().sendPlayerAction(PlayerAction.CONCEDE, gameId, null);
}
UserRequestMessage message = new UserRequestMessage("Confirm concede game", "Are you sure you want to concede the game?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_CONCEDE_GAME);
message.setGameId(gameId);
MageFrame.getInstance().showUserRequestDialog(message);
break;
}
case "Match": {
if (JOptionPane.showConfirmDialog(PlayAreaPanel.this, "Are you sure you want to concede the complete match?", "Confirm concede match", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
MageFrame.getSession().quitMatch(gameId);
}
UserRequestMessage message = new UserRequestMessage("Confirm concede match", "Are you sure you want to concede the complete match?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_CONCEDE_MATCH);
message.setGameId(gameId);
MageFrame.getInstance().showUserRequestDialog(message);
break;
}
}
@ -483,10 +487,11 @@ public class PlayAreaPanel extends javax.swing.JPanel {
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (JOptionPane.showConfirmDialog(PlayAreaPanel.this, "Are you sure you want to stop watching the game?", "Confirm stop watching game", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
gamePanel.getSession().stopWatching(gameId);
gamePanel.removeGame();
}
UserRequestMessage message = new UserRequestMessage("Confirm stop watching game", "Are you sure you want to stop watching the game?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_STOP_WATCHING);
message.setGameId(gameId);
MageFrame.getInstance().showUserRequestDialog(message);
}
});

View file

@ -404,7 +404,7 @@ public class PlayersChatPanel extends javax.swing.JPanel {
if (col != null) {
MageFrame.getInstance().getBalloonTip().setAttachedComponent(header);
JLabel content = new JLabel(tips.get(table.convertColumnIndexToModel(vColIndex)));
content.setFont(GUISizeHelper.tooltipFont);
content.setFont(GUISizeHelper.balloonTooltipFont);
MageFrame.getInstance().getBalloonTip().setContents(content);
ToolTipUtils.balloonToToolTip(MageFrame.getInstance().getBalloonTip(), 600, 10000);
} else {

View file

@ -86,6 +86,7 @@ import mage.client.util.gui.GuiDisplayUtil;
import mage.client.util.gui.TableUtil;
import mage.constants.MatchTimeLimit;
import mage.constants.MultiplayerAttackOption;
import mage.constants.PlayerAction;
import mage.constants.RangeOfInfluence;
import mage.constants.SkillLevel;
import mage.game.match.MatchOptions;
@ -94,6 +95,7 @@ import mage.remote.Session;
import mage.view.MatchView;
import mage.view.RoomUsersView;
import mage.view.TableView;
import mage.view.UserRequestMessage;
import org.apache.log4j.Logger;
/**
@ -120,6 +122,9 @@ public class TablesPanel extends javax.swing.JPanel {
private int currentMessage;
private MageTableRowSorter activeTablesSorter;
private final ButtonColumn actionButton1;
private final ButtonColumn actionButton2;
JToggleButton[] filterButtons;
/**
@ -216,9 +221,10 @@ public class TablesPanel extends javax.swing.JPanel {
}
break;
case "Remove":
if (JOptionPane.showConfirmDialog(null, "Are you sure you want to remove table?", "Removing table", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
session.removeTable(roomId, tableId);
}
UserRequestMessage message = new UserRequestMessage("Removing table", "Are you sure you want to remove table?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_REMOVE_TABLE);
MageFrame.getInstance().showUserRequestDialog(message);
break;
case "Show":
if (isTournament) {
@ -269,8 +275,8 @@ public class TablesPanel extends javax.swing.JPanel {
};
// !!!! adds action buttons to the table panel (don't delete this)
new ButtonColumn(tableTables, openTableAction, tableTables.convertColumnIndexToView(TableTableModel.ACTION_COLUMN));
new ButtonColumn(tableCompleted, closedTableAction, tableCompleted.convertColumnIndexToView(MatchesTableModel.ACTION_COLUMN));
actionButton1 = new ButtonColumn(tableTables, openTableAction, tableTables.convertColumnIndexToView(TableTableModel.ACTION_COLUMN));
actionButton2 = new ButtonColumn(tableCompleted, closedTableAction, tableCompleted.convertColumnIndexToView(MatchesTableModel.ACTION_COLUMN));
// !!!!
}
@ -281,6 +287,8 @@ public class TablesPanel extends javax.swing.JPanel {
public void changeGUISize() {
chatPanelMain.changeGUISize();
actionButton1.changeGUISize();
actionButton2.changeGUISize();
setGUISize();
}

View file

@ -46,7 +46,6 @@ import java.util.concurrent.ExecutionException;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
import javax.swing.table.AbstractTableModel;
import mage.client.MageFrame;
@ -61,11 +60,13 @@ import mage.client.util.Format;
import mage.client.util.GUISizeHelper;
import mage.client.util.gui.TableUtil;
import mage.client.util.gui.countryBox.CountryCellRenderer;
import mage.constants.PlayerAction;
import mage.remote.Session;
import mage.view.RoundView;
import mage.view.TournamentGameView;
import mage.view.TournamentPlayerView;
import mage.view.TournamentView;
import mage.view.UserRequestMessage;
import org.apache.log4j.Logger;
/**
@ -87,6 +88,8 @@ public class TournamentPanel extends javax.swing.JPanel {
private UpdateTournamentTask updateTask;
private final DateFormat df;
private final ButtonColumn actionButtonColumn1;
/**
* Creates new form TournamentPanel
*/
@ -107,8 +110,6 @@ public class TournamentPanel extends javax.swing.JPanel {
tableMatches.createDefaultColumnsFromModel();
TableUtil.setColumnWidthAndOrder(tableMatches, DEFAULT_COLUMNS_WIDTH_MATCHES, KEY_TOURNAMENT_MATCH_COLUMNS_WIDTH, KEY_TOURNAMENT_MATCH_COLUMNS_ORDER);
setGUISize();
chatPanel1.useExtendedView(ChatPanelBasic.VIEW_MODE.NONE);
chatPanel1.setChatType(ChatPanelBasic.ChatType.TOURNAMENT);
@ -134,7 +135,8 @@ public class TournamentPanel extends javax.swing.JPanel {
};
// action button, don't delete this
ButtonColumn buttonColumn = new ButtonColumn(tableMatches, action, tableMatches.convertColumnIndexToView(TournamentMatchesTableModel.ACTION_COLUMN));
actionButtonColumn1 = new ButtonColumn(tableMatches, action, tableMatches.convertColumnIndexToView(TournamentMatchesTableModel.ACTION_COLUMN));
setGUISize();
}
@ -167,6 +169,8 @@ public class TournamentPanel extends javax.swing.JPanel {
jScrollPane1.getHorizontalScrollBar().setPreferredSize(new Dimension(0, GUISizeHelper.scrollBarSize));
jScrollPane2.getVerticalScrollBar().setPreferredSize(new Dimension(GUISizeHelper.scrollBarSize, 0));
jScrollPane2.getHorizontalScrollBar().setPreferredSize(new Dimension(0, GUISizeHelper.scrollBarSize));
actionButtonColumn1.changeGUISize();
}
private void saveDividerLocations() {
@ -535,10 +539,10 @@ public class TournamentPanel extends javax.swing.JPanel {
}//GEN-LAST:event_btnCloseWindowActionPerformed
private void btnQuitTournamentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuitTournamentActionPerformed
if (JOptionPane.showConfirmDialog(this, "Are you sure you want to quit the tournament?", "Confirm quit tournament", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
MageFrame.getSession().quitTournament(tournamentId);
}
UserRequestMessage message = new UserRequestMessage("Confirm quit tournament", "Are you sure you want to quit the tournament?");
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_QUIT_TOURNAMENT);
MageFrame.getInstance().showUserRequestDialog(message);
}//GEN-LAST:event_btnQuitTournamentActionPerformed
private void txtNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNameActionPerformed

View file

@ -63,6 +63,7 @@ public class ButtonColumn extends AbstractCellEditor implements TableCellRendere
editButton = new JButton();
editButton.setFocusPainted(false);
editButton.addActionListener(this);
setGUISize();
TableColumnModel columnModel = table.getColumnModel();
columnModel.getColumn(column).setCellRenderer(this);
@ -70,6 +71,15 @@ public class ButtonColumn extends AbstractCellEditor implements TableCellRendere
table.addMouseListener(this);
}
public void changeGUISize() {
setGUISize();
}
private void setGUISize() {
renderButton.setFont(GUISizeHelper.tableFont);
editButton.setFont(GUISizeHelper.tableFont);
}
@Override
public Object getCellEditorValue() {
return text;

View file

@ -36,21 +36,19 @@ public class GUISizeHelper {
public static int flagHeight;
public static int cardTooltipFontSize = 15;
public static Font chatFont = new java.awt.Font("Arial", 0, 12);
public static Font tableFont = new java.awt.Font("Arial", 0, 12);
public static Font tooltipFont = new java.awt.Font("Arial", 0, 12);
public static Font balloonTooltipFont = new java.awt.Font("Arial", 0, 12);
public static Font menuFont = new java.awt.Font("Arial", 0, 12);
public static Font gameRequestsFont = new java.awt.Font("Arial", 0, 12);
public static Font gameDialogAreaFontBig = new java.awt.Font("Arial", 0, 12);
public static Font gameDialogAreaFontSmall = new java.awt.Font("Arial", 0, 12);
public static Dimension handCardDimension;
public static Font getToolbarFont() {
int fontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_TABLE_FONT_SIZE, 14);
return new java.awt.Font("Arial", 0, fontSize);
}
public static int getTableRowHeight() {
int fontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_TABLE_FONT_SIZE, 14);
return fontSize + 6;
@ -71,47 +69,49 @@ public class GUISizeHelper {
tableFont = new java.awt.Font("Arial", 0, tableFontSize);
tableRowHeight = tableFontSize + 4;
tableHeaderHeight = tableFontSize + 10;
tooltipFont = new java.awt.Font("Arial", 0, tableFontSize - 2);
// used for popup menus
menuFont = new java.awt.Font("Arial", 0, tableFontSize);
int chatFontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CHAT_FONT_SIZE, 14);
chatFont = new java.awt.Font("Arial", 0, chatFontSize);
// Set basic symbol size
if (tableFontSize > 24) {
flagHeight = tableFontSize - 4;
} else {
flagHeight = 11;
}
if (tableFontSize < 25) {
basicSymbolSize = "small";
} else if (tableFontSize < 45) {
basicSymbolSize = "medium";
} else {
basicSymbolSize = "large";
}
flagHeight = tableFontSize - 2;
balloonTooltipFont = new Font("Arial", 0, tableFontSize);
if (tableFontSize > 15) {
symbolTooltipSize = tableFontSize - 5;
symbolEditorSize = tableFontSize - 5;
symbolPaySize = tableFontSize - 5;
symbolCardSize = 15;
dividerBarSize = 10 + (tableFontSize / 4);
scrollBarSize = 14 + (tableFontSize / 4);
} else {
symbolTooltipSize = tableFontSize;
symbolEditorSize = tableFontSize;
symbolPaySize = tableFontSize;
symbolCardSize = 15;
dividerBarSize = 10;
scrollBarSize = 14;
}
// used for popup menus
int dialogFontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_DIALOG_FONT_SIZE, 14);
menuFont = new Font("Arial", 0, dialogFontSize);
gameRequestsFont = new Font("Arial", 0, dialogFontSize);
int chatFontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CHAT_FONT_SIZE, 14);
chatFont = new java.awt.Font("Arial", 0, chatFontSize);
int symbolSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_SYMBOL_SIZE, 14);
// Set basic symbol size
if (symbolSize < 25) {
basicSymbolSize = "small";
} else if (symbolSize < 45) {
basicSymbolSize = "medium";
} else {
basicSymbolSize = "large";
}
if (symbolSize < 16) {
symbolTooltipSize = 15;
symbolPaySize = 15;
symbolCardSize = 15;
} else {
symbolTooltipSize = symbolSize;
symbolPaySize = symbolSize;
symbolCardSize = symbolSize;
}
cardTooltipFontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_TOOLTIP_SIZE, 14);
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);
}
}

View file

@ -13,6 +13,7 @@ import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import mage.client.MageFrame;
import mage.client.util.GUISizeHelper;
import mage.constants.CardType;
import mage.constants.MageObjectType;
import mage.constants.Rarity;
@ -157,11 +158,9 @@ public class GuiDisplayUtil {
if (((PermanentView) card).getCounters() != null) {
counters = new ArrayList<>(((PermanentView) card).getCounters());
}
} else {
if (card.getCounters() != null) {
} else if (card.getCounters() != null) {
counters = new ArrayList<>(card.getCounters());
}
}
if (!counters.isEmpty()) {
StringBuilder sb = new StringBuilder();
int index = 0;
@ -204,15 +203,14 @@ public class GuiDisplayUtil {
symbolCount++;
}
int fontSize = 11;
String fontFamily = "tahoma";
int fontSize = GUISizeHelper.cardTooltipFontSize;
/*if (prefs.fontFamily == CardFontFamily.arial)
fontFamily = "arial";
else if (prefs.fontFamily == CardFontFamily.verdana) {
fontFamily = "verdana";
}*/
final StringBuilder buffer = new StringBuilder(512);
buffer.append("<html><body style='font-family:");
buffer.append(fontFamily);
@ -226,7 +224,7 @@ public class GuiDisplayUtil {
buffer.append(" [").append(card.getId().toString().substring(0, 3)).append("]");
}
buffer.append("</b></td><td align='right' valign='top' style='width:");
buffer.append(symbolCount * 11 + 1);
buffer.append(symbolCount * GUISizeHelper.symbolTooltipSize + 1);
buffer.append("px'>");
if (!card.isSplitCard()) {
buffer.append(castingCost);
@ -307,7 +305,7 @@ public class GuiDisplayUtil {
rule.append("<tr><td valign='top'><b>");
rule.append(card.getLeftSplitName());
rule.append("</b></td><td align='right' valign='top' style='width:");
rule.append(card.getLeftSplitCosts().getSymbols().size() * 11 + 1);
rule.append(card.getLeftSplitCosts().getSymbols().size() * GUISizeHelper.symbolTooltipSize + 1);
rule.append("px'>");
rule.append(card.getLeftSplitCosts().getText());
rule.append("</td></tr></table>");
@ -320,7 +318,7 @@ public class GuiDisplayUtil {
rule.append("<tr><td valign='top'><b>");
rule.append(card.getRightSplitName());
rule.append("</b></td><td align='right' valign='top' style='width:");
rule.append(card.getRightSplitCosts().getSymbols().size() * 11 + 1);
rule.append(card.getRightSplitCosts().getSymbols().size() * GUISizeHelper.symbolTooltipSize + 1);
rule.append("px'>");
rule.append(card.getRightSplitCosts().getText());
rule.append("</td></tr></table>");

View file

@ -32,7 +32,7 @@ public class ManaSymbols {
public static void loadImages() {
String[] symbols = new String[]{"0", "1", "10", "11", "12", "15", "16", "2", "3", "4", "5", "6", "7", "8", "9", "B", "BG",
"BR", "G", "GU", "GW", "R", "RG", "RW", "S", "T", "U", "UB", "UR", "W", "WB", "WU",
"WP", "UP", "BP", "RP", "GP", "X", "C" /*, "Y", "Z", "slash"*/};
"WP", "UP", "BP", "RP", "GP", "X", "C"};
MANA_IMAGES.clear();
SET_IMAGES.clear();
@ -185,7 +185,7 @@ public class ManaSymbols {
continue;
}
g.drawImage(image, x, y, null);
x += symbol.length() > 2 ? 10 : 12; // slash.png is only 10 pixels wide.
x += GUISizeHelper.symbolPaySize;
}
}
@ -202,8 +202,8 @@ public class ManaSymbols {
manaCost = manaCost.replace("\\", "");
StringTokenizer tok = new StringTokenizer(manaCost, " ");
while (tok.hasMoreTokens()) {
String symbol = tok.nextToken().substring(0);
width += symbol.length() > 2 ? 10 : 12; // slash.png is only 10 pixels wide.
tok.nextToken();
width += GUISizeHelper.symbolPaySize;
}
return width;
}

View file

@ -16,12 +16,6 @@ public class Constants {
public static final Rectangle CARD_SIZE_FULL = new Rectangle(101, 149);
public static final Rectangle THUMBNAIL_SIZE_FULL = new Rectangle(102, 146);
public static final int TOOLTIP_WIDTH_MIN = 320;
public static final int TOOLTIP_HEIGHT_MIN = 201;
public static final int TOOLTIP_HEIGHT_MAX = 401;
public static final int TOOLTIP_BORDER_WIDTH = 80;
public interface IO {
String imageBaseDir = "plugins" + File.separator + "images";

View file

@ -1,10 +1,10 @@
package org.mage.plugins.card.info;
import java.awt.Color;
import java.awt.Component;
import javax.swing.JEditorPane;
import javax.swing.SwingUtilities;
import mage.client.util.GUISizeHelper;
import mage.client.util.gui.GuiDisplayUtil;
import mage.client.util.gui.GuiDisplayUtil.TextLines;
import mage.components.CardInfoPane;
@ -13,20 +13,43 @@ import mage.view.CardView;
import org.mage.card.arcane.UI;
/**
* Card info pane for displaying card rules.
* Supports drawing mana symbols.
* Card info pane for displaying card rules. Supports drawing mana symbols.
*
* @author nantuko
*/
public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane {
public static final int TOOLTIP_WIDTH_MIN = 160;
public static final int TOOLTIP_HEIGHT_MIN = 120;
public static final int TOOLTIP_HEIGHT_MAX = 300;
public static final int TOOLTIP_BORDER_WIDTH = 80;
private CardView currentCard;
private int type;
private int addWidth;
private int addHeight;
private boolean setSize = false;
public CardInfoPaneImpl() {
UI.setHTMLEditorKit(this);
setEditable(false);
setBackground(Color.white);
setGUISize();
}
public void changeGUISize() {
setGUISize();
this.revalidate();
this.repaint();
}
private void setGUISize() {
addWidth = 20 * GUISizeHelper.cardTooltipFontSize;
addHeight = 12 * GUISizeHelper.cardTooltipFontSize;
setSize = true;
}
@Override
@ -70,20 +93,29 @@ public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane {
return;
}
boolean makeBig = (rules > 5 || ruleLength > 350);
if (setSize) {
if (makeBig) {
type = 0;
} else {
type = 1;
}
}
if (makeBig && type == 0) {
type = 1;
container.setSize(
org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH,
org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MAX + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH
addWidth + TOOLTIP_WIDTH_MIN + TOOLTIP_BORDER_WIDTH,
addHeight + TOOLTIP_HEIGHT_MAX + TOOLTIP_BORDER_WIDTH
);
this.setSize(org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN, org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MAX);
this.setSize(addWidth + TOOLTIP_WIDTH_MIN,
addHeight + TOOLTIP_HEIGHT_MAX);
} else if (!makeBig && type == 1) {
type = 0;
container.setSize(
org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH,
org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MIN + org.mage.plugins.card.constants.Constants.TOOLTIP_BORDER_WIDTH
addWidth + TOOLTIP_WIDTH_MIN + TOOLTIP_BORDER_WIDTH,
addHeight + TOOLTIP_HEIGHT_MIN + TOOLTIP_BORDER_WIDTH
);
this.setSize(org.mage.plugins.card.constants.Constants.TOOLTIP_WIDTH_MIN, org.mage.plugins.card.constants.Constants.TOOLTIP_HEIGHT_MIN);
this.setSize(addWidth + TOOLTIP_WIDTH_MIN,
addHeight + TOOLTIP_HEIGHT_MIN);
}
}

View file

@ -35,17 +35,19 @@ import mage.constants.PlayerAction;
*
* @author LevelX2
*/
public class UserRequestMessage implements Serializable {
private static final long serialVersionUID = 1L;
private final String titel;
private final String message;
private final PlayerAction requestAction;
private UUID relatedUserId;
private String relatedUserName;
private UUID matchId;
private UUID tournamentId;
private UUID gameId;
private UUID roomId;
private UUID tableId;
private String button1Text;
private PlayerAction button1Action;
@ -56,11 +58,9 @@ public class UserRequestMessage implements Serializable {
private String button3Text;
private PlayerAction button3Action;
public UserRequestMessage(String titel, String message, PlayerAction requestAction) {
public UserRequestMessage(String titel, String message) {
this.titel = titel;
this.message = message;
this.requestAction = requestAction;
this.button1Action = null;
this.button2Action = null;
this.button3Action = null;
@ -88,6 +88,7 @@ public class UserRequestMessage implements Serializable {
this.button2Text = text;
this.button2Action = buttonAction;
}
public void setButton3(String text, PlayerAction buttonAction) {
this.button3Text = text;
this.button3Action = buttonAction;
@ -105,10 +106,6 @@ public class UserRequestMessage implements Serializable {
return message;
}
public PlayerAction getRequestAction() {
return requestAction;
}
public UUID getRelatedUserId() {
return relatedUserId;
}
@ -125,6 +122,30 @@ public class UserRequestMessage implements Serializable {
return gameId;
}
public UUID getTournamentId() {
return tournamentId;
}
public void setTournamentId(UUID tournamentId) {
this.tournamentId = tournamentId;
}
public UUID getRoomId() {
return roomId;
}
public void setRoomId(UUID roomId) {
this.roomId = roomId;
}
public UUID getTableId() {
return tableId;
}
public void setTableId(UUID tableId) {
this.tableId = tableId;
}
public String getButton1Text() {
return button1Text;
}

View file

@ -19,6 +19,7 @@
userNamePattern - pattern for user name validity check
maxAiOpponents - number of allowed AI opponents on the server
saveGameActivated - allow game save and replay options (not working correctly yet)
authenticationActivated - "true" = user have to register to signon "false" = user need not to register
* mail configs only needed if authentication is activated:
* if mailUser = "" mailgun is used otherwise nativ mail server on the system

View file

@ -185,7 +185,7 @@ public class GameSessionPlayer extends GameSessionWatcher {
message = "Allow to rollback " + numberTurns + " turns?";
}
UserRequestMessage userRequestMessage = new UserRequestMessage(
"Request by " + requestedUser.getName(), message, PlayerAction.REQUEST_PERMISSION_TO_ROLLBACK_TURN);
"Request by " + requestedUser.getName(), message);
userRequestMessage.setRelatedUser(requestingUserId, requestingUser.getName());
userRequestMessage.setGameId(game.getId());
userRequestMessage.setButton1("Accept", PlayerAction.ADD_PERMISSION_TO_ROLLBACK_TURN);
@ -203,7 +203,7 @@ public class GameSessionPlayer extends GameSessionWatcher {
UserRequestMessage userRequestMessage = new UserRequestMessage(
"User request",
"Allow user <b>" + watcher.getName() + "</b> for this match to see your hand cards?<br>"
+ "(You can revoke this every time using related popup menu item of your battlefield.)", PlayerAction.REQUEST_PERMISSION_TO_SEE_HAND_CARDS);
+ "(You can revoke this every time using related popup menu item of your battlefield.)");
userRequestMessage.setRelatedUser(watcherId, watcher.getName());
userRequestMessage.setGameId(game.getId());
userRequestMessage.setButton1("Accept", PlayerAction.ADD_PERMISSION_TO_SEE_HAND_CARDS);

View file

@ -66,5 +66,17 @@ public enum PlayerAction {
REQUEST_AUTO_ANSWER_TEXT_YES,
REQUEST_AUTO_ANSWER_TEXT_NO,
REQUEST_AUTO_ANSWER_RESET_ALL,
CLIENT_DOWNLOAD_SYMBOLS,
CLIENT_DISCONNECT,
CLIENT_QUIT_TOURNAMENT,
CLIENT_QUIT_DRAFT_TOURNAMENT,
CLIENT_CONCEDE_GAME,
CLIENT_CONCEDE_MATCH,
CLIENT_STOP_WATCHING,
CLIENT_EXIT,
CLIENT_REMOVE_TABLE,
CLIENT_DOWNLOAD_CARD_IMAGES,
CLIENT_RECONNECT,
CLIENT_REPLAY_ACTION,
}

View file

@ -1944,11 +1944,15 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public void resetPlayerPassedActions() {
this.passedAllTurns = false;
this.passed = false;
this.passedTurn = false;
this.passedUntilEndOfTurn = false;
this.passedUntilNextMain = false;
this.passedUntilStackResolved = false;
this.dateLastAddedToStack = null;
this.skippedAtLeastOnce = false;
this.passedAllTurns = false;
this.justActivatedType = null;
}
@Override