mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Some minor formatting.
This commit is contained in:
parent
9c5d5208b9
commit
bf4ccf185c
10 changed files with 79 additions and 61 deletions
|
|
@ -14,21 +14,21 @@ import java.awt.image.BufferedImage;
|
|||
*/
|
||||
public class DialogContainer extends JPanel {
|
||||
|
||||
private static int X_OFFSET = 30;
|
||||
private static int Y_OFFSET = 30;
|
||||
private BufferedImage shadow = null;
|
||||
private static final int X_OFFSET = 30;
|
||||
private static final int Y_OFFSET = 30;
|
||||
private final BufferedImage shadow = null;
|
||||
//private DialogManager.MTGDialogs dialogType;
|
||||
//private DlgParams params;
|
||||
private Color backgroundColor = new Color(0, 255, 255, 60);
|
||||
private int alpha = 50;
|
||||
|
||||
private boolean isGradient = false;
|
||||
private TexturePaint tp = null;
|
||||
private Image gradient = null;
|
||||
private final boolean isGradient = false;
|
||||
private final TexturePaint tp = null;
|
||||
private final Image gradient = null;
|
||||
private BufferedImage b;
|
||||
|
||||
private boolean drawContainer = true;
|
||||
private DialogManager.MTGDialogs dialogType;
|
||||
private final DialogManager.MTGDialogs dialogType;
|
||||
|
||||
public DialogContainer(DialogManager.MTGDialogs dialogType, DlgParams params) {
|
||||
setOpaque(false);
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ public class ChoiceDialog extends IDialogPanel {
|
|||
|
||||
private JButton jButtonSort = null;
|
||||
|
||||
private CardsView cards;
|
||||
private UUID gameId;
|
||||
private final CardsView cards;
|
||||
private final UUID gameId;
|
||||
|
||||
private int page = 1;
|
||||
private int maxPages;
|
||||
|
|
@ -48,12 +48,14 @@ public class ChoiceDialog extends IDialogPanel {
|
|||
private boolean isChooseAbility = false;
|
||||
private boolean isCancelStopsPlaying = true;
|
||||
|
||||
private DlgParams params;
|
||||
private final DlgParams params;
|
||||
|
||||
private String title;
|
||||
private final String title;
|
||||
|
||||
/**
|
||||
* This is the default constructor
|
||||
* @param params
|
||||
* @param title
|
||||
*/
|
||||
public ChoiceDialog(DlgParams params, String title) {
|
||||
super(params);
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
/**
|
||||
* Free resources so GC can work
|
||||
*/
|
||||
public void clear() {
|
||||
public void cleanUp() {
|
||||
if (updateDeckTask != null) {
|
||||
updateDeckTask.cancel(true);
|
||||
}
|
||||
|
|
@ -319,7 +319,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
|
||||
public void removeDeckEditor() {
|
||||
hidePopup();
|
||||
this.clear();
|
||||
this.cleanUp();
|
||||
|
||||
Component c = this.getParent();
|
||||
while (c != null && !(c instanceof DeckEditorPane)) {
|
||||
|
|
|
|||
|
|
@ -59,10 +59,10 @@ import java.util.Map.Entry;
|
|||
*/
|
||||
public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
||||
|
||||
private Map<UUID, MagePermanent> permanents = new LinkedHashMap<UUID, MagePermanent>();
|
||||
private final Map<UUID, MagePermanent> permanents = new LinkedHashMap<UUID, MagePermanent>();
|
||||
private UUID gameId;
|
||||
private BigCard bigCard;
|
||||
private Map<String, JComponent> ui = new HashMap<String, JComponent>();
|
||||
private final Map<String, JComponent> uiComponentsList = new HashMap<String, JComponent>();
|
||||
|
||||
protected Map<UUID, PermanentView> battlefield;
|
||||
private Dimension cardDimension;
|
||||
|
|
@ -71,7 +71,7 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
private JScrollPane jScrollPane;
|
||||
private int width;
|
||||
|
||||
private static int i = 0;
|
||||
//private static int iCounter = 0;
|
||||
|
||||
private boolean addedPermanent;
|
||||
private boolean addedArtifact;
|
||||
|
|
@ -81,9 +81,9 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
|
||||
/** Creates new form BattlefieldPanel */
|
||||
public BattlefieldPanel() {
|
||||
ui.put("battlefieldPanel", this);
|
||||
uiComponentsList.put("battlefieldPanel", this);
|
||||
initComponents();
|
||||
ui.put("jPanel", jPanel);
|
||||
uiComponentsList.put("jPanel", jPanel);
|
||||
|
||||
addComponentListener(new ComponentAdapter() {
|
||||
@Override
|
||||
|
|
@ -104,7 +104,7 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
|
||||
public void cleanUp() {
|
||||
permanents.clear();
|
||||
Plugins.getInstance().sortPermanents(ui, permanents.values());
|
||||
Plugins.getInstance().sortPermanents(uiComponentsList, permanents.values());
|
||||
}
|
||||
|
||||
public void update(Map<UUID, PermanentView> battlefield) {
|
||||
|
|
@ -145,11 +145,11 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
|
||||
removedCreature = false;
|
||||
|
||||
for (Iterator<Entry<UUID, MagePermanent>> i = permanents.entrySet().iterator(); i.hasNext();) {
|
||||
Entry<UUID, MagePermanent> entry = i.next();
|
||||
for (Iterator<Entry<UUID, MagePermanent>> iterator = permanents.entrySet().iterator(); iterator.hasNext();) {
|
||||
Entry<UUID, MagePermanent> entry = iterator.next();
|
||||
if (!battlefield.containsKey(entry.getKey())) {
|
||||
removePermanent(entry.getKey(), 1);
|
||||
i.remove();
|
||||
iterator.remove();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -166,7 +166,7 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
|
||||
//TODO: review sorting stuff
|
||||
public void sortLayout() {
|
||||
int height = Plugins.getInstance().sortPermanents(ui, permanents.values());
|
||||
int height = Plugins.getInstance().sortPermanents(uiComponentsList, permanents.values());
|
||||
BattlefieldPanel.this.jPanel.setPreferredSize(new Dimension(width - 30, height));
|
||||
this.jScrollPane.repaint();
|
||||
this.jScrollPane.revalidate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue