From cbf8f02df3b6406342690cb5623f3b9352b63e4d Mon Sep 17 00:00:00 2001 From: magenoxx Date: Wed, 10 Aug 2011 12:27:13 +0400 Subject: [PATCH] Compilation fix --- .../mage/client/dialog/ShowCardsDialog.java | 85 ++++++++++--------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java b/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java index 37232816418..de59bb1c6d6 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java @@ -34,14 +34,6 @@ package mage.client.dialog; -import java.awt.*; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.UUID; - -import javax.swing.*; - -import com.sun.deploy.panel.ITreeNode; import mage.cards.CardDimensions; import mage.cards.MageCard; import mage.client.MageFrame; @@ -54,19 +46,26 @@ import mage.view.AbilityView; import mage.view.CardView; import mage.view.CardsView; +import javax.swing.*; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.UUID; + /** - * * @author BetaSteward_at_googlemail.com */ public class ShowCardsDialog extends MageDialog implements MouseListener { private boolean reloaded = false; - /** Creates new form ShowCardsDialog */ - public ShowCardsDialog() { - initComponents(); + /** + * Creates new form ShowCardsDialog + */ + public ShowCardsDialog() { + initComponents(); this.setModal(false); - } + } public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal) { this.reloaded = true; @@ -104,16 +103,16 @@ public class ShowCardsDialog extends MageDialog implements MouseListener { private void loadCardsFew(CardsView showCards, BigCard bigCard, UUID gameId) { Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight); Dimension dimension = new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight); - for (CardView card: showCards.values()) { + for (CardView card : showCards.values()) { addCard(card, bigCard, gameId, rectangle, dimension); rectangle.translate(Config.dimensions.frameWidth, 0); } cardArea.setPreferredSize(new Dimension(Config.dimensions.frameWidth * showCards.size(), Config.dimensions.frameHeight)); } - + private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle, Dimension dimension) { if (card instanceof AbilityView) { - CardView tmp = ((AbilityView)card).getSourceCard(); + CardView tmp = ((AbilityView) card).getSourceCard(); tmp.overrideRules(card.getRules()); tmp.setIsAbility(true); tmp.overrideTargets(card.getTargets()); @@ -135,7 +134,7 @@ public class ShowCardsDialog extends MageDialog implements MouseListener { Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight); Dimension dimension = new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight); int count = 0; - for (CardView card: showCards.values()) { + for (CardView card : showCards.values()) { addCard(card, bigCard, gameId, rectangle, dimension); if (count >= 20) { rectangle.translate(Config.dimensions.frameWidth, -400); @@ -158,33 +157,34 @@ public class ShowCardsDialog extends MageDialog implements MouseListener { this.reloaded = false; } - /** 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") - // //GEN-BEGIN:initComponents - private void initComponents() { + /** + * This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { - jScrollPane1 = new javax.swing.JScrollPane(); - cardArea = new javax.swing.JLayeredPane(); + jScrollPane1 = new javax.swing.JScrollPane(); + cardArea = new javax.swing.JLayeredPane(); - setClosable(true); - setResizable(true); - getContentPane().setLayout(new java.awt.BorderLayout()); + setClosable(true); + setResizable(true); + getContentPane().setLayout(new java.awt.BorderLayout()); - jScrollPane1.setViewportView(cardArea); + jScrollPane1.setViewportView(cardArea); - getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER); + getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER); - pack(); - }// //GEN-END:initComponents + pack(); + }// //GEN-END:initComponents - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JLayeredPane cardArea; - private javax.swing.JScrollPane jScrollPane1; - // End of variables declaration//GEN-END:variables + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLayeredPane cardArea; + private javax.swing.JScrollPane jScrollPane1; + // End of variables declaration//GEN-END:variables @Override public void mouseClicked(MouseEvent e) { @@ -197,12 +197,15 @@ public class ShowCardsDialog extends MageDialog implements MouseListener { } @Override - public void mouseReleased(MouseEvent e) {} + public void mouseReleased(MouseEvent e) { + } @Override - public void mouseEntered(MouseEvent e) {} + public void mouseEntered(MouseEvent e) { + } @Override - public void mouseExited(MouseEvent e) {} + public void mouseExited(MouseEvent e) { + } }