From 76ce168436450daff2d4242b1c457fbf853a07b8 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 8 May 2014 22:20:59 +0200 Subject: [PATCH] * Deck editor - Changed wrong reference to images. --- .../java/mage/client/cards/CardsList.form | 9 ++-- .../java/mage/client/cards/CardsList.java | 9 ++-- .../mage/client/deckeditor/CardSelector.form | 46 +++++++++---------- .../mage/client/deckeditor/CardSelector.java | 46 +++++++++---------- .../src/mage/game/TwoPlayerDuel.java | 2 +- 5 files changed, 55 insertions(+), 57 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/cards/CardsList.form b/Mage.Client/src/main/java/mage/client/cards/CardsList.form index 7156ed9cc2..d9cc9dbfad 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardsList.form +++ b/Mage.Client/src/main/java/mage/client/cards/CardsList.form @@ -34,7 +34,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -160,7 +160,7 @@ - + @@ -172,7 +172,6 @@ - @@ -190,7 +189,7 @@ - + diff --git a/Mage.Client/src/main/java/mage/client/cards/CardsList.java b/Mage.Client/src/main/java/mage/client/cards/CardsList.java index 1f7e12bb0e..1137e02e02 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardsList.java +++ b/Mage.Client/src/main/java/mage/client/cards/CardsList.java @@ -432,12 +432,11 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar }); bgView.add(jToggleListView); - jToggleListView.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\list_panel.png")); // NOI18N + jToggleListView.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/list_panel.png"))); // NOI18N jToggleListView.setToolTipText("Shows the cards as a list."); jToggleListView.setMargin(new java.awt.Insets(2, 6, 2, 6)); jToggleListView.setMaximumSize(new java.awt.Dimension(37, 25)); jToggleListView.setMinimumSize(new java.awt.Dimension(37, 25)); - jToggleListView.setOpaque(false); jToggleListView.setPreferredSize(new java.awt.Dimension(37, 22)); jToggleListView.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -446,7 +445,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar }); bgView.add(jToggleCardView); - jToggleCardView.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\card_panel.png")); // NOI18N + jToggleCardView.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/card_panel.png"))); // NOI18N jToggleCardView.setToolTipText("Shows the card as images."); jToggleCardView.setMargin(new java.awt.Insets(2, 6, 2, 6)); jToggleCardView.setPreferredSize(new java.awt.Dimension(33, 22)); @@ -502,14 +501,14 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelCardArea) - .addComponent(panelControl, javax.swing.GroupLayout.DEFAULT_SIZE, 754, Short.MAX_VALUE) + .addComponent(panelControl, javax.swing.GroupLayout.DEFAULT_SIZE, 719, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(panelControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) - .addComponent(panelCardArea, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)) + .addComponent(panelCardArea, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)) ); }// //GEN-END:initComponents diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form index 3ccc88699d..b655fa2e4b 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form +++ b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form @@ -33,7 +33,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -55,17 +55,17 @@ - + - + - + @@ -76,17 +76,17 @@ - + - + - + @@ -98,17 +98,17 @@ - + - + - + @@ -119,7 +119,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -140,7 +140,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -171,7 +171,7 @@ - + @@ -382,7 +382,7 @@ - + @@ -412,7 +412,7 @@ - + @@ -504,7 +504,7 @@ - + @@ -527,7 +527,7 @@ - + @@ -596,7 +596,7 @@ - + @@ -619,7 +619,7 @@ - + diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java index 283ee7e003..1d4348443b 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java @@ -465,18 +465,18 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene tbColor.setFloatable(false); tbColor.setRollover(true); - tbColor.setToolTipText("Click with ALT to deselct all other colors or CTRL for invert selection."); + tbColor.setToolTipText("Click with ALT to deselect all other colors or with CTRL to invert selection."); tbColor.setBorderPainted(false); tbColor.setName(""); // NOI18N - tbRed.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_red_off.png")); // NOI18N + tbRed.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_red_off.png"))); // NOI18N tbRed.setSelected(true); - tbRed.setToolTipText("Red
" + tbRed.setToolTipText("Red
" + tbColor.getToolTipText()); tbRed.setActionCommand("Red"); tbRed.setFocusable(false); tbRed.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - tbRed.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_red.png")); // NOI18N + tbRed.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_red.png"))); // NOI18N tbRed.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); tbRed.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -485,13 +485,13 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene }); tbColor.add(tbRed); - tbGreen.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_green_off.png")); // NOI18N + tbGreen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_green_off.png"))); // NOI18N tbGreen.setSelected(true); - tbGreen.setToolTipText("Green
" + tbColor.getToolTipText()); + tbGreen.setToolTipText("Green
" + tbColor.getToolTipText()); tbGreen.setActionCommand("Green"); tbGreen.setFocusable(false); tbGreen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - tbGreen.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_green.png")); // NOI18N + tbGreen.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_green.png"))); // NOI18N tbGreen.setVerifyInputWhenFocusTarget(false); tbGreen.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); tbGreen.addActionListener(new java.awt.event.ActionListener() { @@ -501,13 +501,13 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene }); tbColor.add(tbGreen); - tbBlue.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_blueOff.png")); // NOI18N + tbBlue.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_blueOff.png"))); // NOI18N tbBlue.setSelected(true); - tbBlue.setToolTipText("Blue
" + tbColor.getToolTipText()); + tbBlue.setToolTipText("Blue
" + tbColor.getToolTipText()); tbBlue.setActionCommand("Blue"); tbBlue.setFocusable(false); tbBlue.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - tbBlue.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_blue.png")); // NOI18N + tbBlue.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_blue.png"))); // NOI18N tbBlue.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); tbBlue.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -516,13 +516,13 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene }); tbColor.add(tbBlue); - tbBlack.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_black_off.png")); // NOI18N + tbBlack.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_black_off.png"))); // NOI18N tbBlack.setSelected(true); tbBlack.setToolTipText("Black
" + tbColor.getToolTipText()); tbBlack.setActionCommand("Black"); tbBlack.setFocusable(false); tbBlack.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - tbBlack.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_black.png")); // NOI18N + tbBlack.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_black.png"))); // NOI18N tbBlack.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); tbBlack.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -531,13 +531,13 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene }); tbColor.add(tbBlack); - tbWhite.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_white_off.png")); // NOI18N + tbWhite.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_white_off.png"))); // NOI18N tbWhite.setSelected(true); tbWhite.setToolTipText("White
" + tbColor.getToolTipText()); tbWhite.setActionCommand("White"); tbWhite.setFocusable(false); tbWhite.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - tbWhite.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_white.png")); // NOI18N + tbWhite.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_white.png"))); // NOI18N tbWhite.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); tbWhite.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -546,13 +546,13 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene }); tbColor.add(tbWhite); - tbColorless.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\colorless_off.png")); // NOI18N + tbColorless.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/colorless_off.png"))); // NOI18N tbColorless.setSelected(true); tbColorless.setToolTipText("Colorless
" + tbColor.getToolTipText()); tbColorless.setActionCommand("Colorless"); tbColorless.setFocusable(false); tbColorless.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - tbColorless.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\colorless.png")); // NOI18N + tbColorless.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/colorless.png"))); // NOI18N tbColorless.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); tbColorless.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -713,7 +713,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene tbTypes.add(jSeparator4); bgView.add(jToggleListView); - jToggleListView.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\list_panel.png")); // NOI18N + jToggleListView.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/list_panel.png"))); // NOI18N jToggleListView.setSelected(true); jToggleListView.setToolTipText("Shows the cards as a list."); jToggleListView.setBorderPainted(false); @@ -731,7 +731,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene tbTypes.add(jToggleListView); bgView.add(jToggleCardView); - jToggleCardView.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\card_panel.png")); // NOI18N + jToggleCardView.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/card_panel.png"))); // NOI18N jToggleCardView.setToolTipText("Shows the card as images."); jToggleCardView.setBorderPainted(false); jToggleCardView.setFocusable(false); @@ -752,7 +752,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene cardSelectorBottomPanel.setOpaque(false); cardSelectorBottomPanel.setPreferredSize(new java.awt.Dimension(897, 40)); - jButtonAddToMain.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\deck_in.png")); // NOI18N + jButtonAddToMain.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/deck_in.png"))); // NOI18N jButtonAddToMain.setToolTipText("Add selected cards to deck"); jButtonAddToMain.setMargin(null); jButtonAddToMain.setMaximumSize(new java.awt.Dimension(42, 23)); @@ -764,7 +764,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene } }); - jButtonAddToSideboard.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\sideboard_in.png")); // NOI18N + jButtonAddToSideboard.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/sideboard_in.png"))); // NOI18N jButtonAddToSideboard.setToolTipText("Add selected cards to sideboard."); jButtonAddToSideboard.setMargin(new java.awt.Insets(2, 0, 2, 0)); jButtonAddToSideboard.setMaximumSize(new java.awt.Dimension(100, 30)); @@ -802,7 +802,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene cardCount.setText("0"); - jButtonRemoveFromMain.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\deck_out.png")); // NOI18N + jButtonRemoveFromMain.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/deck_out.png"))); // NOI18N jButtonRemoveFromMain.setToolTipText("Remove selected cards from deck"); jButtonRemoveFromMain.setMargin(null); jButtonRemoveFromMain.setMaximumSize(new java.awt.Dimension(42, 23)); @@ -814,7 +814,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene } }); - jButtonRemoveFromSideboard.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\sideboard_out.png")); // NOI18N + jButtonRemoveFromSideboard.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/sideboard_out.png"))); // NOI18N jButtonRemoveFromSideboard.setToolTipText("Remove selected cards from sideboard."); jButtonRemoveFromSideboard.setMargin(new java.awt.Insets(2, 0, 2, 0)); jButtonRemoveFromSideboard.setMaximumSize(new java.awt.Dimension(10, 30)); @@ -890,7 +890,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene .addGap(0, 0, 0) .addComponent(tbTypes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cardSelectorScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE) + .addComponent(cardSelectorScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE) .addGap(0, 0, 0) .addComponent(cardSelectorBottomPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) ); diff --git a/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/src/mage/game/TwoPlayerDuel.java b/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/src/mage/game/TwoPlayerDuel.java index 74753a032b..7024f0ad56 100644 --- a/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/src/mage/game/TwoPlayerDuel.java +++ b/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/src/mage/game/TwoPlayerDuel.java @@ -76,7 +76,7 @@ public class TwoPlayerDuel extends GameImpl { @Override public Set getOpponents(UUID playerId) { - Set opponents = new HashSet(); + Set opponents = new HashSet<>(); for (UUID opponentId: this.getPlayer(playerId).getInRange()) { if (!opponentId.equals(playerId)) { opponents.add(opponentId);