Fixed a problem that it was not possible to create tournaments with "Human" players ( related to ?).
*/
package mage.client.dialog;
+import java.awt.*;
+import java.io.File;
+import java.util.*;
+import java.util.List;
+import javax.swing.*;
+import javax.swing.filechooser.FileFilter;
import mage.cards.decks.Deck;
import mage.cards.decks.importer.DeckImporterUtil;
import mage.cards.repository.ExpansionInfo;
@@ -55,13 +61,6 @@ import mage.view.TableView;
import mage.view.TournamentTypeView;
import org.apache.log4j.Logger;
-import javax.swing.*;
-import javax.swing.filechooser.FileFilter;
-import java.awt.*;
-import java.io.File;
-import java.util.*;
-import java.util.List;
-
/**
* @author BetaSteward_at_googlemail.com
*/
@@ -127,10 +126,9 @@ public class NewTournamentDialog extends MageDialog {
}
/**
- * 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
@@ -603,7 +601,7 @@ public class NewTournamentDialog extends MageDialog {
DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()),
tOptions.getPassword())) {
for (TournamentPlayerPanel player : players) {
- if (!player.getPlayerType().toString().equals("Human")) {
+ if (!player.getPlayerType().getSelectedItem().toString().equals("Human")) {
if (!player.joinTournamentTable(roomId, table.getTableId(), DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()))) {
// error message must be send by sever
SessionHandler.removeTable(roomId, table.getTableId());
@@ -664,7 +662,6 @@ public class NewTournamentDialog extends MageDialog {
updateNumSeats();
}//GEN-LAST:event_spnNumSeatsStateChanged
-
private void spnNumWinsnumPlayersChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnNumWinsnumPlayersChanged
int numSeats = (Integer) this.spnNumSeats.getValue();
int numWins = (Integer) this.spnNumSeats.getValue();
@@ -693,7 +690,6 @@ public class NewTournamentDialog extends MageDialog {
return "";
}
-
private void cbDraftCubeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbDraftCubeActionPerformed
cubeFromDeckFilename = "";
if (cbDraftCube.getSelectedItem().toString().equals("Cube From Deck")) {
@@ -914,7 +910,6 @@ public class NewTournamentDialog extends MageDialog {
}
-
private void drawPlayers() {
this.pnlOtherPlayers.removeAll();
for (TournamentPlayerPanel panel : players) {
@@ -1039,7 +1034,8 @@ public class NewTournamentDialog extends MageDialog {
}
/**
- * Save the settings to java prefs to reload it next time the dialog will be created
+ * Save the settings to java prefs to reload it next time the dialog will be
+ * created
*
* @param tOptions Tournament options
*/
@@ -1091,7 +1087,6 @@ public class NewTournamentDialog extends MageDialog {
return table;
}
-
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel;
private javax.swing.JButton btnOk;
