forked from External/mage
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:
parent
a9f2c8c407
commit
076840df53
247 changed files with 1919 additions and 3682 deletions
|
|
@ -65,13 +65,13 @@ public class CardInfoWindowDialog extends MageDialog {
|
|||
|
||||
private static final Logger LOGGER = Logger.getLogger(CardInfoWindowDialog.class);
|
||||
|
||||
public static enum ShowType {
|
||||
public enum ShowType {
|
||||
REVEAL, REVEAL_TOP_LIBRARY, LOOKED_AT, EXILE, GRAVEYARD, OTHER
|
||||
};
|
||||
}
|
||||
|
||||
private ShowType showType;
|
||||
private final ShowType showType;
|
||||
private boolean positioned;
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
public CardInfoWindowDialog(ShowType showType, String name) {
|
||||
this.name = name;
|
||||
|
|
@ -185,22 +185,19 @@ public class CardInfoWindowDialog extends MageDialog {
|
|||
}
|
||||
|
||||
private void showAndPositionWindow() {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
int width = CardInfoWindowDialog.this.getWidth();
|
||||
int height = CardInfoWindowDialog.this.getHeight();
|
||||
if (width > 0 && height > 0) {
|
||||
Point centered = SettingsManager.getInstance().getComponentPosition(width, height);
|
||||
if (!positioned) {
|
||||
int xPos = centered.x / 2;
|
||||
int yPos = centered.y / 2;
|
||||
CardInfoWindowDialog.this.setLocation(xPos, yPos);
|
||||
show();
|
||||
positioned = true;
|
||||
}
|
||||
GuiDisplayUtil.keepComponentInsideFrame(centered.x, centered.y, CardInfoWindowDialog.this);
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
int width = CardInfoWindowDialog.this.getWidth();
|
||||
int height = CardInfoWindowDialog.this.getHeight();
|
||||
if (width > 0 && height > 0) {
|
||||
Point centered = SettingsManager.getInstance().getComponentPosition(width, height);
|
||||
if (!positioned) {
|
||||
int xPos = centered.x / 2;
|
||||
int yPos = centered.y / 2;
|
||||
CardInfoWindowDialog.this.setLocation(xPos, yPos);
|
||||
show();
|
||||
positioned = true;
|
||||
}
|
||||
GuiDisplayUtil.keepComponentInsideFrame(centered.x, centered.y, CardInfoWindowDialog.this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue