* Some client menu changes.
|
|
@ -26,8 +26,8 @@
|
||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="desktopPane" alignment="0" max="32767" attributes="0"/>
|
<Component id="desktopPane" alignment="0" pref="769" max="32767" attributes="0"/>
|
||||||
<Component id="mageToolbar" alignment="0" pref="697" max="32767" attributes="0"/>
|
<Component id="mageToolbar" alignment="0" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
|
|
@ -78,9 +78,12 @@
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JButton" name="btnPreferences">
|
<Component class="javax.swing.JButton" name="btnPreferences">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/menu/preferences.png"/>
|
||||||
|
</Property>
|
||||||
<Property name="text" type="java.lang.String" value="Preferences"/>
|
<Property name="text" type="java.lang.String" value="Preferences"/>
|
||||||
<Property name="focusable" type="boolean" value="false"/>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
|
|
@ -91,35 +94,36 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnConnect">
|
<Component class="javax.swing.JButton" name="btnConnect">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Connect"/>
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/menu/connect.png"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="toolTipText" type="java.lang.String" value="Connect to or disconnect from a XMage server."/>
|
||||||
<Property name="focusable" type="boolean" value="false"/>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConnectActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConnectActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JToolBar$Separator" name="jSeparator3">
|
<Component class="javax.swing.JLabel" name="lblStatus">
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JButton" name="btnGames">
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Games"/>
|
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||||
<Property name="focusable" type="boolean" value="false"/>
|
<Property name="text" type="java.lang.String" value="Not connected"/>
|
||||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
<Property name="horizontalTextPosition" type="int" value="0"/>
|
||||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
<Property name="inheritsPopupMenu" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnGamesActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JToolBar$Separator" name="jSeparator1">
|
<Component class="javax.swing.JToolBar$Separator" name="jSeparator1">
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnDeckEditor">
|
<Component class="javax.swing.JButton" name="btnDeckEditor">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/menu/deck_editor.png"/>
|
||||||
|
</Property>
|
||||||
<Property name="text" type="java.lang.String" value="Deck Editor"/>
|
<Property name="text" type="java.lang.String" value="Deck Editor"/>
|
||||||
<Property name="focusable" type="boolean" value="false"/>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
|
|
@ -130,9 +134,12 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnCollectionViewer">
|
<Component class="javax.swing.JButton" name="btnCollectionViewer">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Collection Viewer"/>
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/menu/collection.png"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Viewer"/>
|
||||||
<Property name="focusable" type="boolean" value="false"/>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
|
|
@ -143,9 +150,12 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnSendFeedback">
|
<Component class="javax.swing.JButton" name="btnSendFeedback">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/menu/feedback.png"/>
|
||||||
|
</Property>
|
||||||
<Property name="text" type="java.lang.String" value="Feedback"/>
|
<Property name="text" type="java.lang.String" value="Feedback"/>
|
||||||
<Property name="focusable" type="boolean" value="false"/>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
|
|
@ -154,11 +164,48 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JToolBar$Separator" name="jSeparator6">
|
<Component class="javax.swing.JToolBar$Separator" name="jSeparator6">
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnSymbols">
|
||||||
|
<Properties>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/menu/symbol.png"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Symbols"/>
|
||||||
|
<Property name="toolTipText" type="java.lang.String" value="<HTML>Load symbols from the internet.<br>
You need to do that only once."/>
|
||||||
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
|
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||||
|
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSymbolsActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JToolBar$Separator" name="jSeparatorSymbols">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnImages">
|
||||||
|
<Properties>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/menu/images.png"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Images"/>
|
||||||
|
<Property name="toolTipText" type="java.lang.String" value="<HTML>Load card images from external sources."/>
|
||||||
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
|
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||||
|
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnImagesActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JToolBar$Separator" name="jSeparatorImages">
|
||||||
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnAbout">
|
<Component class="javax.swing.JButton" name="btnAbout">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/menu/about.png"/>
|
||||||
|
</Property>
|
||||||
<Property name="text" type="java.lang.String" value="About"/>
|
<Property name="text" type="java.lang.String" value="About"/>
|
||||||
<Property name="focusable" type="boolean" value="false"/>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
|
|
@ -167,30 +214,15 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JToolBar$Separator" name="jSeparator7">
|
<Component class="javax.swing.JToolBar$Separator" name="jSeparator7">
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnExit">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Exit"/>
|
|
||||||
<Property name="focusable" type="boolean" value="false"/>
|
|
||||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
|
||||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExitActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JLabel" name="jMemUsageLabel">
|
<Component class="javax.swing.JLabel" name="jMemUsageLabel">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/menu/memory.png"/>
|
||||||
|
</Property>
|
||||||
<Property name="text" type="java.lang.String" value="100% Free mem"/>
|
<Property name="text" type="java.lang.String" value="100% Free mem"/>
|
||||||
</Properties>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
<AuxValues>
|
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||||
<AuxValue name="JavaCodeGenerator_AddingCodePre" type="java.lang.String" value="mageToolbar.add(Box.createHorizontalGlue());"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JToolBar$Separator" name="jSeparator8">
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JLabel" name="lblStatus">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Not connected "/>
|
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ import java.util.concurrent.TimeUnit;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.swing.AbstractButton;
|
import javax.swing.AbstractButton;
|
||||||
import javax.swing.Box;
|
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.InputMap;
|
import javax.swing.InputMap;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
|
|
@ -79,7 +78,6 @@ import javax.swing.JOptionPane;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JPopupMenu;
|
import javax.swing.JPopupMenu;
|
||||||
import javax.swing.JToggleButton;
|
import javax.swing.JToggleButton;
|
||||||
import javax.swing.JToolBar.Separator;
|
|
||||||
import javax.swing.KeyStroke;
|
import javax.swing.KeyStroke;
|
||||||
import javax.swing.SwingConstants;
|
import javax.swing.SwingConstants;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
|
@ -357,41 +355,8 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
balloonTip.setPositioner(new LeftAbovePositioner(0, 0));
|
balloonTip.setPositioner(new LeftAbovePositioner(0, 0));
|
||||||
balloonTip.setVisible(false);
|
balloonTip.setVisible(false);
|
||||||
|
|
||||||
mageToolbar.add(new javax.swing.JToolBar.Separator());
|
mageToolbar.add(createSwitchPanelsButton(), 0);
|
||||||
mageToolbar.add(createWindowsButton());
|
mageToolbar.add(new javax.swing.JToolBar.Separator(), 1);
|
||||||
|
|
||||||
//TODO: move to plugin impl
|
|
||||||
if (Plugins.getInstance().isCardPluginLoaded()) {
|
|
||||||
Separator separator = new javax.swing.JToolBar.Separator();
|
|
||||||
mageToolbar.add(separator);
|
|
||||||
|
|
||||||
JButton btnDownloadSymbols = new JButton("Symbols");
|
|
||||||
btnDownloadSymbols.setFocusable(false);
|
|
||||||
btnDownloadSymbols.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
|
||||||
btnDownloadSymbols.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
|
||||||
btnDownloadSymbols.addActionListener(new java.awt.event.ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
btnSymbolsActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mageToolbar.add(btnDownloadSymbols);
|
|
||||||
|
|
||||||
separator = new javax.swing.JToolBar.Separator();
|
|
||||||
mageToolbar.add(separator);
|
|
||||||
|
|
||||||
JButton btnDownload = new JButton("Images");
|
|
||||||
btnDownload.setFocusable(false);
|
|
||||||
btnDownload.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
|
||||||
btnDownload.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
|
||||||
btnDownload.addActionListener(new java.awt.event.ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
btnImagesActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mageToolbar.add(btnDownload);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Plugins.getInstance().isCounterPluginLoaded()) {
|
if (Plugins.getInstance().isCounterPluginLoaded()) {
|
||||||
int i = Plugins.getInstance().getGamesPlayed();
|
int i = Plugins.getInstance().getGamesPlayed();
|
||||||
|
|
@ -402,8 +367,6 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
label.setBounds(0, 0, 180, 30);
|
label.setBounds(0, 0, 180, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
UI.addButton(MageComponents.TABLES_MENU_BUTTON, btnGames);
|
|
||||||
|
|
||||||
setGUISize();
|
setGUISize();
|
||||||
|
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
|
@ -567,22 +530,22 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
setIconImage(image);
|
setIconImage(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AbstractButton createWindowsButton() {
|
private AbstractButton createSwitchPanelsButton() {
|
||||||
final JToggleButton windowButton = new JToggleButton("Windows");
|
final JToggleButton switchPanelsButton = new JToggleButton("Switch panels");
|
||||||
windowButton.addItemListener(new ItemListener() {
|
switchPanelsButton.addItemListener(new ItemListener() {
|
||||||
@Override
|
@Override
|
||||||
public void itemStateChanged(ItemEvent e) {
|
public void itemStateChanged(ItemEvent e) {
|
||||||
if (e.getStateChange() == ItemEvent.SELECTED) {
|
if (e.getStateChange() == ItemEvent.SELECTED) {
|
||||||
createAndShowMenu((JComponent) e.getSource(), windowButton);
|
createAndShowSwitchPanelsMenu((JComponent) e.getSource(), switchPanelsButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
windowButton.setFocusable(false);
|
switchPanelsButton.setFocusable(false);
|
||||||
windowButton.setHorizontalTextPosition(SwingConstants.LEADING);
|
switchPanelsButton.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||||
return windowButton;
|
return switchPanelsButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createAndShowMenu(final JComponent component, final AbstractButton windowButton) {
|
private void createAndShowSwitchPanelsMenu(final JComponent component, final AbstractButton windowButton) {
|
||||||
JPopupMenu menu = new JPopupMenu();
|
JPopupMenu menu = new JPopupMenu();
|
||||||
JInternalFrame[] windows = desktopPane.getAllFramesInLayer(javax.swing.JLayeredPane.DEFAULT_LAYER);
|
JInternalFrame[] windows = desktopPane.getAllFramesInLayer(javax.swing.JLayeredPane.DEFAULT_LAYER);
|
||||||
MagePaneMenuItem menuItem;
|
MagePaneMenuItem menuItem;
|
||||||
|
|
@ -641,18 +604,16 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void btnImagesActionPerformed(java.awt.event.ActionEvent evt) {
|
// public void btnImagesActionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
List<CardInfo> cards = CardRepository.instance.findCards(new CardCriteria());
|
// List<CardInfo> cards = CardRepository.instance.findCards(new CardCriteria());
|
||||||
DownloadPictures.startDownload(null, cards);
|
// DownloadPictures.startDownload(null, cards);
|
||||||
}
|
// }
|
||||||
|
// public void btnSymbolsActionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
public void btnSymbolsActionPerformed(java.awt.event.ActionEvent evt) {
|
// UserRequestMessage message = new UserRequestMessage("Download additional resources", "Do you want to download game symbols and additional image files?");
|
||||||
UserRequestMessage message = new UserRequestMessage("Download additional resources", "Do you want to download game symbols and additional image files?");
|
// message.setButton1("No", null);
|
||||||
message.setButton1("No", null);
|
// message.setButton2("Yes", PlayerAction.CLIENT_DOWNLOAD_SYMBOLS);
|
||||||
message.setButton2("Yes", PlayerAction.CLIENT_DOWNLOAD_SYMBOLS);
|
// showUserRequestDialog(message);
|
||||||
showUserRequestDialog(message);
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
public static void setActive(MagePane frame) {
|
public static void setActive(MagePane frame) {
|
||||||
if (frame == null) {
|
if (frame == null) {
|
||||||
activeFrame = null;
|
activeFrame = null;
|
||||||
|
|
@ -888,8 +849,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
btnPreferences = new javax.swing.JButton();
|
btnPreferences = new javax.swing.JButton();
|
||||||
jSeparator4 = new javax.swing.JToolBar.Separator();
|
jSeparator4 = new javax.swing.JToolBar.Separator();
|
||||||
btnConnect = new javax.swing.JButton();
|
btnConnect = new javax.swing.JButton();
|
||||||
jSeparator3 = new javax.swing.JToolBar.Separator();
|
lblStatus = new javax.swing.JLabel();
|
||||||
btnGames = new javax.swing.JButton();
|
|
||||||
jSeparator1 = new javax.swing.JToolBar.Separator();
|
jSeparator1 = new javax.swing.JToolBar.Separator();
|
||||||
btnDeckEditor = new javax.swing.JButton();
|
btnDeckEditor = new javax.swing.JButton();
|
||||||
jSeparator2 = new javax.swing.JToolBar.Separator();
|
jSeparator2 = new javax.swing.JToolBar.Separator();
|
||||||
|
|
@ -897,12 +857,13 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
jSeparator5 = new javax.swing.JToolBar.Separator();
|
jSeparator5 = new javax.swing.JToolBar.Separator();
|
||||||
btnSendFeedback = new javax.swing.JButton();
|
btnSendFeedback = new javax.swing.JButton();
|
||||||
jSeparator6 = new javax.swing.JToolBar.Separator();
|
jSeparator6 = new javax.swing.JToolBar.Separator();
|
||||||
|
btnSymbols = new javax.swing.JButton();
|
||||||
|
jSeparatorSymbols = new javax.swing.JToolBar.Separator();
|
||||||
|
btnImages = new javax.swing.JButton();
|
||||||
|
jSeparatorImages = new javax.swing.JToolBar.Separator();
|
||||||
btnAbout = new javax.swing.JButton();
|
btnAbout = new javax.swing.JButton();
|
||||||
jSeparator7 = new javax.swing.JToolBar.Separator();
|
jSeparator7 = new javax.swing.JToolBar.Separator();
|
||||||
btnExit = new javax.swing.JButton();
|
|
||||||
jMemUsageLabel = new javax.swing.JLabel();
|
jMemUsageLabel = new javax.swing.JLabel();
|
||||||
jSeparator8 = new javax.swing.JToolBar.Separator();
|
|
||||||
lblStatus = new javax.swing.JLabel();
|
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
|
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||||
setMinimumSize(new java.awt.Dimension(1024, 768));
|
setMinimumSize(new java.awt.Dimension(1024, 768));
|
||||||
|
|
@ -916,9 +877,10 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
mageToolbar.setMinimumSize(new java.awt.Dimension(566, 60));
|
mageToolbar.setMinimumSize(new java.awt.Dimension(566, 60));
|
||||||
mageToolbar.setPreferredSize(new java.awt.Dimension(614, 60));
|
mageToolbar.setPreferredSize(new java.awt.Dimension(614, 60));
|
||||||
|
|
||||||
|
btnPreferences.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menu/preferences.png"))); // NOI18N
|
||||||
btnPreferences.setText("Preferences");
|
btnPreferences.setText("Preferences");
|
||||||
btnPreferences.setFocusable(false);
|
btnPreferences.setFocusable(false);
|
||||||
btnPreferences.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
btnPreferences.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||||
btnPreferences.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
btnPreferences.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||||
btnPreferences.addActionListener(new java.awt.event.ActionListener() {
|
btnPreferences.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
|
@ -928,9 +890,10 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
mageToolbar.add(btnPreferences);
|
mageToolbar.add(btnPreferences);
|
||||||
mageToolbar.add(jSeparator4);
|
mageToolbar.add(jSeparator4);
|
||||||
|
|
||||||
btnConnect.setText("Connect");
|
btnConnect.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menu/connect.png"))); // NOI18N
|
||||||
|
btnConnect.setToolTipText("Connect to or disconnect from a XMage server.");
|
||||||
btnConnect.setFocusable(false);
|
btnConnect.setFocusable(false);
|
||||||
btnConnect.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
btnConnect.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||||
btnConnect.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
btnConnect.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||||
btnConnect.addActionListener(new java.awt.event.ActionListener() {
|
btnConnect.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
|
@ -938,23 +901,18 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mageToolbar.add(btnConnect);
|
mageToolbar.add(btnConnect);
|
||||||
mageToolbar.add(jSeparator3);
|
|
||||||
|
|
||||||
btnGames.setText("Games");
|
lblStatus.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||||
btnGames.setFocusable(false);
|
lblStatus.setText("Not connected");
|
||||||
btnGames.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
lblStatus.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||||
btnGames.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
lblStatus.setInheritsPopupMenu(false);
|
||||||
btnGames.addActionListener(new java.awt.event.ActionListener() {
|
mageToolbar.add(lblStatus);
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
btnGamesActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mageToolbar.add(btnGames);
|
|
||||||
mageToolbar.add(jSeparator1);
|
mageToolbar.add(jSeparator1);
|
||||||
|
|
||||||
|
btnDeckEditor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menu/deck_editor.png"))); // NOI18N
|
||||||
btnDeckEditor.setText("Deck Editor");
|
btnDeckEditor.setText("Deck Editor");
|
||||||
btnDeckEditor.setFocusable(false);
|
btnDeckEditor.setFocusable(false);
|
||||||
btnDeckEditor.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
btnDeckEditor.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||||
btnDeckEditor.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
btnDeckEditor.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||||
btnDeckEditor.addActionListener(new java.awt.event.ActionListener() {
|
btnDeckEditor.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
|
@ -964,9 +922,10 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
mageToolbar.add(btnDeckEditor);
|
mageToolbar.add(btnDeckEditor);
|
||||||
mageToolbar.add(jSeparator2);
|
mageToolbar.add(jSeparator2);
|
||||||
|
|
||||||
btnCollectionViewer.setText("Collection Viewer");
|
btnCollectionViewer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menu/collection.png"))); // NOI18N
|
||||||
|
btnCollectionViewer.setText("Viewer");
|
||||||
btnCollectionViewer.setFocusable(false);
|
btnCollectionViewer.setFocusable(false);
|
||||||
btnCollectionViewer.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
btnCollectionViewer.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||||
btnCollectionViewer.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
btnCollectionViewer.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||||
btnCollectionViewer.addActionListener(new java.awt.event.ActionListener() {
|
btnCollectionViewer.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
|
@ -976,9 +935,10 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
mageToolbar.add(btnCollectionViewer);
|
mageToolbar.add(btnCollectionViewer);
|
||||||
mageToolbar.add(jSeparator5);
|
mageToolbar.add(jSeparator5);
|
||||||
|
|
||||||
|
btnSendFeedback.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menu/feedback.png"))); // NOI18N
|
||||||
btnSendFeedback.setText("Feedback");
|
btnSendFeedback.setText("Feedback");
|
||||||
btnSendFeedback.setFocusable(false);
|
btnSendFeedback.setFocusable(false);
|
||||||
btnSendFeedback.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
btnSendFeedback.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||||
btnSendFeedback.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
btnSendFeedback.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||||
btnSendFeedback.addActionListener(new java.awt.event.ActionListener() {
|
btnSendFeedback.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
|
@ -988,9 +948,38 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
mageToolbar.add(btnSendFeedback);
|
mageToolbar.add(btnSendFeedback);
|
||||||
mageToolbar.add(jSeparator6);
|
mageToolbar.add(jSeparator6);
|
||||||
|
|
||||||
|
btnSymbols.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menu/symbol.png"))); // NOI18N
|
||||||
|
btnSymbols.setText("Symbols");
|
||||||
|
btnSymbols.setToolTipText("<HTML>Load symbols from the internet.<br>\nYou need to do that only once.");
|
||||||
|
btnSymbols.setFocusable(false);
|
||||||
|
btnSymbols.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||||
|
btnSymbols.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||||
|
btnSymbols.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnSymbolsActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mageToolbar.add(btnSymbols);
|
||||||
|
mageToolbar.add(jSeparatorSymbols);
|
||||||
|
|
||||||
|
btnImages.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menu/images.png"))); // NOI18N
|
||||||
|
btnImages.setText("Images");
|
||||||
|
btnImages.setToolTipText("<HTML>Load card images from external sources.");
|
||||||
|
btnImages.setFocusable(false);
|
||||||
|
btnImages.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||||
|
btnImages.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||||
|
btnImages.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnImagesActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mageToolbar.add(btnImages);
|
||||||
|
mageToolbar.add(jSeparatorImages);
|
||||||
|
|
||||||
|
btnAbout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menu/about.png"))); // NOI18N
|
||||||
btnAbout.setText("About");
|
btnAbout.setText("About");
|
||||||
btnAbout.setFocusable(false);
|
btnAbout.setFocusable(false);
|
||||||
btnAbout.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
btnAbout.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||||
btnAbout.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
btnAbout.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||||
btnAbout.addActionListener(new java.awt.event.ActionListener() {
|
btnAbout.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
|
@ -1000,31 +989,19 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
mageToolbar.add(btnAbout);
|
mageToolbar.add(btnAbout);
|
||||||
mageToolbar.add(jSeparator7);
|
mageToolbar.add(jSeparator7);
|
||||||
|
|
||||||
btnExit.setText("Exit");
|
jMemUsageLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||||
btnExit.setFocusable(false);
|
jMemUsageLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menu/memory.png"))); // NOI18N
|
||||||
btnExit.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
|
||||||
btnExit.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
|
||||||
btnExit.addActionListener(new java.awt.event.ActionListener() {
|
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
btnExitActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mageToolbar.add(btnExit);
|
|
||||||
|
|
||||||
jMemUsageLabel.setText("100% Free mem");
|
jMemUsageLabel.setText("100% Free mem");
|
||||||
mageToolbar.add(Box.createHorizontalGlue());
|
jMemUsageLabel.setFocusable(false);
|
||||||
|
jMemUsageLabel.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||||
mageToolbar.add(jMemUsageLabel);
|
mageToolbar.add(jMemUsageLabel);
|
||||||
mageToolbar.add(jSeparator8);
|
|
||||||
|
|
||||||
lblStatus.setText("Not connected ");
|
|
||||||
mageToolbar.add(lblStatus);
|
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(desktopPane)
|
.addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 769, Short.MAX_VALUE)
|
||||||
.addComponent(mageToolbar, javax.swing.GroupLayout.DEFAULT_SIZE, 697, Short.MAX_VALUE)
|
.addComponent(mageToolbar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
|
@ -1041,14 +1018,6 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
showDeckEditor(DeckEditorMode.FREE_BUILDING, null, null, 0);
|
showDeckEditor(DeckEditorMode.FREE_BUILDING, null, null, 0);
|
||||||
}//GEN-LAST:event_btnDeckEditorActionPerformed
|
}//GEN-LAST:event_btnDeckEditorActionPerformed
|
||||||
|
|
||||||
private void btnGamesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGamesActionPerformed
|
|
||||||
this.showGames(true);
|
|
||||||
}//GEN-LAST:event_btnGamesActionPerformed
|
|
||||||
|
|
||||||
private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
|
|
||||||
exitApp();
|
|
||||||
}//GEN-LAST:event_btnExitActionPerformed
|
|
||||||
|
|
||||||
private void btnConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConnectActionPerformed
|
private void btnConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConnectActionPerformed
|
||||||
if (SessionHandler.isConnected()) {
|
if (SessionHandler.isConnected()) {
|
||||||
UserRequestMessage message = new UserRequestMessage("Confirm disconnect", "Are you sure you want to disconnect?");
|
UserRequestMessage message = new UserRequestMessage("Confirm disconnect", "Are you sure you want to disconnect?");
|
||||||
|
|
@ -1090,6 +1059,26 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
FeedbackDialog.main(new String[]{});
|
FeedbackDialog.main(new String[]{});
|
||||||
}//GEN-LAST:event_btnSendFeedbackActionPerformed
|
}//GEN-LAST:event_btnSendFeedbackActionPerformed
|
||||||
|
|
||||||
|
private void btnSymbolsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSymbolsActionPerformed
|
||||||
|
downloadAdditionalResources();
|
||||||
|
}//GEN-LAST:event_btnSymbolsActionPerformed
|
||||||
|
|
||||||
|
public void downloadAdditionalResources() {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnImagesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImagesActionPerformed
|
||||||
|
downloadImages();
|
||||||
|
}//GEN-LAST:event_btnImagesActionPerformed
|
||||||
|
|
||||||
|
public void downloadImages() {
|
||||||
|
List<CardInfo> cards = CardRepository.instance.findCards(new CardCriteria());
|
||||||
|
DownloadPictures.startDownload(null, cards);
|
||||||
|
}
|
||||||
|
|
||||||
public void exitApp() {
|
public void exitApp() {
|
||||||
if (SessionHandler.isConnected()) {
|
if (SessionHandler.isConnected()) {
|
||||||
UserRequestMessage message = new UserRequestMessage("Confirm disconnect", "You are currently connected. Are you sure you want to disconnect?");
|
UserRequestMessage message = new UserRequestMessage("Confirm disconnect", "You are currently connected. Are you sure you want to disconnect?");
|
||||||
|
|
@ -1106,15 +1095,11 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
|
|
||||||
public void enableButtons() {
|
public void enableButtons() {
|
||||||
btnConnect.setEnabled(true);
|
btnConnect.setEnabled(true);
|
||||||
btnConnect.setText("Disconnect");
|
|
||||||
btnGames.setEnabled(true);
|
|
||||||
btnDeckEditor.setEnabled(true);
|
btnDeckEditor.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableButtons() {
|
public void disableButtons() {
|
||||||
btnConnect.setEnabled(true);
|
btnConnect.setEnabled(true);
|
||||||
btnConnect.setText("Connect");
|
|
||||||
btnGames.setEnabled(false);
|
|
||||||
btnDeckEditor.setEnabled(true);
|
btnDeckEditor.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1131,9 +1116,9 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
if (setActive) {
|
if (setActive) {
|
||||||
setActive(tablesPane);
|
setActive(tablesPane);
|
||||||
} else // if other panel was already shown, mamke sure it's topmost again
|
} else // if other panel was already shown, mamke sure it's topmost again
|
||||||
if (topPanebefore != null) {
|
if (topPanebefore != null) {
|
||||||
setActive(topPanebefore);
|
setActive(topPanebefore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideGames() {
|
public void hideGames() {
|
||||||
|
|
@ -1305,20 +1290,20 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
private javax.swing.JButton btnCollectionViewer;
|
private javax.swing.JButton btnCollectionViewer;
|
||||||
private javax.swing.JButton btnConnect;
|
private javax.swing.JButton btnConnect;
|
||||||
private javax.swing.JButton btnDeckEditor;
|
private javax.swing.JButton btnDeckEditor;
|
||||||
private javax.swing.JButton btnExit;
|
private javax.swing.JButton btnImages;
|
||||||
private javax.swing.JButton btnGames;
|
|
||||||
private javax.swing.JButton btnPreferences;
|
private javax.swing.JButton btnPreferences;
|
||||||
private javax.swing.JButton btnSendFeedback;
|
private javax.swing.JButton btnSendFeedback;
|
||||||
|
private javax.swing.JButton btnSymbols;
|
||||||
private static javax.swing.JDesktopPane desktopPane;
|
private static javax.swing.JDesktopPane desktopPane;
|
||||||
private javax.swing.JLabel jMemUsageLabel;
|
private javax.swing.JLabel jMemUsageLabel;
|
||||||
private javax.swing.JToolBar.Separator jSeparator1;
|
private javax.swing.JToolBar.Separator jSeparator1;
|
||||||
private javax.swing.JToolBar.Separator jSeparator2;
|
private javax.swing.JToolBar.Separator jSeparator2;
|
||||||
private javax.swing.JToolBar.Separator jSeparator3;
|
|
||||||
private javax.swing.JToolBar.Separator jSeparator4;
|
private javax.swing.JToolBar.Separator jSeparator4;
|
||||||
private javax.swing.JToolBar.Separator jSeparator5;
|
private javax.swing.JToolBar.Separator jSeparator5;
|
||||||
private javax.swing.JToolBar.Separator jSeparator6;
|
private javax.swing.JToolBar.Separator jSeparator6;
|
||||||
private javax.swing.JToolBar.Separator jSeparator7;
|
private javax.swing.JToolBar.Separator jSeparator7;
|
||||||
private javax.swing.JToolBar.Separator jSeparator8;
|
private javax.swing.JToolBar.Separator jSeparatorImages;
|
||||||
|
private javax.swing.JToolBar.Separator jSeparatorSymbols;
|
||||||
private javax.swing.JLabel lblStatus;
|
private javax.swing.JLabel lblStatus;
|
||||||
private javax.swing.JToolBar mageToolbar;
|
private javax.swing.JToolBar mageToolbar;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
@ -1330,7 +1315,9 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
|
|
||||||
public void setStatusText(String status) {
|
public void setStatusText(String status) {
|
||||||
this.lblStatus.setText(status);
|
this.lblStatus.setText(status);
|
||||||
changeGUISize(); // Needed to layout the tooltbar after text length chnage
|
changeGUISize(); // Needed to layout the tooltbar after text length change
|
||||||
|
this.lblStatus.repaint();
|
||||||
|
this.lblStatus.revalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MageUI getUI() {
|
public static MageUI getUI() {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
package mage.client.components.tray;
|
package mage.client.components.tray;
|
||||||
|
|
||||||
import mage.client.MageFrame;
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
|
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
import mage.client.MageFrame;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author noxx
|
* @author noxx
|
||||||
|
|
@ -63,14 +62,14 @@ public class MageTray {
|
||||||
imagesItem.addActionListener(new ActionListener() {
|
imagesItem.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
MageFrame.getInstance().btnImagesActionPerformed(null);
|
MageFrame.getInstance().downloadImages();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
iconsItem.addActionListener(new ActionListener() {
|
iconsItem.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
MageFrame.getInstance().btnSymbolsActionPerformed(null);
|
MageFrame.getInstance().downloadAdditionalResources();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,23 +3,18 @@
|
||||||
*
|
*
|
||||||
* Created on 08.04.2010
|
* Created on 08.04.2010
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.mage.plugins.card.dl.beans;
|
package org.mage.plugins.card.dl.beans;
|
||||||
|
|
||||||
|
|
||||||
import static java.util.Arrays.*;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.EventListener;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.collect.AbstractIterator;
|
import com.google.common.collect.AbstractIterator;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import static java.util.Arrays.*;
|
||||||
|
import java.util.EventListener;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class EventListenerList.
|
* The class EventListenerList.
|
||||||
|
|
@ -28,12 +23,15 @@ import com.google.common.collect.Lists;
|
||||||
* @author Clemens Koza
|
* @author Clemens Koza
|
||||||
*/
|
*/
|
||||||
public class EventListenerList extends javax.swing.event.EventListenerList {
|
public class EventListenerList extends javax.swing.event.EventListenerList {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7545754245081842909L;
|
private static final long serialVersionUID = -7545754245081842909L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an iterable over all listeners for the specified classes. the listener classes are in the specified
|
* Returns an iterable over all listeners for the specified classes. the
|
||||||
* order. for every class, listeners are in the reverse order of registering. A listener contained multiple
|
* listener classes are in the specified order. for every class, listeners
|
||||||
* times (for a single or multiple classes) is only returned the first time it occurs.
|
* are in the reverse order of registering. A listener contained multiple
|
||||||
|
* times (for a single or multiple classes) is only returned the first time
|
||||||
|
* it occurs.
|
||||||
*/
|
*/
|
||||||
public <T extends EventListener> Iterable<T> getIterable(final Class<? extends T>... listenerClass) {
|
public <T extends EventListener> Iterable<T> getIterable(final Class<? extends T>... listenerClass) {
|
||||||
//transform class -> iterable
|
//transform class -> iterable
|
||||||
|
|
@ -51,22 +49,30 @@ public class EventListenerList extends javax.swing.event.EventListenerList {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an iterator over all listeners for the specified classes. the listener classes are in the specified
|
* Returns an iterator over all listeners for the specified classes. the
|
||||||
* order. for every class, listeners are in the reverse order of registering. A listener contained multiple
|
* listener classes are in the specified order. for every class, listeners
|
||||||
* times (for a single or multiple classes) is only returned the first time it occurs.
|
* are in the reverse order of registering. A listener contained multiple
|
||||||
|
* times (for a single or multiple classes) is only returned the first time
|
||||||
|
* it occurs.
|
||||||
|
*
|
||||||
|
* @param <T>
|
||||||
|
* @param listenerClass
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public <T extends EventListener> Iterator<T> getIterator(Class<? extends T>... listenerClass) {
|
public <T extends EventListener> Iterator<T> getIterator(Class<? extends T>... listenerClass) {
|
||||||
return getIterable(listenerClass).iterator();
|
return getIterable(listenerClass).iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates backwards over the listeners registered for a class by using the original array. The Listener runs
|
* Iterates backwards over the listeners registered for a class by using the
|
||||||
* backwards, just as listener notification usually works.
|
* original array. The Listener runs backwards, just as listener
|
||||||
|
* notification usually works.
|
||||||
*/
|
*/
|
||||||
private class ListenerIterator<T> extends AbstractIterator<T> {
|
private class ListenerIterator<T> extends AbstractIterator<T> {
|
||||||
|
|
||||||
private final Class<? extends T> listenerClass;
|
private final Class<? extends T> listenerClass;
|
||||||
private Object[] listeners = listenerList;
|
private Object[] listeners = listenerList;
|
||||||
private int index = listeners.length;
|
private int index = listeners.length;
|
||||||
|
|
||||||
private ListenerIterator(Class<? extends T> listenerClass) {
|
private ListenerIterator(Class<? extends T> listenerClass) {
|
||||||
this.listenerClass = listenerClass;
|
this.listenerClass = listenerClass;
|
||||||
|
|
@ -75,8 +81,10 @@ public class EventListenerList extends javax.swing.event.EventListenerList {
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
protected T computeNext() {
|
protected T computeNext() {
|
||||||
for(index -= 2; index >= 0; index -= 2) {
|
for (index -= 2; index >= 0; index -= 2) {
|
||||||
if(listenerClass == listeners[index]) return (T) listeners[index + 1];
|
if (listenerClass == listeners[index]) {
|
||||||
|
return (T) listeners[index + 1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return endOfData();
|
return endOfData();
|
||||||
}
|
}
|
||||||
|
|
@ -98,22 +106,25 @@ public class EventListenerList extends javax.swing.event.EventListenerList {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters the delegate iterator so that every but the first occurrence of every element is ignored.
|
* Filters the delegate iterator so that every but the first occurrence of
|
||||||
|
* every element is ignored.
|
||||||
*/
|
*/
|
||||||
private static class SingletonIterator<T> extends AbstractIterator<T> {
|
private static class SingletonIterator<T> extends AbstractIterator<T> {
|
||||||
|
|
||||||
private Iterator<T> it;
|
private Iterator<T> it;
|
||||||
private HashSet<T> previous = new HashSet<T>();
|
private HashSet<T> previous = new HashSet<T>();
|
||||||
|
|
||||||
public SingletonIterator(Iterator<T> it) {
|
public SingletonIterator(Iterator<T> it) {
|
||||||
this.it = it;
|
this.it = it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected T computeNext() {
|
protected T computeNext() {
|
||||||
while(it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
T next = it.next();
|
T next = it.next();
|
||||||
if(previous.add(next)) return next;
|
if (previous.add(next)) {
|
||||||
|
return next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return endOfData();
|
return endOfData();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
Mage.Client/src/main/resources/menu/about.png
Normal file
|
After Width: | Height: | Size: 860 B |
BIN
Mage.Client/src/main/resources/menu/collection.png
Normal file
|
After Width: | Height: | Size: 366 B |
BIN
Mage.Client/src/main/resources/menu/connect.png
Normal file
|
After Width: | Height: | Size: 636 B |
BIN
Mage.Client/src/main/resources/menu/deck_editor.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
Mage.Client/src/main/resources/menu/feedback.png
Normal file
|
After Width: | Height: | Size: 547 B |
BIN
Mage.Client/src/main/resources/menu/images.png
Normal file
|
After Width: | Height: | Size: 811 B |
BIN
Mage.Client/src/main/resources/menu/memory.png
Normal file
|
After Width: | Height: | Size: 675 B |
BIN
Mage.Client/src/main/resources/menu/preferences.png
Normal file
|
After Width: | Height: | Size: 512 B |
BIN
Mage.Client/src/main/resources/menu/symbol.png
Normal file
|
After Width: | Height: | Size: 376 B |