mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* UI: fixed graveyard and other cards window size (removed unnecessary scrolls, #5659);
This commit is contained in:
parent
893e9384b1
commit
16efc350b4
4 changed files with 323 additions and 358 deletions
|
@ -7,32 +7,22 @@
|
||||||
*/
|
*/
|
||||||
package mage.client.cards;
|
package mage.client.cards;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Component;
|
|
||||||
import java.awt.Dimension;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.UUID;
|
|
||||||
import javax.swing.border.Border;
|
|
||||||
import javax.swing.border.EmptyBorder;
|
|
||||||
import mage.cards.MageCard;
|
import mage.cards.MageCard;
|
||||||
import mage.client.plugins.impl.Plugins;
|
import mage.client.plugins.impl.Plugins;
|
||||||
import mage.client.util.CardsViewUtil;
|
import mage.client.util.CardsViewUtil;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.Config;
|
||||||
import mage.client.util.GUISizeHelper;
|
import mage.client.util.GUISizeHelper;
|
||||||
import mage.view.CardView;
|
import mage.view.*;
|
||||||
import mage.view.CardsView;
|
|
||||||
import mage.view.PermanentView;
|
|
||||||
import mage.view.SimpleCardsView;
|
|
||||||
import mage.view.StackAbilityView;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.mage.card.arcane.CardPanel;
|
import org.mage.card.arcane.CardPanel;
|
||||||
|
|
||||||
|
import javax.swing.border.Border;
|
||||||
|
import javax.swing.border.EmptyBorder;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public class Cards extends javax.swing.JPanel {
|
public class Cards extends javax.swing.JPanel {
|
||||||
|
@ -90,7 +80,7 @@ public class Cards extends javax.swing.JPanel {
|
||||||
mageCard.doLayout();
|
mageCard.doLayout();
|
||||||
}
|
}
|
||||||
layoutCards();
|
layoutCards();
|
||||||
sizeCards(cardDimension);
|
sizeCards(getCardDimension());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setGUISize() {
|
private void setGUISize() {
|
||||||
|
@ -294,8 +284,8 @@ public class Cards extends javax.swing.JPanel {
|
||||||
add(cardArea, java.awt.BorderLayout.CENTER);
|
add(cardArea, java.awt.BorderLayout.CENTER);
|
||||||
} else {
|
} else {
|
||||||
jScrollPane1 = new javax.swing.JScrollPane();
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
jScrollPane1.setViewportView(cardArea);
|
|
||||||
jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
jScrollPane1.setViewportView(cardArea);
|
||||||
add(jScrollPane1, java.awt.BorderLayout.CENTER);
|
add(jScrollPane1, java.awt.BorderLayout.CENTER);
|
||||||
}
|
}
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<Property name="iconifiable" type="boolean" value="true"/>
|
<Property name="iconifiable" type="boolean" value="true"/>
|
||||||
<Property name="resizable" type="boolean" value="true"/>
|
<Property name="resizable" type="boolean" value="true"/>
|
||||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||||
<Connection code="new Dimension((int) Math.round(GUISizeHelper.otherZonesCardDimension.width * 1.3),
 (int) Math.round(GUISizeHelper.otherZonesCardDimension.height * 1.2))" type="code"/>
|
<Connection code="new Dimension((int) Math.round(GUISizeHelper.otherZonesCardDimension.width * 1.4),
 (int) Math.round(GUISizeHelper.otherZonesCardDimension.height * 1.4))" type="code"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<SyntheticProperties>
|
<SyntheticProperties>
|
||||||
|
@ -21,31 +21,20 @@
|
||||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,0,0,0,1,112"/>
|
||||||
</AuxValues>
|
</AuxValues>
|
||||||
|
|
||||||
<Layout>
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Component id="cards" max="32767" attributes="0"/>
|
|
||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Component id="cards" max="32767" attributes="0"/>
|
|
||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="mage.client.cards.Cards" name="cards">
|
<Component class="mage.client.cards.Cards" name="cards">
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="CardInfoWindowDialog_cards"/>
|
<AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="CardInfoWindowDialog_cards"/>
|
||||||
</AuxValues>
|
</AuxValues>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||||
|
<BorderConstraints direction="Center"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
@ -1,23 +1,5 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* CardInfoWindowDialog.java
|
|
||||||
*
|
|
||||||
* Created on Feb 1, 2010, 3:00:35 PM
|
|
||||||
*/
|
|
||||||
package mage.client.dialog;
|
package mage.client.dialog;
|
||||||
|
|
||||||
import java.awt.Dimension;
|
|
||||||
import java.awt.Point;
|
|
||||||
import java.beans.PropertyVetoException;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import javax.swing.ImageIcon;
|
|
||||||
import javax.swing.SwingUtilities;
|
|
||||||
import javax.swing.event.InternalFrameAdapter;
|
|
||||||
import javax.swing.event.InternalFrameEvent;
|
|
||||||
|
|
||||||
import mage.client.cards.BigCard;
|
import mage.client.cards.BigCard;
|
||||||
import mage.client.util.GUISizeHelper;
|
import mage.client.util.GUISizeHelper;
|
||||||
import mage.client.util.ImageHelper;
|
import mage.client.util.ImageHelper;
|
||||||
|
@ -31,8 +13,17 @@ import mage.view.SimpleCardsView;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
|
import org.mage.plugins.card.utils.impl.ImageManagerImpl;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import javax.swing.event.InternalFrameAdapter;
|
||||||
|
import javax.swing.event.InternalFrameEvent;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.beans.PropertyVetoException;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com, JayDi85
|
||||||
*/
|
*/
|
||||||
public class CardInfoWindowDialog extends MageDialog {
|
public class CardInfoWindowDialog extends MageDialog {
|
||||||
|
|
||||||
|
@ -151,6 +142,7 @@ public class CardInfoWindowDialog extends MageDialog {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.show();
|
super.show();
|
||||||
if (positioned) { // check if in frame rectangle
|
if (positioned) { // check if in frame rectangle
|
||||||
showAndPositionWindow();
|
showAndPositionWindow();
|
||||||
|
@ -201,23 +193,10 @@ public class CardInfoWindowDialog extends MageDialog {
|
||||||
|
|
||||||
setIconifiable(true);
|
setIconifiable(true);
|
||||||
setResizable(true);
|
setResizable(true);
|
||||||
setPreferredSize(new Dimension((int) Math.round(GUISizeHelper.otherZonesCardDimension.width * 1.3),
|
setPreferredSize(new Dimension((int) Math.round(GUISizeHelper.otherZonesCardDimension.width * 1.4),
|
||||||
(int) Math.round(GUISizeHelper.otherZonesCardDimension.height * 1.2)));
|
(int) Math.round(GUISizeHelper.otherZonesCardDimension.height * 1.4)));
|
||||||
|
getContentPane().setLayout(new java.awt.BorderLayout());
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
getContentPane().add(cards, java.awt.BorderLayout.CENTER);
|
||||||
getContentPane().setLayout(layout);
|
|
||||||
layout.setHorizontalGroup(
|
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addComponent(cards, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
||||||
.addGap(0, 0, 0))
|
|
||||||
);
|
|
||||||
layout.setVerticalGroup(
|
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addComponent(cards, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
||||||
.addGap(0, 0, 0))
|
|
||||||
);
|
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
|
@ -133,6 +133,7 @@ class UrzaAcademyHeadmasterRandomEffect extends OneShotEffect {
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
switch (selection) {
|
switch (selection) {
|
||||||
|
|
||||||
// ABILITY +1
|
// ABILITY +1
|
||||||
case 1:
|
case 1:
|
||||||
switch (result) {
|
switch (result) {
|
||||||
|
@ -228,8 +229,10 @@ class UrzaAcademyHeadmasterRandomEffect extends OneShotEffect {
|
||||||
case 20: // (altered) XENAGOS 1
|
case 20: // (altered) XENAGOS 1
|
||||||
sb.append("Add X mana in any combination of colors to your mana pool, where X is the number of creatures you control.");
|
sb.append("Add X mana in any combination of colors to your mana pool, where X is the number of creatures you control.");
|
||||||
effects.add(new UrzaAcademyHeadmasterManaEffect());
|
effects.add(new UrzaAcademyHeadmasterManaEffect());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// ABILITY -1
|
// ABILITY -1
|
||||||
case 2:
|
case 2:
|
||||||
switch (result) {
|
switch (result) {
|
||||||
|
@ -325,8 +328,10 @@ class UrzaAcademyHeadmasterRandomEffect extends OneShotEffect {
|
||||||
sb.append("Draw four cards and discard two cards.");
|
sb.append("Draw four cards and discard two cards.");
|
||||||
effects.add(new DrawCardSourceControllerEffect(4));
|
effects.add(new DrawCardSourceControllerEffect(4));
|
||||||
effects.add(new DiscardControllerEffect(2));
|
effects.add(new DiscardControllerEffect(2));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// ABILITY -6
|
// ABILITY -6
|
||||||
case 3:
|
case 3:
|
||||||
switch (result) {
|
switch (result) {
|
||||||
|
@ -421,7 +426,9 @@ class UrzaAcademyHeadmasterRandomEffect extends OneShotEffect {
|
||||||
case 20: // UGIN 3
|
case 20: // UGIN 3
|
||||||
sb.append("You gain 7 life, draw seven cards, then put up to seven permanent cards from your hand onto the battlefield.");
|
sb.append("You gain 7 life, draw seven cards, then put up to seven permanent cards from your hand onto the battlefield.");
|
||||||
effects.add(new mage.cards.u.UginTheSpiritDragonEffect3());
|
effects.add(new mage.cards.u.UginTheSpiritDragonEffect3());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
game.informPlayers(sb.toString());
|
game.informPlayers(sb.toString());
|
||||||
|
|
Loading…
Reference in a new issue