forked from External/mage
add card sorting to draft screen
This commit is contained in:
parent
c8c59933eb
commit
d1f0f5bf43
6 changed files with 37 additions and 95 deletions
|
|
@ -23,9 +23,9 @@
|
|||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="draftBooster" max="32767" attributes="0"/>
|
||||
<Component id="draftPicks" alignment="0" pref="570" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="draftPicks" pref="582" max="32767" attributes="0"/>
|
||||
<Component id="draftBooster" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="draftPicks" pref="103" max="32767" attributes="0"/>
|
||||
<Component id="draftPicks" pref="106" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="draftBooster" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="txtTimeRemaining" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="lblMessage" pref="29" max="32767" attributes="0"/>
|
||||
<Component id="lblMessage" pref="32" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="bigCard" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
|
@ -218,7 +218,7 @@
|
|||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="568" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="580" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
|
|
@ -228,16 +228,7 @@
|
|||
</DimensionLayout>
|
||||
</Layout>
|
||||
</Container>
|
||||
<Container class="mage.client.cards.CardGrid" name="draftPicks">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||
<LineBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JLayeredPaneSupportLayout"/>
|
||||
</Container>
|
||||
<Component class="mage.client.cards.CardsList" name="draftPicks">
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
|
||||
public void loadBooster(DraftPickView draftPickView) {
|
||||
draftBooster.loadBooster(draftPickView.getBooster(), bigCard);
|
||||
draftPicks.loadCards(draftPickView.getPicks(), SortBy.NAME, false, bigCard, null);
|
||||
draftPicks.loadCards(draftPickView.getPicks(), bigCard, null);
|
||||
this.draftBooster.clearCardEventListeners();
|
||||
this.draftBooster.addCardEventListener(
|
||||
new Listener<Event> () {
|
||||
|
|
@ -108,7 +108,7 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
DraftPickView view = session.sendCardPick(draftId, (UUID)event.getSource());
|
||||
if (view != null) {
|
||||
draftBooster.loadBooster(view.getBooster(), bigCard);
|
||||
draftPicks.loadCards(view.getPicks(), SortBy.NAME, false, bigCard, null);
|
||||
draftPicks.loadCards(view.getPicks(), bigCard, null);
|
||||
setMessage("Waiting for other players");
|
||||
}
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
txtTimeRemaining = new javax.swing.JTextField();
|
||||
lblMessage = new javax.swing.JLabel();
|
||||
draftBooster = new mage.client.cards.DraftGrid();
|
||||
draftPicks = new mage.client.cards.CardGrid();
|
||||
draftPicks = new mage.client.cards.CardsList();
|
||||
|
||||
jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
.addGap(18, 18, 18)
|
||||
.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, 29, Short.MAX_VALUE)
|
||||
.addComponent(lblMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 32, 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))
|
||||
);
|
||||
|
|
@ -270,15 +270,13 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
draftBooster.setLayout(draftBoosterLayout);
|
||||
draftBoosterLayout.setHorizontalGroup(
|
||||
draftBoosterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 568, Short.MAX_VALUE)
|
||||
.addGap(0, 580, Short.MAX_VALUE)
|
||||
);
|
||||
draftBoosterLayout.setVerticalGroup(
|
||||
draftBoosterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 452, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
draftPicks.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
|
|
@ -286,15 +284,15 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, 0)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(draftBooster, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(draftPicks, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 570, Short.MAX_VALUE)))
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(draftPicks, javax.swing.GroupLayout.DEFAULT_SIZE, 582, Short.MAX_VALUE)
|
||||
.addComponent(draftBooster, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(draftPicks, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)
|
||||
.addComponent(draftPicks, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(draftBooster, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
);
|
||||
|
|
@ -307,7 +305,7 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
private javax.swing.JCheckBox chkPack2;
|
||||
private javax.swing.JCheckBox chkPack3;
|
||||
private mage.client.cards.DraftGrid draftBooster;
|
||||
private mage.client.cards.CardGrid draftPicks;
|
||||
private mage.client.cards.CardsList draftPicks;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JSeparator jSeparator1;
|
||||
private javax.swing.JLabel lblCardNo;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue