mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
* Draft - Added "Quit Tournament" button to draft panel. Minor formatting.
This commit is contained in:
parent
024ec1169a
commit
8d2f4cc9ac
26 changed files with 340 additions and 157 deletions
|
|
@ -158,9 +158,9 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
//TODO: make gray theme, implement theme selector in preferences dialog
|
||||
private static boolean grayMode = false;
|
||||
|
||||
private static final Map<UUID, ChatPanel> chats = new HashMap<UUID, ChatPanel>();
|
||||
private static final Map<UUID, GamePanel> games = new HashMap<UUID, GamePanel>();
|
||||
private static final Map<UUID, DraftPanel> drafts = new HashMap<UUID, DraftPanel>();
|
||||
private static final Map<UUID, ChatPanel> chats = new HashMap<>();
|
||||
private static final Map<UUID, GamePanel> games = new HashMap<>();
|
||||
private static final Map<UUID, DraftPanel> drafts = new HashMap<>();
|
||||
private static final MageUI ui = new MageUI();
|
||||
|
||||
private static final ScheduledExecutorService pingTaskExecutor = Executors.newSingleThreadScheduledExecutor();
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@
|
|||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="bigCard" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
|
|
@ -94,11 +93,22 @@
|
|||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="bigCard" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btnQuitTournament" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="btnQuitTournament" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblPack1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
|
|
@ -122,10 +132,10 @@
|
|||
<Component id="lblCardNo" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="txtCardNo" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="txtTimeRemaining" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="lblMessage" pref="32" max="32767" attributes="0"/>
|
||||
<Component id="lblMessage" pref="24" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="bigCard" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
|
@ -133,58 +143,64 @@
|
|||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="mage.client.cards.BigCard" name="bigCard">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblCardNo">
|
||||
<Component class="javax.swing.JButton" name="btnQuitTournament">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Card #:"/>
|
||||
<Property name="text" type="java.lang.String" value="Quit Tournament"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnQuitTournamentActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPack1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Pack 1:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPack2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Pack 2:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPack3">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Pack 3:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtPack1">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkPack1">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPack2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Pack 2:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtPack2">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkPack2">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPack3">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Pack 3:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtPack3">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkPack3">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblCardNo">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Card #:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtCardNo">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkPack1">
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkPack2">
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkPack3">
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtTimeRemaining">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
|
|
@ -204,6 +220,8 @@
|
|||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="mage.client.cards.BigCard" name="bigCard">
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="mage.client.cards.CardsList" name="draftPicks">
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import java.awt.Component;
|
|||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.UUID;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.Timer;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.deckeditor.SortSettingDraft;
|
||||
|
|
@ -193,42 +194,50 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
|
||||
jSeparator1 = new javax.swing.JSeparator();
|
||||
draftLeftPane = new javax.swing.JPanel();
|
||||
bigCard = new mage.client.cards.BigCard();
|
||||
lblCardNo = new javax.swing.JLabel();
|
||||
btnQuitTournament = new javax.swing.JButton();
|
||||
lblPack1 = new javax.swing.JLabel();
|
||||
lblPack2 = new javax.swing.JLabel();
|
||||
lblPack3 = new javax.swing.JLabel();
|
||||
txtPack1 = new javax.swing.JTextField();
|
||||
txtPack2 = new javax.swing.JTextField();
|
||||
txtPack3 = new javax.swing.JTextField();
|
||||
txtCardNo = new javax.swing.JTextField();
|
||||
chkPack1 = new javax.swing.JCheckBox();
|
||||
lblPack2 = new javax.swing.JLabel();
|
||||
txtPack2 = new javax.swing.JTextField();
|
||||
chkPack2 = new javax.swing.JCheckBox();
|
||||
lblPack3 = new javax.swing.JLabel();
|
||||
txtPack3 = new javax.swing.JTextField();
|
||||
chkPack3 = new javax.swing.JCheckBox();
|
||||
lblCardNo = new javax.swing.JLabel();
|
||||
txtCardNo = new javax.swing.JTextField();
|
||||
txtTimeRemaining = new javax.swing.JTextField();
|
||||
lblMessage = new javax.swing.JLabel();
|
||||
bigCard = new mage.client.cards.BigCard();
|
||||
draftPicks = new mage.client.cards.CardsList();
|
||||
draftBooster = new mage.client.cards.DraftGrid();
|
||||
|
||||
draftLeftPane.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||
|
||||
lblCardNo.setText("Card #:");
|
||||
btnQuitTournament.setText("Quit Tournament");
|
||||
btnQuitTournament.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
btnQuitTournamentActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
lblPack1.setText("Pack 1:");
|
||||
|
||||
lblPack2.setText("Pack 2:");
|
||||
|
||||
lblPack3.setText("Pack 3:");
|
||||
|
||||
txtPack1.setEditable(false);
|
||||
txtPack1.setEnabled(false);
|
||||
|
||||
lblPack2.setText("Pack 2:");
|
||||
|
||||
txtPack2.setEditable(false);
|
||||
txtPack2.setEnabled(false);
|
||||
|
||||
lblPack3.setText("Pack 3:");
|
||||
|
||||
txtPack3.setEditable(false);
|
||||
txtPack3.setEnabled(false);
|
||||
|
||||
lblCardNo.setText("Card #:");
|
||||
|
||||
txtCardNo.setEditable(false);
|
||||
txtCardNo.setEnabled(false);
|
||||
|
||||
|
|
@ -243,7 +252,6 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
draftLeftPane.setLayout(draftLeftPaneLayout);
|
||||
draftLeftPaneLayout.setHorizontalGroup(
|
||||
draftLeftPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(bigCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(draftLeftPaneLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(draftLeftPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
|
@ -273,11 +281,19 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
.addGroup(draftLeftPaneLayout.createSequentialGroup()
|
||||
.addComponent(lblMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE)
|
||||
.addContainerGap())))
|
||||
.addGroup(draftLeftPaneLayout.createSequentialGroup()
|
||||
.addGroup(draftLeftPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(bigCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(draftLeftPaneLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(btnQuitTournament)))
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
);
|
||||
draftLeftPaneLayout.setVerticalGroup(
|
||||
draftLeftPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, draftLeftPaneLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(btnQuitTournament)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(draftLeftPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(lblPack1)
|
||||
.addComponent(txtPack1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
|
|
@ -296,10 +312,10 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
.addGroup(draftLeftPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(lblCardNo)
|
||||
.addComponent(txtCardNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(txtTimeRemaining, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(lblMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE)
|
||||
.addComponent(lblMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(bigCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
);
|
||||
|
|
@ -338,9 +354,16 @@ 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);
|
||||
}
|
||||
}//GEN-LAST:event_btnQuitTournamentActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private mage.client.cards.BigCard bigCard;
|
||||
private javax.swing.JButton btnQuitTournament;
|
||||
private javax.swing.JCheckBox chkPack1;
|
||||
private javax.swing.JCheckBox chkPack2;
|
||||
private javax.swing.JCheckBox chkPack3;
|
||||
|
|
|
|||
|
|
@ -737,6 +737,7 @@ class TableTableModel extends AbstractTableModel {
|
|||
}
|
||||
return "Join";
|
||||
case CONSTRUCTING:
|
||||
case DRAFTING:
|
||||
if (tables[arg0].isTournament()) {
|
||||
return "Show";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -420,7 +420,6 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
}//GEN-LAST:event_btnCloseWindowActionPerformed
|
||||
|
||||
private void btnQuitTournamentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuitTournamentActionPerformed
|
||||
// TODO add your handling code here:
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue