mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
[minor] access modifer order
This commit is contained in:
parent
ec546a5ae6
commit
a7a565bb8f
549 changed files with 1032 additions and 1040 deletions
|
|
@ -7,7 +7,7 @@ import java.awt.*;
|
|||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
abstract public class Animation {
|
||||
public abstract class Animation {
|
||||
private static final long TARGET_MILLIS_PER_FRAME = 30;
|
||||
|
||||
private static Timer timer = new Timer("Animation", true);
|
||||
|
|
@ -46,7 +46,7 @@ abstract public class Animation {
|
|||
timer.scheduleAtFixedRate(timerTask, delay, TARGET_MILLIS_PER_FRAME);
|
||||
}
|
||||
|
||||
abstract protected void update (float percentage);
|
||||
protected abstract void update (float percentage);
|
||||
|
||||
protected void cancel () {
|
||||
timerTask.cancel();
|
||||
|
|
@ -102,7 +102,7 @@ abstract public class Animation {
|
|||
}
|
||||
}
|
||||
|
||||
static public void tapCardToggle (final CardPanel panel, final MagePermanent parent, final boolean tapped, final boolean flipped) {
|
||||
public static void tapCardToggle (final CardPanel panel, final MagePermanent parent, final boolean tapped, final boolean flipped) {
|
||||
new Animation(300) {
|
||||
@Override
|
||||
protected void start () {
|
||||
|
|
@ -177,7 +177,7 @@ abstract public class Animation {
|
|||
};
|
||||
}
|
||||
|
||||
static public void moveCardToPlay (final int startX, final int startY, final int startWidth, final int endX, final int endY,
|
||||
public static void moveCardToPlay (final int startX, final int startY, final int startWidth, final int endX, final int endY,
|
||||
final int endWidth, final CardPanel animationPanel, final CardPanel placeholder, final JLayeredPane layeredPane,
|
||||
final int speed) {
|
||||
UI.invokeLater(new Runnable() {
|
||||
|
|
@ -247,7 +247,7 @@ abstract public class Animation {
|
|||
});
|
||||
}
|
||||
|
||||
static public void moveCard (final int startX, final int startY, final int startWidth, final int endX, final int endY,
|
||||
public static void moveCard (final int startX, final int startY, final int startWidth, final int endX, final int endY,
|
||||
final int endWidth, final CardPanel animationPanel, final CardPanel placeholder, final JLayeredPane layeredPane,
|
||||
final int speed) {
|
||||
UI.invokeLater(new Runnable() {
|
||||
|
|
@ -294,11 +294,9 @@ abstract public class Animation {
|
|||
});
|
||||
}
|
||||
|
||||
static public void shrinkCard () {
|
||||
public static void shrinkCard () {
|
||||
final CardPanel overPanel, animationPanel;
|
||||
synchronized (enlargeLock) {
|
||||
//delayedCardPanel = null;
|
||||
//delayedTime = 0;
|
||||
overPanel = Animation.enlargedCardPanel;
|
||||
animationPanel = Animation.enlargedAnimationPanel;
|
||||
if (animationPanel == null) {
|
||||
|
|
@ -348,15 +346,15 @@ abstract public class Animation {
|
|||
};
|
||||
}
|
||||
|
||||
static public boolean isShowingEnlargedCard () {
|
||||
public static boolean isShowingEnlargedCard () {
|
||||
synchronized (enlargeLock) {
|
||||
return enlargedAnimationPanel != null;
|
||||
}
|
||||
}
|
||||
|
||||
static public void showCard(final MagePermanent card, int count) {
|
||||
public static void showCard(final MagePermanent card, int count) {
|
||||
if (count == 0) {
|
||||
count = 1;
|
||||
return;
|
||||
}
|
||||
new Animation(600 / count) {
|
||||
@Override
|
||||
|
|
@ -377,9 +375,9 @@ abstract public class Animation {
|
|||
};
|
||||
}
|
||||
|
||||
static public void hideCard(final MagePermanent card, int count) {
|
||||
public static void hideCard(final MagePermanent card, int count) {
|
||||
if (count == 0) {
|
||||
count = 1;
|
||||
return;
|
||||
}
|
||||
new Animation(600 / count) {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -46,12 +46,12 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
|
||||
public static final Rectangle CARD_SIZE_FULL = new Rectangle(101, 149);
|
||||
|
||||
static private final float ROUNDED_CORNER_SIZE = 0.1f;
|
||||
static private final float BLACK_BORDER_SIZE = 0.03f;
|
||||
static private final int TEXT_GLOW_SIZE = 6;
|
||||
static private final float TEXT_GLOW_INTENSITY = 3f;
|
||||
static private final float ROT_CENTER_TO_TOP_CORNER = 1.0295630140987000315797369464196f;
|
||||
static private final float ROT_CENTER_TO_BOTTOM_CORNER = 0.7071067811865475244008443621048f;
|
||||
private static final float ROUNDED_CORNER_SIZE = 0.1f;
|
||||
private static final float BLACK_BORDER_SIZE = 0.03f;
|
||||
private static final int TEXT_GLOW_SIZE = 6;
|
||||
private static final float TEXT_GLOW_INTENSITY = 3f;
|
||||
private static final float ROT_CENTER_TO_TOP_CORNER = 1.0295630140987000315797369464196f;
|
||||
private static final float ROT_CENTER_TO_BOTTOM_CORNER = 0.7071067811865475244008443621048f;
|
||||
|
||||
public CardView gameCard;
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
public void setImage(final CardPanel panel) {
|
||||
synchronized (panel.imagePanel) {
|
||||
if (panel.imagePanel.hasImage()) {
|
||||
setImage(panel.imagePanel.srcImage);
|
||||
setImage(panel.imagePanel.getSrcImage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -747,7 +747,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
return data;
|
||||
}
|
||||
|
||||
final protected String getType(CardView card) {
|
||||
protected final String getType(CardView card) {
|
||||
StringBuilder sbType = new StringBuilder();
|
||||
|
||||
for (String superType : card.getSuperTypes()) {
|
||||
|
|
@ -768,7 +768,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
return sbType.toString();
|
||||
}
|
||||
|
||||
final protected String getText(String cardType, CardView card) {
|
||||
protected final String getText(String cardType, CardView card) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (card instanceof StackAbilityView || card instanceof AbilityView) {
|
||||
for (String rule : card.getRules()) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import javax.swing.JPanel;
|
|||
|
||||
public class ScaledImagePanel extends JPanel {
|
||||
private static final long serialVersionUID = -1523279873208605664L;
|
||||
public volatile Image srcImage;
|
||||
private volatile Image srcImage;
|
||||
|
||||
private ScalingType scalingType = ScalingType.bilinear;
|
||||
private boolean scaleLarger;
|
||||
|
|
@ -101,7 +101,6 @@ public class ScaledImagePanel extends JPanel {
|
|||
}
|
||||
|
||||
private void scaleWithGetScaledInstance (Graphics2D g2, ScalingInfo info, int hints) {
|
||||
Image srcImage = getSourceImage(info);
|
||||
Image scaledImage = srcImage.getScaledInstance(info.targetWidth, info.targetHeight, hints);
|
||||
g2.drawImage(scaledImage, info.x, info.y, null);
|
||||
}
|
||||
|
|
@ -117,8 +116,6 @@ public class ScaledImagePanel extends JPanel {
|
|||
tempDestHeight = info.targetHeight;
|
||||
}
|
||||
|
||||
Image srcImage = getSourceImage(info);
|
||||
|
||||
// If not doing multipass or multipass only needs a single pass, just scale it once directly to the panel surface.
|
||||
if (multiPassType == MultipassType.none || (tempDestWidth == info.targetWidth && tempDestHeight == info.targetHeight)) {
|
||||
g2.drawImage(srcImage, info.x, info.y, info.targetWidth, info.targetHeight, null);
|
||||
|
|
@ -174,15 +171,11 @@ public class ScaledImagePanel extends JPanel {
|
|||
tempSrcHeight, null);
|
||||
}
|
||||
|
||||
private Image getSourceImage (ScalingInfo info) {
|
||||
return srcImage;
|
||||
}
|
||||
|
||||
public Image getSrcImage() {
|
||||
return srcImage;
|
||||
}
|
||||
|
||||
static private class ScalingInfo {
|
||||
private static class ScalingInfo {
|
||||
public int targetWidth;
|
||||
public int targetHeight;
|
||||
public int srcWidth;
|
||||
|
|
@ -191,11 +184,11 @@ public class ScaledImagePanel extends JPanel {
|
|||
public int y;
|
||||
}
|
||||
|
||||
static public enum MultipassType {
|
||||
public static enum MultipassType {
|
||||
none, nearestNeighbor, bilinear, bicubic
|
||||
}
|
||||
|
||||
static public enum ScalingType {
|
||||
public static enum ScalingType {
|
||||
nearestNeighbor, replicate, bilinear, bicubic, areaAveraging
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import static org.mage.plugins.card.dl.DownloadJob.toFile;
|
|||
|
||||
public class GathererSets implements Iterable<DownloadJob> {
|
||||
|
||||
private final static String SETS_PATH = File.separator + "sets";
|
||||
private final static File DEFAULT_OUT_DIR = new File("plugins" + File.separator + "images" + SETS_PATH);
|
||||
private static final String SETS_PATH = File.separator + "sets";
|
||||
private static final File DEFAULT_OUT_DIR = new File("plugins" + File.separator + "images" + SETS_PATH);
|
||||
private static File outDir = DEFAULT_OUT_DIR;
|
||||
|
||||
private static final String[] symbols = {"10E", "9ED", "8ED", "7ED", "6ED", "5ED", "4ED", "3ED", "2ED", "LEB", "LEA",
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ public class GathererSymbols implements Iterable<DownloadJob> {
|
|||
//TODO chaos and planeswalker symbol
|
||||
//chaos: http://gatherer.wizards.com/Images/Symbols/chaos.gif
|
||||
|
||||
private final static String SYMBOLS_PATH = File.separator + "symbols";
|
||||
private final static File DEFAULT_OUT_DIR = new File("plugins" + File.separator + "images" + SYMBOLS_PATH);
|
||||
private static final String SYMBOLS_PATH = File.separator + "symbols";
|
||||
private static final File DEFAULT_OUT_DIR = new File("plugins" + File.separator + "images" + SYMBOLS_PATH);
|
||||
private static File outDir = DEFAULT_OUT_DIR;
|
||||
|
||||
private static final String urlFmt = "http://gatherer.wizards.com/handlers/image.ashx?size=%1$s&name=%2$s&type=symbol";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue