Drop call to getClass() when used with a static class literal

This commit is contained in:
Dale Schultz 2022-03-26 14:57:28 -04:00
parent ea86baaab6
commit 957997db4f
No known key found for this signature in database
GPG Key ID: EA2C8AD6CB5C2AF2
3 changed files with 15 additions and 9 deletions

View File

@ -33,7 +33,7 @@ public final class Version {
public static final String LOGGER_DEFS_URL = "@loggerdefsurl@";
public static final String CARS_DEFS_URL = "@carsdefsurl@";
public static final String RELEASE_NOTES = "@release_notes@";
public static final ImageIcon ABOUT_ICON = new ImageIcon(Version.class.getClass().getResource("/graphics/romraider-ico-large.gif"));
public static final ImageIcon ABOUT_ICON = new ImageIcon(Version.class.getResource("/graphics/romraider-ico-large.gif"));
public static final int MIN_LOG_DEF_VERSION = @min.logger.def.version@;
public static final String BUILD_ARCH = "@build.arch@";

View File

@ -217,7 +217,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
private static final String ECU_LOGGER_TITLE = PRODUCT_NAME + " v" + VERSION + " | " + rb.getString("TITLE");
private static final String LOGGER_FULLSCREEN_ARG = "-logger.fullscreen";
private static final String LOGGER_TOUCH_ARG = "-logger.touch";
private static final URL ICON_PATH = Settings.class.getClass().getResource("/graphics/romraider-ico.gif");
private static final URL ICON_PATH = Settings.class.getResource("/graphics/romraider-ico.gif");
private static final String HEADING_PARAMETERS = "Parameters";
private static final String HEADING_SWITCHES = "Switches";
private static final String HEADING_EXTERNAL = "External";

View File

@ -1,6 +1,6 @@
/*
* RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2019 RomRaider.com
* Copyright (C) 2006-2022 RomRaider.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -41,10 +41,10 @@ public final class StatusIndicator extends JPanel implements StatusChangeListene
private static final String TEXT_READING_EXTERNAL = rb.getString("READING_EXTERNAL");
private static final String TEXT_LOGGING = rb.getString("LOGGING");
private static final String TEXT_STOPPED = rb.getString("STOPPED");
private static final ImageIcon ICON_CONNECTING = new ImageIcon(StatusIndicator.class.getClass().getResource("/graphics/logger_blue.png"));
private static final ImageIcon ICON_READING = new ImageIcon(StatusIndicator.class.getClass().getResource("/graphics/logger_green.png"));
private static final ImageIcon ICON_LOGGING = new ImageIcon(StatusIndicator.class.getClass().getResource("/graphics/logger_recording.png"));
private static final ImageIcon ICON_STOPPED = new ImageIcon(StatusIndicator.class.getClass().getResource("/graphics/logger_stop.png"));
private static final ImageIcon ICON_CONNECTING = new ImageIcon(StatusIndicator.class.getResource("/graphics/logger_blue.png"));
private static final ImageIcon ICON_READING = new ImageIcon(StatusIndicator.class.getResource("/graphics/logger_green.png"));
private static final ImageIcon ICON_LOGGING = new ImageIcon(StatusIndicator.class.getResource("/graphics/logger_recording.png"));
private static final ImageIcon ICON_STOPPED = new ImageIcon(StatusIndicator.class.getResource("/graphics/logger_stop.png"));
public StatusIndicator() {
setLayout(new BorderLayout());
@ -53,28 +53,34 @@ public final class StatusIndicator extends JPanel implements StatusChangeListene
stopped();
}
@Override
public void connecting() {
updateStatusLabel(TEXT_CONNECTING, ICON_CONNECTING);
}
@Override
public void readingData() {
updateStatusLabel(TEXT_READING, ICON_READING);
}
@Override
public void readingDataExternal() {
updateStatusLabel(TEXT_READING_EXTERNAL, ICON_READING);
}
@Override
public void loggingData() {
updateStatusLabel(TEXT_LOGGING, ICON_LOGGING);
}
@Override
public void stopped() {
updateStatusLabel(TEXT_STOPPED, ICON_STOPPED);
}
private void updateStatusLabel(final String text, final ImageIcon icon) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
statusLabel.setText(text);
statusLabel.setIcon(icon);