mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
[deckeditor] Refactored card selectors according to MVC. As a result the list and gridcard view have shared filter and it is possible to search cards in gridcard view.
This commit is contained in:
parent
3b4a59b16f
commit
cf931fd02e
6 changed files with 384 additions and 42 deletions
|
|
@ -28,8 +28,12 @@
|
||||||
|
|
||||||
package mage.client.cards;
|
package mage.client.cards;
|
||||||
|
|
||||||
|
import mage.client.constants.Constants;
|
||||||
import mage.client.util.Event;
|
import mage.client.util.Event;
|
||||||
import mage.client.util.Listener;
|
import mage.client.util.Listener;
|
||||||
|
import mage.view.CardsView;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for card container.
|
* Interface for card container.
|
||||||
|
|
@ -38,6 +42,8 @@ import mage.client.util.Listener;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface ICardGrid {
|
public interface ICardGrid {
|
||||||
void clearCardEventListeners();
|
void clearCardEventListeners();
|
||||||
void addCardEventListener(Listener<Event> listener);
|
void addCardEventListener(Listener<Event> listener);
|
||||||
|
void drawCards(Constants.SortBy sortBy, boolean piles);
|
||||||
|
void loadCards(CardsView showCards, Constants.SortBy sortBy, boolean piles, BigCard bigCard, UUID gameId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,11 @@
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="tbColor" alignment="0" pref="917" max="32767" attributes="0"/>
|
<Component id="tbColor" alignment="0" pref="917" max="32767" attributes="0"/>
|
||||||
<Component id="tbTypes" alignment="0" pref="917" max="32767" attributes="0"/>
|
<Component id="tbTypes" alignment="0" pref="917" max="32767" attributes="0"/>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
<Component id="jScrollPane1" alignment="0" pref="917" max="32767" attributes="0"/>
|
<Component id="jScrollPane1" alignment="0" pref="917" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
|
@ -27,8 +32,10 @@
|
||||||
<Component id="tbColor" min="-2" pref="25" max="-2" attributes="0"/>
|
<Component id="tbColor" min="-2" pref="25" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="tbTypes" min="-2" pref="25" max="-2" attributes="0"/>
|
<Component id="tbTypes" min="-2" pref="25" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="jScrollPane1" pref="316" max="32767" attributes="0"/>
|
<Component id="jScrollPane1" pref="273" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jPanel1" min="-2" pref="35" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
|
@ -281,6 +288,111 @@
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbSortByActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbSortByActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JToggleButton" name="jToggleListView">
|
||||||
|
<Properties>
|
||||||
|
<Property name="selected" type="boolean" value="true"/>
|
||||||
|
<Property name="text" type="java.lang.String" value="ListView"/>
|
||||||
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
|
<Property name="horizontalTextPosition" type="int" value="0"/>
|
||||||
|
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jToggleListViewActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JToggleButton" name="jToggleCardView">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="CardView"/>
|
||||||
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
|
<Property name="horizontalTextPosition" type="int" value="0"/>
|
||||||
|
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jToggleCardViewActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="opaque" type="boolean" value="false"/>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[897, 35]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jButtonAddToMain" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jButtonAddToSideboard" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="jTextFieldSearch" min="-2" pref="112" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jButtonSearch" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jButtonClean" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="294" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jButtonAddToMain" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jButtonAddToSideboard" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jTextFieldSearch" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jButtonSearch" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jButtonClean" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="jButtonAddToMain">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Add to Main"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonAddToMainActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="jButtonAddToSideboard">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Add to Sideboard"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonAddToSideboardActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Search (by name,in rules):"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="jTextFieldSearch">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="jButtonSearch">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Search"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonSearchActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="jButtonClean">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Clear"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonCleanActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
|
|
|
||||||
|
|
@ -40,22 +40,28 @@ import mage.cards.ExpansionSet;
|
||||||
import mage.client.cards.BigCard;
|
import mage.client.cards.BigCard;
|
||||||
import mage.client.cards.CardGrid;
|
import mage.client.cards.CardGrid;
|
||||||
import mage.client.cards.CardsStorage;
|
import mage.client.cards.CardsStorage;
|
||||||
|
import mage.client.cards.ICardGrid;
|
||||||
|
import mage.client.constants.Constants;
|
||||||
import mage.client.constants.Constants.SortBy;
|
import mage.client.constants.Constants.SortBy;
|
||||||
|
import mage.client.deckeditor.table.TableModel;
|
||||||
import mage.filter.Filter.ComparisonScope;
|
import mage.filter.Filter.ComparisonScope;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.sets.Sets;
|
import mage.sets.Sets;
|
||||||
import mage.view.CardsView;
|
import mage.view.CardsView;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import javax.swing.table.DefaultTableCellRenderer;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.ComponentEvent;
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.ComponentListener;
|
import java.awt.event.ComponentListener;
|
||||||
|
import java.awt.event.MouseAdapter;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com, nantuko
|
||||||
*/
|
*/
|
||||||
public class CardSelector extends javax.swing.JPanel implements ComponentListener {
|
public class CardSelector extends javax.swing.JPanel implements ComponentListener {
|
||||||
|
|
||||||
|
|
@ -66,15 +72,56 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
/** Creates new form CardSelector */
|
/** Creates new form CardSelector */
|
||||||
public CardSelector() {
|
public CardSelector() {
|
||||||
initComponents();
|
initComponents();
|
||||||
|
makeTransparent();
|
||||||
|
initListViewComponents();
|
||||||
|
currentView = mainModel; // by default we have List (table) view
|
||||||
|
}
|
||||||
|
|
||||||
|
public void makeTransparent() {
|
||||||
this.addComponentListener(this);
|
this.addComponentListener(this);
|
||||||
setOpaque(false);
|
setOpaque(false);
|
||||||
cardGrid.setOpaque(false);
|
cardGrid.setOpaque(false);
|
||||||
jScrollPane1.setOpaque(false);
|
jScrollPane1.setOpaque(false);
|
||||||
jScrollPane1.getViewport().setOpaque(false);
|
jScrollPane1.getViewport().setOpaque(false);
|
||||||
cbSortBy.setModel(new DefaultComboBoxModel(SortBy.values()));
|
cbSortBy.setModel(new DefaultComboBoxModel(SortBy.values()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initListViewComponents() {
|
||||||
|
mainTable = new JTable();
|
||||||
|
|
||||||
|
mainModel = new TableModel();
|
||||||
|
mainModel.addListeners(mainTable);
|
||||||
|
|
||||||
|
mainTable.setModel(mainModel);
|
||||||
|
mainTable.setForeground(Color.white);
|
||||||
|
DefaultTableCellRenderer myRenderer = (DefaultTableCellRenderer) mainTable.getDefaultRenderer(String.class);
|
||||||
|
myRenderer.setBackground(new Color(0, 0, 0, 100));
|
||||||
|
mainTable.getColumnModel().getColumn(0).setMaxWidth(0);
|
||||||
|
mainTable.getColumnModel().getColumn(0).setPreferredWidth(10);
|
||||||
|
mainTable.getColumnModel().getColumn(1).setPreferredWidth(110);
|
||||||
|
mainTable.getColumnModel().getColumn(2).setPreferredWidth(90);
|
||||||
|
mainTable.getColumnModel().getColumn(3).setPreferredWidth(50);
|
||||||
|
mainTable.getColumnModel().getColumn(4).setPreferredWidth(170);
|
||||||
|
mainTable.getColumnModel().getColumn(5).setPreferredWidth(30);
|
||||||
|
mainTable.getColumnModel().getColumn(6).setPreferredWidth(15);
|
||||||
|
mainTable.getColumnModel().getColumn(7).setPreferredWidth(15);
|
||||||
|
|
||||||
|
jScrollPane1.setViewportView(mainTable);
|
||||||
|
|
||||||
mainTable.setOpaque(false);
|
mainTable.setOpaque(false);
|
||||||
}
|
|
||||||
|
cbSortBy.setEnabled(false);
|
||||||
|
chkPiles.setEnabled(false);
|
||||||
|
|
||||||
|
mainTable.addMouseListener(new MouseAdapter() {
|
||||||
|
public void mousePressed(MouseEvent e) {
|
||||||
|
if (e.getClickCount() == 2 && !e.isConsumed()) {
|
||||||
|
e.consume();
|
||||||
|
//TODO: jButtonAddToMainActionPerformed(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void loadCards(List<Card> sideboard, BigCard bigCard, boolean construct) {
|
public void loadCards(List<Card> sideboard, BigCard bigCard, boolean construct) {
|
||||||
this.bigCard = bigCard;
|
this.bigCard = bigCard;
|
||||||
|
|
@ -146,7 +193,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
filteredCards.add(card);
|
filteredCards.add(card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.cardGrid.loadCards(new CardsView(filteredCards), (SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected(), bigCard, null);
|
this.currentView.loadCards(new CardsView(filteredCards), (SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected(), bigCard, null);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||||
|
|
@ -214,6 +261,15 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
rdoPlaneswalkers = new javax.swing.JRadioButton();
|
rdoPlaneswalkers = new javax.swing.JRadioButton();
|
||||||
chkPiles = new javax.swing.JCheckBox();
|
chkPiles = new javax.swing.JCheckBox();
|
||||||
cbSortBy = new javax.swing.JComboBox();
|
cbSortBy = new javax.swing.JComboBox();
|
||||||
|
jToggleListView = new javax.swing.JToggleButton();
|
||||||
|
jToggleCardView = new javax.swing.JToggleButton();
|
||||||
|
jPanel1 = new javax.swing.JPanel();
|
||||||
|
jButtonAddToMain = new javax.swing.JButton();
|
||||||
|
jButtonAddToSideboard = new javax.swing.JButton();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
jTextFieldSearch = new javax.swing.JTextField();
|
||||||
|
jButtonSearch = new javax.swing.JButton();
|
||||||
|
jButtonClean = new javax.swing.JButton();
|
||||||
|
|
||||||
tbColor.setFloatable(false);
|
tbColor.setFloatable(false);
|
||||||
tbColor.setRollover(true);
|
tbColor.setRollover(true);
|
||||||
|
|
@ -428,12 +484,101 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
});
|
});
|
||||||
tbTypes.add(cbSortBy);
|
tbTypes.add(cbSortBy);
|
||||||
|
|
||||||
|
jToggleListView.setSelected(true);
|
||||||
|
jToggleListView.setText("ListView");
|
||||||
|
jToggleListView.setFocusable(false);
|
||||||
|
jToggleListView.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||||
|
jToggleListView.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||||
|
jToggleListView.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jToggleListViewActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tbTypes.add(jToggleListView);
|
||||||
|
|
||||||
|
jToggleCardView.setText("CardView");
|
||||||
|
jToggleCardView.setFocusable(false);
|
||||||
|
jToggleCardView.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||||
|
jToggleCardView.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||||
|
jToggleCardView.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jToggleCardViewActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tbTypes.add(jToggleCardView);
|
||||||
|
|
||||||
|
jPanel1.setOpaque(false);
|
||||||
|
jPanel1.setPreferredSize(new java.awt.Dimension(897, 35));
|
||||||
|
|
||||||
|
jButtonAddToMain.setText("Add to Main");
|
||||||
|
jButtonAddToMain.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jButtonAddToMainActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jButtonAddToSideboard.setText("Add to Sideboard");
|
||||||
|
jButtonAddToSideboard.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jButtonAddToSideboardActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jLabel1.setText("Search (by name,in rules):");
|
||||||
|
|
||||||
|
jButtonSearch.setText("Search");
|
||||||
|
jButtonSearch.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jButtonSearchActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jButtonClean.setText("Clear");
|
||||||
|
jButtonClean.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jButtonCleanActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||||
|
jPanel1.setLayout(jPanel1Layout);
|
||||||
|
jPanel1Layout.setHorizontalGroup(
|
||||||
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addComponent(jButtonAddToMain)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(jButtonAddToSideboard)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(jTextFieldSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(jButtonSearch)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(jButtonClean)
|
||||||
|
.addContainerGap(294, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
jPanel1Layout.setVerticalGroup(
|
||||||
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jButtonAddToMain)
|
||||||
|
.addComponent(jButtonAddToSideboard)
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addComponent(jTextFieldSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jButtonSearch)
|
||||||
|
.addComponent(jButtonClean))
|
||||||
|
);
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
this.setLayout(layout);
|
this.setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(tbColor, javax.swing.GroupLayout.DEFAULT_SIZE, 917, Short.MAX_VALUE)
|
.addComponent(tbColor, javax.swing.GroupLayout.DEFAULT_SIZE, 917, Short.MAX_VALUE)
|
||||||
.addComponent(tbTypes, javax.swing.GroupLayout.DEFAULT_SIZE, 917, Short.MAX_VALUE)
|
.addComponent(tbTypes, javax.swing.GroupLayout.DEFAULT_SIZE, 917, Short.MAX_VALUE)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addContainerGap())
|
||||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 917, Short.MAX_VALUE)
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 917, Short.MAX_VALUE)
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
|
|
@ -442,8 +587,10 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
.addComponent(tbColor, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(tbColor, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addGap(0, 0, 0)
|
.addGap(0, 0, 0)
|
||||||
.addComponent(tbTypes, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(tbTypes, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addGap(0, 0, 0)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE))
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 273, Short.MAX_VALUE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
|
@ -556,16 +703,84 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
|
|
||||||
private void cbSortByActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbSortByActionPerformed
|
private void cbSortByActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbSortByActionPerformed
|
||||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
this.currentView.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||||
}//GEN-LAST:event_cbSortByActionPerformed
|
}//GEN-LAST:event_cbSortByActionPerformed
|
||||||
|
|
||||||
private void chkPilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkPilesActionPerformed
|
private void chkPilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkPilesActionPerformed
|
||||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
this.currentView.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||||
}//GEN-LAST:event_chkPilesActionPerformed
|
}//GEN-LAST:event_chkPilesActionPerformed
|
||||||
|
|
||||||
private JTable mainTable = new JTable();
|
private void jToggleListViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleListViewActionPerformed
|
||||||
|
jToggleCardView.setSelected(false);
|
||||||
|
currentView = mainModel;
|
||||||
|
jScrollPane1.setViewportView(mainTable);
|
||||||
|
cbSortBy.setEnabled(false);
|
||||||
|
chkPiles.setEnabled(false);
|
||||||
|
jButtonAddToMain.setEnabled(true);
|
||||||
|
jButtonAddToSideboard.setEnabled(true);
|
||||||
|
filterCards();
|
||||||
|
}//GEN-LAST:event_jToggleListViewActionPerformed
|
||||||
|
|
||||||
|
private void jToggleCardViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleCardViewActionPerformed
|
||||||
|
jToggleListView.setSelected(false);
|
||||||
|
currentView = cardGrid;
|
||||||
|
jScrollPane1.setViewportView(cardGrid);
|
||||||
|
cbSortBy.setEnabled(true);
|
||||||
|
chkPiles.setEnabled(true);
|
||||||
|
jButtonAddToMain.setEnabled(false);
|
||||||
|
jButtonAddToSideboard.setEnabled(false);
|
||||||
|
filterCards();
|
||||||
|
}//GEN-LAST:event_jToggleCardViewActionPerformed
|
||||||
|
|
||||||
|
private void jButtonAddToMainActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddToMainActionPerformed
|
||||||
|
if (mainTable.getSelectedRowCount() > 0) {
|
||||||
|
int[] n = mainTable.getSelectedRows();
|
||||||
|
List<Integer> indexes = asList(n);
|
||||||
|
Collections.reverse(indexes);
|
||||||
|
for (Integer index : indexes) {
|
||||||
|
mainModel.doubleClick(index);
|
||||||
|
}
|
||||||
|
//if (!mode.equals(Constants.DeckEditorMode.Constructed))
|
||||||
|
//mainModel.fireTableDataChanged();
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_jButtonAddToMainActionPerformed
|
||||||
|
|
||||||
|
private void jButtonAddToSideboardActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddToSideboardActionPerformed
|
||||||
|
if (mainTable.getSelectedRowCount() > 0) {
|
||||||
|
int[] n = mainTable.getSelectedRows();
|
||||||
|
List<Integer> indexes = asList(n);
|
||||||
|
Collections.reverse(indexes);
|
||||||
|
for (Integer index : indexes) {
|
||||||
|
mainModel.shiftDoubleClick(index);
|
||||||
|
}
|
||||||
|
//if (!mode.equals(Constants.DeckEditorMode.Constructed))
|
||||||
|
//mainModel.fireTableDataChanged();
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_jButtonAddToSideboardActionPerformed
|
||||||
|
|
||||||
|
private void jButtonSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSearchActionPerformed
|
||||||
|
String name = jTextFieldSearch.getText().trim();
|
||||||
|
filter.setText(name);
|
||||||
|
filterCards();
|
||||||
|
}//GEN-LAST:event_jButtonSearchActionPerformed
|
||||||
|
|
||||||
|
private void jButtonCleanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCleanActionPerformed
|
||||||
|
jTextFieldSearch.setText("");
|
||||||
|
filter.setText("");
|
||||||
|
filterCards();
|
||||||
|
}//GEN-LAST:event_jButtonCleanActionPerformed
|
||||||
|
|
||||||
|
public List<Integer> asList(final int[] is) {
|
||||||
|
List<Integer> list = new ArrayList<Integer>();
|
||||||
|
for (int i : is) list.add(i);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private TableModel mainModel;
|
||||||
|
private JTable mainTable;
|
||||||
|
private ICardGrid currentView;
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton btnBooster;
|
private javax.swing.JButton btnBooster;
|
||||||
private javax.swing.JButton btnClear;
|
private javax.swing.JButton btnClear;
|
||||||
|
|
@ -573,7 +788,16 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
private javax.swing.JComboBox cbExpansionSet;
|
private javax.swing.JComboBox cbExpansionSet;
|
||||||
private javax.swing.JComboBox cbSortBy;
|
private javax.swing.JComboBox cbSortBy;
|
||||||
private javax.swing.JCheckBox chkPiles;
|
private javax.swing.JCheckBox chkPiles;
|
||||||
|
private javax.swing.JButton jButtonAddToMain;
|
||||||
|
private javax.swing.JButton jButtonAddToSideboard;
|
||||||
|
private javax.swing.JButton jButtonClean;
|
||||||
|
private javax.swing.JButton jButtonSearch;
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JPanel jPanel1;
|
||||||
private javax.swing.JScrollPane jScrollPane1;
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
|
private javax.swing.JTextField jTextFieldSearch;
|
||||||
|
private javax.swing.JToggleButton jToggleCardView;
|
||||||
|
private javax.swing.JToggleButton jToggleListView;
|
||||||
private javax.swing.JRadioButton rdoArtifacts;
|
private javax.swing.JRadioButton rdoArtifacts;
|
||||||
private javax.swing.JRadioButton rdoBlack;
|
private javax.swing.JRadioButton rdoBlack;
|
||||||
private javax.swing.JRadioButton rdoBlue;
|
private javax.swing.JRadioButton rdoBlue;
|
||||||
|
|
@ -594,25 +818,25 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
@Override
|
@Override
|
||||||
public void componentResized(ComponentEvent e) {
|
public void componentResized(ComponentEvent e) {
|
||||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
this.currentView.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentMoved(ComponentEvent e) {
|
public void componentMoved(ComponentEvent e) {
|
||||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
this.currentView.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentShown(ComponentEvent e) {
|
public void componentShown(ComponentEvent e) {
|
||||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
this.currentView.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentHidden(ComponentEvent e) {
|
public void componentHidden(ComponentEvent e) {
|
||||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
this.currentView.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
this.tableId = tableId;
|
this.tableId = tableId;
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.btnAddLand.setVisible(false);
|
this.btnAddLand.setVisible(false);
|
||||||
this.cardTableSelector.setMode(mode);
|
//this.cardTableSelector.setMode(mode);
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case Limited:
|
case Limited:
|
||||||
this.btnAddLand.setVisible(true);
|
this.btnAddLand.setVisible(true);
|
||||||
|
|
@ -120,7 +120,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
case Sideboard:
|
case Sideboard:
|
||||||
this.btnSubmit.setVisible(true);
|
this.btnSubmit.setVisible(true);
|
||||||
this.cardSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), this.bigCard, mode == DeckEditorMode.Limited);
|
this.cardSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), this.bigCard, mode == DeckEditorMode.Limited);
|
||||||
this.cardTableSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), this.bigCard, mode == DeckEditorMode.Limited);
|
//this.cardTableSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), this.bigCard, mode == DeckEditorMode.Limited);
|
||||||
this.btnExit.setVisible(false);
|
this.btnExit.setVisible(false);
|
||||||
this.btnImport.setVisible(false);
|
this.btnImport.setVisible(false);
|
||||||
if (!MageFrame.getSession().isTestMode())
|
if (!MageFrame.getSession().isTestMode())
|
||||||
|
|
@ -136,7 +136,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
case Constructed:
|
case Constructed:
|
||||||
this.btnSubmit.setVisible(false);
|
this.btnSubmit.setVisible(false);
|
||||||
this.cardSelector.loadCards(this.bigCard);
|
this.cardSelector.loadCards(this.bigCard);
|
||||||
this.cardTableSelector.loadCards(this.bigCard);
|
//this.cardTableSelector.loadCards(this.bigCard);
|
||||||
this.btnExit.setVisible(true);
|
this.btnExit.setVisible(true);
|
||||||
this.btnImport.setVisible(true);
|
this.btnImport.setVisible(true);
|
||||||
if (!MageFrame.getSession().isTestMode())
|
if (!MageFrame.getSession().isTestMode())
|
||||||
|
|
@ -150,9 +150,9 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
this.cardSelector.setVisible(true);
|
this.cardSelector.setVisible(true);
|
||||||
this.cardTableSelector.setVisible(false);
|
//this.cardTableSelector.setVisible(false);
|
||||||
this.jRadioButtonFullCards.setSelected(true);
|
//this.jRadioButtonFullCards.setSelected(true);
|
||||||
this.jRadioButtonListTable.setSelected(false);
|
//this.jRadioButtonListTable.setSelected(false);
|
||||||
this.jPanel1.setVisible(true);
|
this.jPanel1.setVisible(true);
|
||||||
this.cardSelector.getCardsList().clearCardEventListeners();
|
this.cardSelector.getCardsList().clearCardEventListeners();
|
||||||
this.cardSelector.getCardsList().addCardEventListener(
|
this.cardSelector.getCardsList().addCardEventListener(
|
||||||
|
|
@ -166,7 +166,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
if (mode == DeckEditorMode.Sideboard || mode == DeckEditorMode.Limited) {
|
if (mode == DeckEditorMode.Sideboard || mode == DeckEditorMode.Limited) {
|
||||||
deck.getSideboard().remove(card);
|
deck.getSideboard().remove(card);
|
||||||
cardSelector.removeCard(card.getId());
|
cardSelector.removeCard(card.getId());
|
||||||
cardTableSelector.removeCard(card.getId());
|
//cardTableSelector.removeCard(card.getId());
|
||||||
}
|
}
|
||||||
if (cardInfoPane instanceof CardInfoPane) {
|
if (cardInfoPane instanceof CardInfoPane) {
|
||||||
((CardInfoPane)cardInfoPane).setCard(new CardView(card));
|
((CardInfoPane)cardInfoPane).setCard(new CardView(card));
|
||||||
|
|
@ -177,7 +177,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.cardTableSelector.getCardsList().clearCardEventListeners();
|
/*this.cardTableSelector.getCardsList().clearCardEventListeners();
|
||||||
this.cardTableSelector.getCardsList().addCardEventListener(
|
this.cardTableSelector.getCardsList().addCardEventListener(
|
||||||
new Listener<Event> () {
|
new Listener<Event> () {
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -205,7 +205,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
refreshDeck();
|
refreshDeck();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);*/
|
||||||
this.deckArea.clearDeckEventListeners();
|
this.deckArea.clearDeckEventListeners();
|
||||||
this.deckArea.addDeckEventListener(
|
this.deckArea.addDeckEventListener(
|
||||||
new Listener<Event> () {
|
new Listener<Event> () {
|
||||||
|
|
@ -218,7 +218,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
if (mode == DeckEditorMode.Limited || mode == DeckEditorMode.Sideboard) {
|
if (mode == DeckEditorMode.Limited || mode == DeckEditorMode.Sideboard) {
|
||||||
deck.getSideboard().add(card);
|
deck.getSideboard().add(card);
|
||||||
cardSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), getBigCard(), mode == DeckEditorMode.Limited);
|
cardSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), getBigCard(), mode == DeckEditorMode.Limited);
|
||||||
cardTableSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), getBigCard(), mode == DeckEditorMode.Limited);
|
//cardTableSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), getBigCard(), mode == DeckEditorMode.Limited);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -292,7 +292,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
jSplitPane1 = new javax.swing.JSplitPane();
|
jSplitPane1 = new javax.swing.JSplitPane();
|
||||||
cardSelector = new mage.client.deckeditor.CardSelector();
|
cardSelector = new mage.client.deckeditor.CardSelector();
|
||||||
cardTableSelector = new mage.client.deckeditor.table.CardTableSelector();
|
//cardTableSelector = new mage.client.deckeditor.table.CardTableSelector();
|
||||||
deckArea = new mage.client.deckeditor.DeckArea();
|
deckArea = new mage.client.deckeditor.DeckArea();
|
||||||
jPanel1 = new javax.swing.JPanel();
|
jPanel1 = new javax.swing.JPanel();
|
||||||
bigCard = new mage.client.cards.BigCard();
|
bigCard = new mage.client.cards.BigCard();
|
||||||
|
|
@ -307,6 +307,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
btnAddLand = new javax.swing.JButton();
|
btnAddLand = new javax.swing.JButton();
|
||||||
txtTimeRemaining = new javax.swing.JTextField();
|
txtTimeRemaining = new javax.swing.JTextField();
|
||||||
|
|
||||||
|
/*
|
||||||
jLayeredPane1 = new javax.swing.JLayeredPane();
|
jLayeredPane1 = new javax.swing.JLayeredPane();
|
||||||
jRadioButtonFullCards = new javax.swing.JRadioButton();
|
jRadioButtonFullCards = new javax.swing.JRadioButton();
|
||||||
jRadioButtonListTable = new javax.swing.JRadioButton();
|
jRadioButtonListTable = new javax.swing.JRadioButton();
|
||||||
|
|
@ -322,7 +323,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (jRadioButtonListTable.isSelected()) {
|
if (jRadioButtonListTable.isSelected()) {
|
||||||
jRadioButtonListTable.setSelected(false);
|
jRadioButtonListTable.setSelected(false);
|
||||||
cardTableSelector.setVisible(false);
|
//cardTableSelector.setVisible(false);
|
||||||
cardSelector.setVisible(true);
|
cardSelector.setVisible(true);
|
||||||
jSplitPane1.setTopComponent(cardSelector);
|
jSplitPane1.setTopComponent(cardSelector);
|
||||||
jSplitPane1.setDividerLocation(0.6);
|
jSplitPane1.setDividerLocation(0.6);
|
||||||
|
|
@ -349,7 +350,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
jSplitPane1.repaint();
|
jSplitPane1.repaint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
|
|
||||||
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
||||||
jSplitPane1.setResizeWeight(0.5);
|
jSplitPane1.setResizeWeight(0.5);
|
||||||
|
|
@ -441,9 +442,9 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
|
/*.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE))
|
.addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE))*/
|
||||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
.addGap(6, 6, 6)
|
.addGap(6, 6, 6)
|
||||||
.addComponent(lblDeckName)
|
.addComponent(lblDeckName)
|
||||||
|
|
@ -494,7 +495,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(txtTimeRemaining))
|
.addComponent(txtTimeRemaining))
|
||||||
.addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
|
//.addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, isShowCardInfo ? 30 : 159, Short.MAX_VALUE)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, isShowCardInfo ? 30 : 159, Short.MAX_VALUE)
|
||||||
.addComponent(cardInfoPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(cardInfoPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 104, Short.MAX_VALUE)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 104, Short.MAX_VALUE)
|
||||||
|
|
@ -576,7 +577,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
deck.getCards().clear();
|
deck.getCards().clear();
|
||||||
cardSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), this.bigCard, mode == DeckEditorMode.Limited);
|
cardSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), this.bigCard, mode == DeckEditorMode.Limited);
|
||||||
cardTableSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), this.bigCard, mode == DeckEditorMode.Limited);
|
//cardTableSelector.loadCards(new ArrayList<Card>(deck.getSideboard()), this.bigCard, mode == DeckEditorMode.Limited);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
deck = new Deck();
|
deck = new Deck();
|
||||||
|
|
@ -648,16 +649,16 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
private javax.swing.JButton btnLoad;
|
private javax.swing.JButton btnLoad;
|
||||||
private javax.swing.JButton btnNew;
|
private javax.swing.JButton btnNew;
|
||||||
private javax.swing.JButton btnSave;
|
private javax.swing.JButton btnSave;
|
||||||
private mage.client.deckeditor.table.CardTableSelector cardTableSelector;
|
//private mage.client.deckeditor.table.CardTableSelector cardTableSelector;
|
||||||
private mage.client.deckeditor.CardSelector cardSelector;
|
private mage.client.deckeditor.CardSelector cardSelector;
|
||||||
private mage.client.deckeditor.DeckArea deckArea;
|
private mage.client.deckeditor.DeckArea deckArea;
|
||||||
private javax.swing.JPanel jPanel1;
|
private javax.swing.JPanel jPanel1;
|
||||||
private javax.swing.JSplitPane jSplitPane1;
|
private javax.swing.JSplitPane jSplitPane1;
|
||||||
private javax.swing.JLabel lblDeckName;
|
private javax.swing.JLabel lblDeckName;
|
||||||
private javax.swing.JTextField txtDeckName;
|
private javax.swing.JTextField txtDeckName;
|
||||||
private javax.swing.JRadioButton jRadioButtonFullCards;
|
//private javax.swing.JRadioButton jRadioButtonFullCards;
|
||||||
private javax.swing.JRadioButton jRadioButtonListTable;
|
//private javax.swing.JRadioButton jRadioButtonListTable;
|
||||||
private javax.swing.JLayeredPane jLayeredPane1;
|
//private javax.swing.JLayeredPane jLayeredPane1;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
private JComponent cardInfoPane;
|
private JComponent cardInfoPane;
|
||||||
|
|
|
||||||
|
|
@ -710,7 +710,7 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi
|
||||||
}//GEN-LAST:event_jButton2ActionPerformed
|
}//GEN-LAST:event_jButton2ActionPerformed
|
||||||
|
|
||||||
private TableModel mainModel;
|
private TableModel mainModel;
|
||||||
|
|
||||||
private javax.swing.JButton btnBooster;
|
private javax.swing.JButton btnBooster;
|
||||||
private javax.swing.JButton btnClear;
|
private javax.swing.JButton btnClear;
|
||||||
private JTable mainTable = new JTable();
|
private JTable mainTable = new JTable();
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
||||||
private int recentSortedColumn;
|
private int recentSortedColumn;
|
||||||
private boolean recentAscending;
|
private boolean recentAscending;
|
||||||
|
|
||||||
public void loadCards(CardsView showCards, SortBy sortBy, boolean piles,
|
public void loadCards(CardsView showCards, SortBy sortBy, boolean piles, BigCard bigCard, UUID gameId) {
|
||||||
BigCard bigCard, UUID gameId) {
|
|
||||||
this.bigCard = bigCard;
|
this.bigCard = bigCard;
|
||||||
this.gameId = gameId;
|
this.gameId = gameId;
|
||||||
for (CardView card : showCards.values()) {
|
for (CardView card : showCards.values()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue