mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
* Deck editor - some minor changes.
This commit is contained in:
parent
4eff5355d5
commit
7d714947aa
2 changed files with 47 additions and 29 deletions
|
@ -32,8 +32,8 @@
|
|||
<Component id="tbColor" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="tbTypes" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="cardSelectorScrollPane" pref="230" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="cardSelectorScrollPane" pref="237" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="cardSelectorBottomPanel" min="-2" pref="31" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
@ -123,7 +123,7 @@
|
|||
</Property>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code=""<html>Black<br/>" + tbColor.getToolTipText()" type="code"/>
|
||||
<Connection code=""<html><font color='black'><strong>Black</strong></font><br/>" + tbColor.getToolTipText()" type="code"/>
|
||||
</Property>
|
||||
<Property name="actionCommand" type="java.lang.String" value="Black"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
|
@ -144,7 +144,7 @@
|
|||
</Property>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code=""<html>White<br/>" + tbColor.getToolTipText()" type="code"/>
|
||||
<Connection code=""<html<font color='white'><strong>White</strong></font><br/>" + tbColor.getToolTipText()" type="code"/>
|
||||
</Property>
|
||||
<Property name="actionCommand" type="java.lang.String" value="White"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
|
@ -183,13 +183,8 @@
|
|||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbExpansionSet">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new DefaultComboBoxModel<>(ConstructedFormats.getTypes())" type="code"/>
|
||||
</Property>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[250, 25]"/>
|
||||
|
@ -197,6 +192,7 @@
|
|||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[250, 25]"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="cbExpansionSet" noResource="true"/>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[250, 25]"/>
|
||||
</Property>
|
||||
|
@ -239,7 +235,7 @@
|
|||
<Properties>
|
||||
<Property name="floatable" type="boolean" value="false"/>
|
||||
<Property name="rollover" type="boolean" value="true"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Click card type with ALT-KEY to only get the clicked card type."/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Click with ALT to deselect all other card types or with CTRL to deselect only clicked type." noResource="true"/>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[732, 27]"/>
|
||||
</Property>
|
||||
|
@ -250,6 +246,9 @@
|
|||
<Component class="javax.swing.JRadioButton" name="rdoLand">
|
||||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code=""<html><strong>Land</strong><br/>" 
+ tbTypes.getToolTipText()" type="code"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||
<Property name="label" type="java.lang.String" value="Land "/>
|
||||
|
@ -262,6 +261,9 @@
|
|||
<Component class="javax.swing.JRadioButton" name="rdoCreatures">
|
||||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code=""<html><strong>Creatures</strong><br/>" 
+ tbTypes.getToolTipText()" type="code"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||
<Property name="label" type="java.lang.String" value="Creatures "/>
|
||||
|
@ -275,6 +277,9 @@
|
|||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="text" type="java.lang.String" value="Artifacts "/>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code=""<html><strong>Artifacts</strong><br/>" 
+ tbTypes.getToolTipText()" type="code"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||
|
@ -287,6 +292,9 @@
|
|||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="text" type="java.lang.String" value="Enchantments "/>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code=""<html><strong>Enchantments</strong><br/>" 
+ tbTypes.getToolTipText()" type="code"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||
|
|
|
@ -207,7 +207,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
this.btnBooster.setVisible(true);
|
||||
this.btnClear.setVisible(true);
|
||||
this.cbExpansionSet.setVisible(true);
|
||||
cbExpansionSet.setModel(new DefaultComboBoxModel<>(ConstructedFormats.getTypes()));
|
||||
// cbExpansionSet.setModel(new DefaultComboBoxModel<>(ConstructedFormats.getTypes()));
|
||||
// Action event on Expansion set triggers loadCards method
|
||||
cbExpansionSet.setSelectedIndex(0);
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
}
|
||||
|
||||
private void filterCardsColor(int modifiers, String actionCommand) {
|
||||
// ALT Button was pushed
|
||||
// ALT or CTRL button was pushed
|
||||
if ((modifiers & ActionEvent.ALT_MASK) == ActionEvent.ALT_MASK || (modifiers & ActionEvent.CTRL_MASK) == ActionEvent.CTRL_MASK) {
|
||||
boolean invert = (modifiers & ActionEvent.ALT_MASK) == ActionEvent.ALT_MASK;
|
||||
tbBlack.setSelected(inverter(invert, tbBlack.getActionCommand(), actionCommand));
|
||||
|
@ -346,15 +346,16 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
}
|
||||
|
||||
private void filterCardsType(int modifiers, String actionCommand) {
|
||||
// ALT Button was pushed
|
||||
if ((modifiers & ActionEvent.ALT_MASK) == ActionEvent.ALT_MASK) {
|
||||
rdoArtifacts.setSelected(rdoArtifacts.getActionCommand().equals(actionCommand));
|
||||
rdoCreatures.setSelected(rdoCreatures.getActionCommand().equals(actionCommand));
|
||||
rdoEnchantments.setSelected(rdoEnchantments.getActionCommand().equals(actionCommand));
|
||||
rdoInstants.setSelected(rdoInstants.getActionCommand().equals(actionCommand));
|
||||
rdoLand.setSelected(rdoLand.getActionCommand().equals(actionCommand));
|
||||
rdoPlaneswalkers.setSelected(rdoPlaneswalkers.getActionCommand().equals(actionCommand));
|
||||
rdoSorceries.setSelected(rdoSorceries.getActionCommand().equals(actionCommand));
|
||||
// ALT or CTRL button was pushed
|
||||
if ((modifiers & ActionEvent.ALT_MASK) == ActionEvent.ALT_MASK || (modifiers & ActionEvent.CTRL_MASK) == ActionEvent.CTRL_MASK) {
|
||||
boolean invert = (modifiers & ActionEvent.ALT_MASK) == ActionEvent.ALT_MASK;
|
||||
rdoArtifacts.setSelected(inverter(invert, rdoArtifacts.getActionCommand(), actionCommand));
|
||||
rdoCreatures.setSelected(inverter(invert, rdoCreatures.getActionCommand(), actionCommand));
|
||||
rdoEnchantments.setSelected(inverter(invert, rdoEnchantments.getActionCommand(), actionCommand));
|
||||
rdoInstants.setSelected(inverter(invert, rdoInstants.getActionCommand(), actionCommand));
|
||||
rdoLand.setSelected(inverter(invert, rdoLand.getActionCommand(), actionCommand));
|
||||
rdoPlaneswalkers.setSelected(inverter(invert, rdoPlaneswalkers.getActionCommand(), actionCommand));
|
||||
rdoSorceries.setSelected(inverter(invert, rdoSorceries.getActionCommand(), actionCommand));
|
||||
}
|
||||
filterCards();
|
||||
}
|
||||
|
@ -518,7 +519,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
|
||||
tbBlack.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_black_off.png"))); // NOI18N
|
||||
tbBlack.setSelected(true);
|
||||
tbBlack.setToolTipText("<html>Black<br/>" + tbColor.getToolTipText());
|
||||
tbBlack.setToolTipText("<html><font color='black'><strong>Black</strong></font><br/>" + tbColor.getToolTipText());
|
||||
tbBlack.setActionCommand("Black");
|
||||
tbBlack.setFocusable(false);
|
||||
tbBlack.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
|
@ -533,7 +534,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
|
||||
tbWhite.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_white_off.png"))); // NOI18N
|
||||
tbWhite.setSelected(true);
|
||||
tbWhite.setToolTipText("<html>White<br/>" + tbColor.getToolTipText());
|
||||
tbWhite.setToolTipText("<html<font color='white'><strong>White</strong></font><br/>" + tbColor.getToolTipText());
|
||||
tbWhite.setActionCommand("White");
|
||||
tbWhite.setFocusable(false);
|
||||
tbWhite.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
|
@ -562,9 +563,10 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
tbColor.add(tbColorless);
|
||||
tbColor.add(jSeparator1);
|
||||
|
||||
cbExpansionSet.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
cbExpansionSet.setModel(new DefaultComboBoxModel<>(ConstructedFormats.getTypes()));
|
||||
cbExpansionSet.setMaximumSize(new java.awt.Dimension(250, 25));
|
||||
cbExpansionSet.setMinimumSize(new java.awt.Dimension(250, 25));
|
||||
cbExpansionSet.setName("cbExpansionSet"); // NOI18N
|
||||
cbExpansionSet.setPreferredSize(new java.awt.Dimension(250, 25));
|
||||
cbExpansionSet.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
|
@ -599,10 +601,12 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
|
||||
tbTypes.setFloatable(false);
|
||||
tbTypes.setRollover(true);
|
||||
tbTypes.setToolTipText("Click card type with ALT-KEY to only get the clicked card type.");
|
||||
tbTypes.setToolTipText("Click with ALT to deselect all other card types or with CTRL to deselect only clicked type."); // NOI18N
|
||||
tbTypes.setPreferredSize(new java.awt.Dimension(732, 27));
|
||||
|
||||
rdoLand.setSelected(true);
|
||||
rdoLand.setToolTipText("<html><strong>Land</strong><br/>"
|
||||
+ tbTypes.getToolTipText());
|
||||
rdoLand.setFocusable(false);
|
||||
rdoLand.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||
rdoLand.setLabel("Land ");
|
||||
|
@ -615,6 +619,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
tbTypes.add(rdoLand);
|
||||
|
||||
rdoCreatures.setSelected(true);
|
||||
rdoCreatures.setToolTipText("<html><strong>Creatures</strong><br/>"
|
||||
+ tbTypes.getToolTipText());
|
||||
rdoCreatures.setFocusable(false);
|
||||
rdoCreatures.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||
rdoCreatures.setLabel("Creatures ");
|
||||
|
@ -628,6 +634,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
|
||||
rdoArtifacts.setSelected(true);
|
||||
rdoArtifacts.setText("Artifacts ");
|
||||
rdoArtifacts.setToolTipText("<html><strong>Artifacts</strong><br/>"
|
||||
+ tbTypes.getToolTipText());
|
||||
rdoArtifacts.setFocusable(false);
|
||||
rdoArtifacts.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||
rdoArtifacts.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
|
@ -640,6 +648,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
|
||||
rdoEnchantments.setSelected(true);
|
||||
rdoEnchantments.setText("Enchantments ");
|
||||
rdoEnchantments.setToolTipText("<html><strong>Enchantments</strong><br/>"
|
||||
+ tbTypes.getToolTipText());
|
||||
rdoEnchantments.setFocusable(false);
|
||||
rdoEnchantments.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||
rdoEnchantments.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
|
@ -889,8 +899,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
.addComponent(tbColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(tbTypes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(cardSelectorScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(cardSelectorScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(cardSelectorBottomPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue