From 19a03ca92eb273e04af3aa66eef5bea160683aa3 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 6 Jun 2020 12:26:53 -0400 Subject: [PATCH] ROE device progress --- .../ui/src/com/rusefi/StartupFrame.java | 20 ++++++++++++------- .../com/rusefi/ui/light/LightweightGUI.java | 8 ++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/java_console/ui/src/com/rusefi/StartupFrame.java b/java_console/ui/src/com/rusefi/StartupFrame.java index 13f368e704..f59d4395e7 100644 --- a/java_console/ui/src/com/rusefi/StartupFrame.java +++ b/java_console/ui/src/com/rusefi/StartupFrame.java @@ -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 comboSpeeds) { BaudRateHolder.INSTANCE.baudRate = Integer.parseInt((String) comboSpeeds.getSelectedItem()); String selectedPort = comboPorts.getSelectedItem().toString(); diff --git a/java_console/ui/src/com/rusefi/ui/light/LightweightGUI.java b/java_console/ui/src/com/rusefi/ui/light/LightweightGUI.java index e325f43c3d..eb9aff29ed 100644 --- a/java_console/ui/src/com/rusefi/ui/light/LightweightGUI.java +++ b/java_console/ui/src/com/rusefi/ui/light/LightweightGUI.java @@ -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); } }