add static to inner classes that do not refer to outer context

master
melvinzhang 2017-06-17 12:10:18 +08:00
parent abf695ac4a
commit b1dba6619c
13 changed files with 14 additions and 14 deletions

View File

@ -132,7 +132,7 @@ public class MMAB extends MagicAI {
return sourceGame.map(bestAchoice.choiceResults);
}
class MMABWorker {
static class MMABWorker {
private final boolean CHEAT;
private final long id;

View File

@ -115,7 +115,7 @@ class DeckGamesJTable extends JTable {
repaint();
}
private class MouseHoverListener extends MouseMotionAdapter {
private static class MouseHoverListener extends MouseMotionAdapter {
private int lastMCol = -1;
private int lastMRow = -1;
@Override

View File

@ -163,7 +163,7 @@ public class DecksFilterDialog extends MagicDialog {
};
}
private class DeckSizeFilterPanel extends JPanel {
private static class DeckSizeFilterPanel extends JPanel {
// ui components
private final MigLayout migLayout = new MigLayout();

View File

@ -209,7 +209,7 @@ public class ImportScreen extends MScreen {
}
private class ProgressPanel extends JPanel {
private static class ProgressPanel extends JPanel {
private int percentageComplete = 0;

View File

@ -18,7 +18,7 @@ import net.miginfocom.swing.MigLayout;
public class ScreenFooterPanel extends TexturedPanel
implements IThemeStyle {
private class ContentPanel extends JPanel {
private static class ContentPanel extends JPanel {
public ContentPanel() {
setLayout(new MigLayout("insets 0, gap 0"));
setOpaque(false);

View File

@ -15,7 +15,7 @@ import net.miginfocom.swing.MigLayout;
public class ScreenHeaderPanel extends TexturedPanel
implements IThemeStyle {
private class PlaceHolderPanel extends JPanel {
private static class PlaceHolderPanel extends JPanel {
@Override
public boolean isVisible() {
return false;

View File

@ -11,7 +11,7 @@ public enum SearchOperand {
EXCLUDE(MyStrings._S3);
// Translatable strings.
private class MyStrings {
private static class MyStrings {
static final String _S1 = "Match any";
static final String _S2 = "Match all";
static final String _S3 = "Exclude";

View File

@ -211,7 +211,7 @@ public class CardsLegalityPanel extends JPanel {
}
}
private class HideCellFocusRenderer extends DefaultTableCellRenderer {
private static class HideCellFocusRenderer extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

View File

@ -108,7 +108,7 @@ public class FormatsLegalityPanel extends JPanel {
return lst.toArray(new DeckLegalityInfo[0]);
}
private class FormatsListCellRenderer extends DefaultListCellRenderer {
private static class FormatsListCellRenderer extends DefaultListCellRenderer {
private final ImageIcon LEGAL_ICON = MagicImages.getIcon(MagicIcon.LEGAL);
private final ImageIcon ILLEGAL_ICON = MagicImages.getIcon(MagicIcon.ILLEGAL);
@ -148,7 +148,7 @@ public class FormatsLegalityPanel extends JPanel {
}
private class DeckLegalityInfo {
private static class DeckLegalityInfo {
private final MagicFormat magicFormat;
private boolean isDeckLegal = true;

View File

@ -167,7 +167,7 @@ public class DuelSideBarPanel extends JPanel implements IPlayerZoneListener {
return gameStatusPanel.getTurnPanelLayout(container);
}
private class LayoutSlot {
private static class LayoutSlot {
private JComponent component;
private String constraints;

View File

@ -79,7 +79,7 @@ class LogViewer extends TexturedPanel {
GeneralConfig.getInstance().save();
}
private class LogScrollPane extends JScrollPane {
private static class LogScrollPane extends JScrollPane {
private static final int INCREMENT = 108;

View File

@ -95,7 +95,7 @@ public class StackViewer extends TexturedPanel
* correctly based on whether the vertical scrollbar is visible or not.
*/
@SuppressWarnings("serial")
private final class ScrollablePanel extends JPanel implements Scrollable {
private static final class ScrollablePanel extends JPanel implements Scrollable {
@Override
public Dimension getPreferredScrollableViewportSize() {

View File

@ -191,7 +191,7 @@ public class FiremindWorkerPanel extends JPanel {
firePropertyChange("isRunning", oldState, newValue);
}
private class FiremindWorkerRunner extends SwingWorker<String, Void> {
private static class FiremindWorkerRunner extends SwingWorker<String, Void> {
@Override
protected String doInBackground() throws Exception {
// restarts after 25 games