ROE device progress

This commit is contained in:
rusefi 2020-06-06 12:26:53 -04:00
parent f892c7b8b4
commit 19a03ca92e
2 changed files with 21 additions and 7 deletions

View File

@ -195,14 +195,9 @@ public class StartupFrame {
JPanel rightPanel = new JPanel(new VerticalFlowLayout());
ImageIcon logoIcon = UiUtils.loadIcon(LOGO);
if (logoIcon != null) {
JLabel logo = new JLabel(logoIcon);
logo.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
URLLabel.addUrlAction(logo, URLLabel.createUri(URI));
logo.setCursor(new Cursor(Cursor.HAND_CURSOR));
JLabel logo = createLogoLabel();
if (logo != null)
rightPanel.add(logo);
}
rightPanel.add(new URLLabel(LINK_TEXT, URI));
rightPanel.add(new JLabel("Version " + Launcher.CONSOLE_VERSION));
@ -221,6 +216,17 @@ public class StartupFrame {
}
}
public static JLabel createLogoLabel() {
ImageIcon logoIcon = UiUtils.loadIcon(LOGO);
if (logoIcon == null)
return null;
JLabel logo = new JLabel(logoIcon);
logo.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
URLLabel.addUrlAction(logo, URLLabel.createUri(URI));
logo.setCursor(new Cursor(Cursor.HAND_CURSOR));
return logo;
}
private void connectButtonAction(JComboBox<String> comboSpeeds) {
BaudRateHolder.INSTANCE.baudRate = Integer.parseInt((String) comboSpeeds.getSelectedItem());
String selectedPort = comboPorts.getSelectedItem().toString();

View File

@ -7,6 +7,8 @@ import com.rusefi.ui.util.FrameHelper;
import javax.swing.*;
import java.awt.*;
import static com.rusefi.StartupFrame.createLogoLabel;
public class LightweightGUI {
public static void start() {
FrameHelper frameHelper = new FrameHelper();
@ -19,6 +21,12 @@ public class LightweightGUI {
content.add(topPanel, BorderLayout.NORTH);
content.add(new JLabel(StartupFrame.LINK_TEXT), BorderLayout.CENTER);
JLabel logo = createLogoLabel();
if (logo != null) {
content.add(logo, BorderLayout.EAST);
}
frameHelper.showFrame(content, true);
}
}