Big refactoring

I used Intellij IDEA to automatically refactor code to achive 3 goals.
1) get rid of anonymouse classes, and replace the with lamba to get more readeable and clean code (like in TableWaitingDialog).
2) make effectively final  variables actually final to avoid inadvertent changes on it in further releases and keep objects as immutable, as possible.
3)  Get rid of unused imports (most of the changes) in whole project classes.
This commit is contained in:
vraskulin 2017-01-09 19:16:47 +03:00
parent a9f2c8c407
commit 076840df53
247 changed files with 1919 additions and 3682 deletions

View file

@ -40,7 +40,6 @@ import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import mage.cards.CardDimensions;
import mage.cards.MageCard;
@ -62,7 +61,7 @@ public class DraftGrid extends javax.swing.JPanel implements MouseListener {
private static final Logger logger = Logger.getLogger(DraftGrid.class);
protected CardEventSource cardEventSource = new CardEventSource();
protected final CardEventSource cardEventSource = new CardEventSource();
protected BigCard bigCard;
protected MageCard markedCard;
protected boolean emptyGrid;
@ -126,7 +125,7 @@ public class DraftGrid extends javax.swing.JPanel implements MouseListener {
Dimension dimension = new Dimension(cardDimension.frameWidth, cardDimension.frameHeight);
List<CardView> sortedCards = new ArrayList<>(booster.values());
Collections.sort(sortedCards, new CardViewRarityComparator());
sortedCards.sort(new CardViewRarityComparator());
for (CardView card: sortedCards) {
MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, dimension, null, true, true);
cardImg.addMouseListener(this);