From e6a6c6d5cf2d5a01ac1b8af9b41c1f00a0176ad8 Mon Sep 17 00:00:00 2001 From: BatistaCakewalk <118333712+BatistaCakewalk@users.noreply.github.com> Date: Sat, 28 Feb 2026 23:14:33 -0500 Subject: [PATCH 1/3] New settings, themes and animations. --- .../java/com/parafield/storming/Icons.java | 21 + .../storming/ui/widgets/StormingMenuBar.java | 18 +- .../ui/windows/ProjectSelectorWindow.java | 2 +- .../storming/ui/windows/SettingsWindow.java | 419 ++++++++++++++++++ 4 files changed, 458 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/parafield/storming/ui/windows/SettingsWindow.java diff --git a/src/main/java/com/parafield/storming/Icons.java b/src/main/java/com/parafield/storming/Icons.java index f333b1d..f4faaf8 100644 --- a/src/main/java/com/parafield/storming/Icons.java +++ b/src/main/java/com/parafield/storming/Icons.java @@ -1,5 +1,6 @@ package com.parafield.storming; +import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.extras.FlatSVGIcon; import javax.swing.ImageIcon; import java.awt.*; @@ -9,6 +10,7 @@ /** * Provides access to SVG and PNG icon resources used throughout the Storming Engine Editor. * Automatically handles SVG loading (using FlatLaf) and PNG fallbacks. + * SVGs are automatically tinted to match the current theme (light/dark). */ public class Icons { /** The main window icon for the application. */ @@ -17,6 +19,7 @@ public class Icons { /** * Loads an icon from resources by name. * Attempts to find a .svg file in icons/svg first, falling back to .png in icons/png if not found. + * SVGs are configured with a theme-aware color filter. * * @param name The base name of the icon file. * @param width The target width to scale to (set to 0 for default). @@ -29,6 +32,19 @@ private static ImageIcon loadIcon(String name, int width, int height) { if (svgUrl != null) { FlatSVGIcon svgIcon = new FlatSVGIcon(svgUrl); + + // Apply dynamic theme-aware color filter for all icons except brand icons + if (!name.equalsIgnoreCase("icon") && !name.equalsIgnoreCase("exe-icon")) { + svgIcon.setColorFilter(new FlatSVGIcon.ColorFilter(color -> { + // If the current theme is light, map white icons to dark gray + if (!FlatLaf.isLafDark()) { + return new Color(60, 60, 60); + } + // Otherwise keep original (white) + return color; + })); + } + if (width > 0 && height > 0) { return svgIcon.derive(width, height); } @@ -39,7 +55,12 @@ private static ImageIcon loadIcon(String name, int width, int height) { if (pngUrl == null) { return null; } + ImageIcon icon = new ImageIcon(pngUrl); + + // Note: PNG inversion/tinting is more complex and usually handled via separate assets + // or specific ImageFilters if needed. For now, we prioritize SVG scaling and tinting. + if (width > 0 && height > 0) { icon = new ImageIcon(icon.getImage().getScaledInstance(width, height, Image.SCALE_SMOOTH)); } diff --git a/src/main/java/com/parafield/storming/ui/widgets/StormingMenuBar.java b/src/main/java/com/parafield/storming/ui/widgets/StormingMenuBar.java index 0a0ee9c..3ecd373 100644 --- a/src/main/java/com/parafield/storming/ui/widgets/StormingMenuBar.java +++ b/src/main/java/com/parafield/storming/ui/widgets/StormingMenuBar.java @@ -3,6 +3,7 @@ import com.formdev.flatlaf.FlatClientProperties; import com.parafield.storming.Icons; import com.parafield.storming.ui.utils.UIUtils; +import com.parafield.storming.ui.windows.SettingsWindow; import javax.swing.*; import java.awt.*; import java.awt.event.AWTEventListener; @@ -184,6 +185,12 @@ public void paintIcon(Component c, Graphics g, int x, int y) { JButton settingsBtn = new JButton(Icons.SETTINGS); settingsBtn.setToolTipText("Settings"); settingsBtn.putClientProperty(FlatClientProperties.BUTTON_TYPE, FlatClientProperties.BUTTON_TYPE_TOOLBAR_BUTTON); + settingsBtn.addActionListener(e -> { + Window parent = SwingUtilities.getWindowAncestor(this); + if (parent instanceof Frame) { + new SettingsWindow((Frame) parent).setVisible(true); + } + }); add(settingsBtn); } @@ -198,7 +205,16 @@ private JMenu createFileMenu() { menu.addSeparator(); menu.add(new JMenuItem("Save Scene", Icons.CLIPBOARD)); menu.addSeparator(); - menu.add(new JMenuItem("Settings...", Icons.SETTINGS)); + + JMenuItem settingsItem = new JMenuItem("Settings...", Icons.SETTINGS); + settingsItem.addActionListener(e -> { + Window parent = SwingUtilities.getWindowAncestor(this); + if (parent instanceof Frame) { + new SettingsWindow((Frame) parent).setVisible(true); + } + }); + menu.add(settingsItem); + menu.add(new JMenuItem("Exit")); return menu; } diff --git a/src/main/java/com/parafield/storming/ui/windows/ProjectSelectorWindow.java b/src/main/java/com/parafield/storming/ui/windows/ProjectSelectorWindow.java index be91a93..2a1a798 100644 --- a/src/main/java/com/parafield/storming/ui/windows/ProjectSelectorWindow.java +++ b/src/main/java/com/parafield/storming/ui/windows/ProjectSelectorWindow.java @@ -95,7 +95,7 @@ public void mouseExited(java.awt.event.MouseEvent e) { JButton settingsBtn = new JButton(" Settings", Icons.SETTINGS); settingsBtn.putClientProperty(FlatClientProperties.BUTTON_TYPE, FlatClientProperties.BUTTON_TYPE_TOOLBAR_BUTTON); - settingsBtn.addActionListener(e -> JOptionPane.showMessageDialog(this, "Settings coming soon!")); + settingsBtn.addActionListener(e -> new SettingsWindow(this).setVisible(true)); sidebarFooter.add(settingsBtn, BorderLayout.WEST); sidebar.add(sidebarFooter, BorderLayout.SOUTH); diff --git a/src/main/java/com/parafield/storming/ui/windows/SettingsWindow.java b/src/main/java/com/parafield/storming/ui/windows/SettingsWindow.java new file mode 100644 index 0000000..c861de8 --- /dev/null +++ b/src/main/java/com/parafield/storming/ui/windows/SettingsWindow.java @@ -0,0 +1,419 @@ +package com.parafield.storming.ui.windows; + +import com.formdev.flatlaf.FlatClientProperties; +import com.formdev.flatlaf.FlatDarkLaf; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.FlatLightLaf; +import com.formdev.flatlaf.themes.FlatMacDarkLaf; +import com.formdev.flatlaf.themes.FlatMacLightLaf; +import com.parafield.storming.Icons; +import com.parafield.storming.ui.utils.UIAnimator; +import com.parafield.storming.ui.utils.UIUtils; +import javax.swing.*; +import javax.swing.border.EmptyBorder; +import java.awt.*; + +/** + * The Settings window for the Storming Engine Editor. + * Provides a categorized interface for application and engine configuration, + * featuring a searchable category list and dynamic content panels with smooth transitions. + */ +public class SettingsWindow extends JDialog { + + private final CardLayout cardLayout; + private final JPanel contentPanel; + private final JList categoryList; + private final JLabel headerLabel; + + private float contentAlpha = 0.0f; + private int contentYOffset = 20; + + /** + * Constructs a SettingsWindow. + * @param owner The parent frame for this dialog. + */ + public SettingsWindow(Window owner) { + super(owner, "Settings", ModalityType.APPLICATION_MODAL); + setSize(900, 650); + setLocationRelativeTo(owner); + + rootPane.putClientProperty("apple.awt.fullWindowContent", true); + rootPane.putClientProperty("apple.awt.transparentTitleBar", true); + + setLayout(new BorderLayout()); + + // --- 1. Sidebar (Search + Categories) --- + JPanel sidebar = new JPanel(new BorderLayout()); + sidebar.setPreferredSize(new Dimension(240, 0)); + sidebar.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, UIManager.getColor("Component.borderColor"))); + sidebar.putClientProperty(FlatClientProperties.STYLE, "background: darken($Panel.background, 2%)"); + + // Search Field + JPanel searchPanel = new JPanel(new BorderLayout()); + searchPanel.setOpaque(false); + searchPanel.setBorder(new EmptyBorder(35, 15, 10, 15)); + + JTextField searchField = new JTextField(); + searchField.putClientProperty(FlatClientProperties.PLACEHOLDER_TEXT, "Search settings..."); + searchField.putClientProperty(FlatClientProperties.TEXT_FIELD_LEADING_ICON, Icons.SEARCH); + searchField.putClientProperty(FlatClientProperties.STYLE, "arc: 8; background: darken($Panel.background, 4%); borderWidth: 0; focusWidth: 0;"); + searchPanel.add(searchField, BorderLayout.CENTER); + sidebar.add(searchPanel, BorderLayout.NORTH); + + DefaultListModel model = new DefaultListModel<>(); + model.addElement(new CategoryItem("Appearance", Icons.BRUSH)); + model.addElement(new CategoryItem("Engine", Icons.LOGO_80)); + model.addElement(new CategoryItem("Editor", Icons.SETTINGS)); + model.addElement(new CategoryItem("Git", Icons.GIT)); + model.addElement(new CategoryItem("Terminal", Icons.CONSOLE)); + + categoryList = new JList<>(model); + categoryList.setCellRenderer(new CategoryRenderer()); + categoryList.setFixedCellHeight(36); + categoryList.setOpaque(false); + categoryList.setSelectedIndex(0); + categoryList.setBorder(new EmptyBorder(0, 8, 0, 8)); + + JScrollPane scrollPane = new JScrollPane(categoryList); + scrollPane.setBorder(null); + scrollPane.setOpaque(false); + scrollPane.getViewport().setOpaque(false); + sidebar.add(scrollPane, BorderLayout.CENTER); + + // --- 2. Content Area --- + JPanel rightPanel = new JPanel(new BorderLayout()) { + @Override + public void paint(Graphics g) { + Graphics2D g2 = (Graphics2D) g.create(); + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, contentAlpha)); + g2.translate(0, contentYOffset); + super.paint(g2); + g2.dispose(); + } + }; + + // Header + JPanel header = new JPanel(new BorderLayout()); + header.setPreferredSize(new Dimension(0, 60)); + header.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("Component.borderColor"))); + header.setOpaque(false); + + headerLabel = new JLabel("Appearance"); + headerLabel.setFont(UIUtils.getFont(Font.BOLD, 20f)); + headerLabel.setBorder(new EmptyBorder(25, 30, 0, 0)); + header.add(headerLabel, BorderLayout.WEST); + rightPanel.add(header, BorderLayout.NORTH); + + cardLayout = new CardLayout(); + contentPanel = new JPanel(cardLayout); + contentPanel.setBorder(new EmptyBorder(20, 30, 20, 30)); + contentPanel.setOpaque(false); + + contentPanel.add(createAppearancePanel(), "Appearance"); + contentPanel.add(createEnginePanel(), "Engine"); + contentPanel.add(createEditorPanel(), "Editor"); + contentPanel.add(createPlaceholderPanel("Version Control (Git)"), "Git"); + contentPanel.add(createPlaceholderPanel("Terminal Emulator Settings"), "Terminal"); + + categoryList.addListSelectionListener(e -> { + if (!e.getValueIsAdjusting()) { + CategoryItem selected = categoryList.getSelectedValue(); + if (selected != null) { + animateCategoryTransition(selected.name); + } + } + }); + + rightPanel.add(contentPanel, BorderLayout.CENTER); + + // --- 3. Footer --- + JPanel footer = new JPanel(new FlowLayout(FlowLayout.RIGHT, 12, 12)); + footer.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIManager.getColor("Component.borderColor"))); + + JButton cancelBtn = new JButton("Cancel"); + cancelBtn.addActionListener(e -> dispose()); + + JButton applyBtn = new JButton("Apply"); + applyBtn.setEnabled(false); + + JButton okBtn = new JButton("OK"); + okBtn.putClientProperty(FlatClientProperties.STYLE, "background: #3498db; foreground: #ffffff;"); + okBtn.addActionListener(e -> dispose()); + + footer.add(cancelBtn); + footer.add(applyBtn); + footer.add(okBtn); + + add(sidebar, BorderLayout.WEST); + add(rightPanel, BorderLayout.CENTER); + add(footer, BorderLayout.SOUTH); + + // Start entrance animation + SwingUtilities.invokeLater(this::animateEntrance); + } + + /** + * Performs an entrance animation for the content area. + */ + private void animateEntrance() { + UIAnimator.animate(0.0f, 1.0f, 500, a -> { + contentAlpha = a; + contentYOffset = (int)(20 * (1.0f - a)); + repaint(); + }, null); + } + + /** + * Animates the transition between setting categories. + * @param targetName The name of the category to transition to. + */ + private void animateCategoryTransition(String targetName) { + // Fade out current + UIAnimator.animate(1.0f, 0.0f, 150, a -> { + contentAlpha = a; + repaint(); + }, () -> { + // Switch card + cardLayout.show(contentPanel, targetName); + headerLabel.setText(targetName); + // Fade in new + UIAnimator.animate(0.0f, 1.0f, 200, a -> { + contentAlpha = a; + repaint(); + }, null); + }); + } + + /** + * Creates the panel for Editor-specific preferences. + * @return A JPanel containing autosave, keymap, and editor behavior settings. + */ + private JPanel createEditorPanel() { + JPanel p = new JPanel(); + p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); + p.setOpaque(false); + + p.add(createSectionHeader("General")); + p.add(Box.createVerticalStrut(10)); + + JCheckBox autoSave = new JCheckBox("Autosave files on window focus loss"); + autoSave.setSelected(true); + autoSave.setOpaque(false); + p.add(createSettingRow("Autosave:", autoSave)); + + p.add(Box.createVerticalStrut(8)); + p.add(createSettingRow("Keymap:", new JComboBox<>(new String[]{"Default", "IntelliJ IDEA", "Visual Studio", "Sublime Text"}))); + + p.add(Box.createVerticalStrut(30)); + + p.add(createSectionHeader("Code Style")); + p.add(Box.createVerticalStrut(10)); + + p.add(createSettingRow("Tab Size:", new JSpinner(new SpinnerNumberModel(4, 1, 8, 1)))); + p.add(Box.createVerticalStrut(8)); + + JCheckBox useSpaces = new JCheckBox("Insert spaces instead of tabs"); + useSpaces.setSelected(true); + useSpaces.setOpaque(false); + p.add(createSettingRow("Indentation:", useSpaces)); + + p.add(Box.createVerticalGlue()); + return p; + } + + /** + * Creates the panel for Engine-specific settings. + * @return A JPanel containing engine path, graphics API, and logging configuration. + */ + private JPanel createEnginePanel() { + JPanel p = new JPanel(); + p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); + p.setOpaque(false); + + // Core Engine Section + p.add(createSectionHeader("Runtime Environment")); + p.add(Box.createVerticalStrut(10)); + + JPanel pathPanel = new JPanel(new BorderLayout(5, 0)); + pathPanel.setOpaque(false); + JTextField pathField = new JTextField("Engine/2D/build/bin/StormingEngine"); + JButton browseBtn = new JButton("Browse..."); + pathPanel.add(pathField, BorderLayout.CENTER); + pathPanel.add(browseBtn, BorderLayout.EAST); + + p.add(createSettingRow("Engine Path:", pathPanel)); + p.add(Box.createVerticalStrut(8)); + + p.add(createSettingRow("Graphics API:", new JComboBox<>(new String[]{"OpenGL 4.5 Core (Default)", "Vulkan 1.3 (Experimental)", "DirectX 12 (Windows Only)"}))); + p.add(Box.createVerticalStrut(8)); + + p.add(createSettingRow("Log Level:", new JComboBox<>(new String[]{"Debug", "Info", "Warning", "Error", "Critical"}))); + + p.add(Box.createVerticalStrut(30)); + + // Shared Memory Section + p.add(createSectionHeader("Performance & IPC")); + p.add(Box.createVerticalStrut(10)); + + JCheckBox shmCheck = new JCheckBox("Use Shared Memory for Real-time Streaming"); + shmCheck.setSelected(true); + shmCheck.setOpaque(false); + p.add(createSettingRow("Streaming:", shmCheck)); + + p.add(Box.createVerticalStrut(8)); + p.add(createSettingRow("Buffer Size:", new JComboBox<>(new String[]{"Double Buffered", "Triple Buffered"}))); + + p.add(Box.createVerticalGlue()); + return p; + } + + /** + * Creates the panel for Appearance settings. + * @return A JPanel containing appearance-related configuration components. + */ + private JPanel createAppearancePanel() { + JPanel p = new JPanel(); + p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); + p.setOpaque(false); + + // UI Theme Section + p.add(createSectionHeader("User Interface")); + p.add(Box.createVerticalStrut(10)); + + String[] themes = {"Mac Dark", "Mac Light", "Flat Dark", "Flat Light"}; + JComboBox themeCombo = new JComboBox<>(themes); + + // Set initial selection based on current Look and Feel + String currentLaf = UIManager.getLookAndFeel().getClass().getSimpleName(); + if (currentLaf.contains("MacDark")) themeCombo.setSelectedIndex(0); + else if (currentLaf.contains("MacLight")) themeCombo.setSelectedIndex(1); + else if (currentLaf.contains("FlatDark")) themeCombo.setSelectedIndex(2); + else if (currentLaf.contains("FlatLight")) themeCombo.setSelectedIndex(3); + + themeCombo.addActionListener(e -> { + String selected = (String) themeCombo.getSelectedItem(); + try { + if ("Mac Dark".equals(selected)) UIManager.setLookAndFeel(new FlatMacDarkLaf()); + else if ("Mac Light".equals(selected)) UIManager.setLookAndFeel(new FlatMacLightLaf()); + else if ("Flat Dark".equals(selected)) UIManager.setLookAndFeel(new FlatDarkLaf()); + else if ("Flat Light".equals(selected)) UIManager.setLookAndFeel(new FlatLightLaf()); + + FlatLaf.updateUI(); + } catch (Exception ex) { + ex.printStackTrace(); + } + }); + + p.add(createSettingRow("Theme:", themeCombo)); + p.add(Box.createVerticalStrut(8)); + p.add(createSettingRow("Zoom Level:", new JComboBox<>(new String[]{"100%", "125%", "150%", "200%"}))); + + p.add(Box.createVerticalStrut(30)); + + // Editor Section + p.add(createSectionHeader("Editor Font")); + p.add(Box.createVerticalStrut(10)); + + JPanel fontControls = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + fontControls.setOpaque(false); + JComboBox fontCombo = new JComboBox<>(new String[]{"JetBrains Mono", "Fira Code", "Consolas"}); + fontCombo.setPreferredSize(new Dimension(200, 30)); + JSpinner sizeSpinner = new JSpinner(new SpinnerNumberModel(13, 8, 72, 1)); + sizeSpinner.setPreferredSize(new Dimension(65, 30)); + fontControls.add(fontCombo); + fontControls.add(Box.createHorizontalStrut(10)); + fontControls.add(sizeSpinner); + + p.add(createSettingRow("Font Family:", fontControls)); + p.add(Box.createVerticalStrut(8)); + p.add(createSettingRow("Line Spacing:", new JSpinner(new SpinnerNumberModel(1.2, 0.5, 3.0, 0.1)))); + + p.add(Box.createVerticalGlue()); + return p; + } + + /** + * Creates a standardized row for a setting. + * @param label The name of the setting. + * @param component The interactive component for the setting. + * @return A JPanel representing one setting row. + */ + private JPanel createSettingRow(String label, JComponent component) { + JPanel row = new JPanel(new BorderLayout()); + row.setOpaque(false); + row.setMaximumSize(new Dimension(600, 30)); + row.setAlignmentX(Component.LEFT_ALIGNMENT); + + JLabel l = new JLabel(label); + l.setPreferredSize(new Dimension(120, 30)); + l.setFont(UIUtils.getFont(Font.PLAIN, 12f)); + + component.setMaximumSize(new Dimension(300, 30)); + + row.add(l, BorderLayout.WEST); + row.add(component, BorderLayout.CENTER); + return row; + } + + /** + * Creates a stylized header for a setting section. + * @param text The header text. + * @return A JLabel configured as a section header. + */ + private JLabel createSectionHeader(String text) { + JLabel l = new JLabel(text); + l.setFont(UIUtils.getFont(Font.BOLD, 14f)); + l.setForeground(UIManager.getColor("Label.disabledForeground")); + l.setAlignmentX(Component.LEFT_ALIGNMENT); + return l; + } + + /** + * Creates a placeholder panel for categories that are not yet fully implemented. + * @param text The text to display in the placeholder. + * @return A JPanel with a centered placeholder label. + */ + private JPanel createPlaceholderPanel(String text) { + JPanel p = new JPanel(new BorderLayout()); + p.setOpaque(false); + JLabel l = new JLabel("
" + text + "
Configure " + text.toLowerCase() + " options here.
", SwingConstants.CENTER); + l.setFont(UIUtils.getFont(Font.PLAIN, 15f)); + p.add(l, BorderLayout.CENTER); + return p; + } + + /** Represents a category entry in the settings sidebar. */ + private record CategoryItem(String name, Icon icon) {} + + /** Custom renderer for settings categories with JetBrains-style selection. */ + private static class CategoryRenderer extends DefaultListCellRenderer { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + CategoryItem item = (CategoryItem) value; + JPanel p = new JPanel(new BorderLayout(10, 0)) { + @Override + protected void paintComponent(Graphics g) { + if (isSelected) { + Graphics2D g2 = (Graphics2D) g.create(); + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2.setColor(UIManager.getColor("List.selectionBackground")); + g2.fillRoundRect(0, 2, getWidth(), getHeight() - 4, 6, 6); + g2.dispose(); + } + } + }; + p.setOpaque(false); + p.setBorder(new EmptyBorder(0, 10, 0, 10)); + + JLabel iconLabel = new JLabel(item.icon); + JLabel textLabel = new JLabel(item.name); + textLabel.setFont(UIUtils.getFont(isSelected ? Font.BOLD : Font.PLAIN, 13f)); + textLabel.setForeground(isSelected ? UIManager.getColor("List.selectionForeground") : UIManager.getColor("Label.foreground")); + + p.add(iconLabel, BorderLayout.WEST); + p.add(textLabel, BorderLayout.CENTER); + return p; + } + } +} From edefef2e3883a125d5ffe30914738be8fad9da44 Mon Sep 17 00:00:00 2001 From: BatistaCakewalk <118333712+BatistaCakewalk@users.noreply.github.com> Date: Sat, 28 Feb 2026 23:27:17 -0500 Subject: [PATCH 2/3] Updated Simulation --- .../storming/ui/windows/SimulationWindow.java | 142 ++++++++++-------- 1 file changed, 83 insertions(+), 59 deletions(-) diff --git a/src/main/java/com/parafield/storming/ui/windows/SimulationWindow.java b/src/main/java/com/parafield/storming/ui/windows/SimulationWindow.java index 8a4bbec..4b4a8e6 100644 --- a/src/main/java/com/parafield/storming/ui/windows/SimulationWindow.java +++ b/src/main/java/com/parafield/storming/ui/windows/SimulationWindow.java @@ -6,56 +6,51 @@ import com.parafield.storming.ui.panels.SceneViewPanel; import com.parafield.storming.ui.utils.UIUtils; import javax.swing.*; +import javax.swing.border.EmptyBorder; import java.awt.*; /** - * A dedicated window for running and debugging engine simulations. - * Provides a clean viewport for the game/application and playback controls. - * Integrates with the {@link EngineLauncher} to manage the engine process. + * A simulation window inspired by Godot's runtime environment. + * Features a streamlined top bar with centered controls and a minimal footer + * for a focused debugging experience. */ public class SimulationWindow extends JFrame { private final SceneViewPanel viewport; private final EngineLauncher launcher; + + private JLabel statusLabel; + private JLabel fpsLabel; /** - * Constructs a SimulationWindow. - * @param launcher The EngineLauncher instance to use for starting/stopping the engine. + * Constructs a SimulationWindow with a Godot-inspired layout. + * @param launcher The EngineLauncher instance to manage the engine process. */ public SimulationWindow(EngineLauncher launcher) { this.launcher = launcher; - setTitle("New Adventure (DEBUG) - Storming Engine"); - setSize(1200, 800); + setTitle("Storming Engine - Simulation (DEBUG)"); + setSize(1280, 720); setLocationRelativeTo(null); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - // Integrated Title Bar setup + // Modern Window setup rootPane.putClientProperty("apple.awt.fullWindowContent", true); rootPane.putClientProperty("apple.awt.transparentTitleBar", true); rootPane.putClientProperty("flatlaf.showWindowIcon", false); - initMenuBar(); - JPanel root = new JPanel(new BorderLayout()); setContentPane(root); - // 1. The Viewport (Godot style: pure game focus) + // --- 1. Godot-style Header --- + root.add(createHeader(), BorderLayout.NORTH); + + // --- 2. Main Viewport --- viewport = new SceneViewPanel(); root.add(viewport, BorderLayout.CENTER); - // 2. Minimal Footer (Optional, can be removed for full clean look) - JPanel footer = new JPanel(new BorderLayout()); - footer.setPreferredSize(new Dimension(0, 22)); - footer.setBackground(new Color(20, 20, 25)); - footer.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, new Color(100, 100, 100, 30))); - - JLabel stats = new JLabel(" ● Live | 60 FPS | OpenGL 4.5 Core"); - stats.setFont(UIUtils.getFont(Font.PLAIN, 10f)); - stats.setForeground(new Color(150, 150, 150)); - footer.add(stats, BorderLayout.WEST); - - root.add(footer, BorderLayout.SOUTH); + // --- 3. Minimal Footer --- + root.add(createFooter(), BorderLayout.SOUTH); // ESC to stop root.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "stopSim"); @@ -69,80 +64,109 @@ public SimulationWindow(EngineLauncher launcher) { } /** - * Initializes the menu bar with simulation playback controls (Restart, Pause, Stop). + * Creates the top bar with project info and centered playback controls. + * @return A JPanel configured as a header. */ - private void initMenuBar() { - JMenuBar menuBar = new JMenuBar(); - menuBar.setPreferredSize(new Dimension(0, 40)); - menuBar.setBackground(new Color(25, 25, 30)); + private JPanel createHeader() { + JPanel header = new JPanel(new BorderLayout()); + header.setPreferredSize(new Dimension(0, 42)); + header.setBackground(new Color(30, 30, 35)); + header.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(60, 60, 65))); + + // Left: Title & Debug Badge + JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 15, 8)); + leftPanel.setOpaque(false); - // Left: Title - JLabel titleLabel = new JLabel(" New Adventure (DEBUG)"); + JLabel titleLabel = new JLabel("New Adventure"); titleLabel.setFont(UIUtils.getFont(Font.BOLD, 12f)); - titleLabel.setForeground(new Color(200, 200, 200)); - menuBar.add(titleLabel); - - menuBar.add(Box.createHorizontalGlue()); + titleLabel.setForeground(new Color(220, 220, 220)); + + JLabel debugBadge = new JLabel(" DEBUG "); + debugBadge.setFont(UIUtils.getFont(Font.BOLD, 10f)); + debugBadge.setForeground(new Color(231, 76, 60)); + debugBadge.setBorder(BorderFactory.createLineBorder(new Color(231, 76, 60, 150), 1)); + + leftPanel.add(titleLabel); + leftPanel.add(debugBadge); + header.add(leftPanel, BorderLayout.WEST); - // Center: Godot-style Playback Controls - JPanel centerPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 0)); + // Center: Playback Controls + JPanel centerPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 2, 4)); centerPanel.setOpaque(false); - JButton restartBtn = createControlBtn(Icons.RESTART, "Restart (F5)"); + JButton restartBtn = createHeaderBtn(Icons.RESTART, "Restart Simulation (F5)"); restartBtn.addActionListener(e -> restartSimulation()); - JButton pauseBtn = createControlBtn(Icons.PAUSE, "Pause"); + JButton pauseBtn = createHeaderBtn(Icons.PAUSE, "Pause Simulation"); - JButton stopBtn = createControlBtn(Icons.STOP, "Stop (Esc)"); + JButton stopBtn = createHeaderBtn(Icons.STOP, "Stop Simulation (Esc)"); stopBtn.addActionListener(e -> closeAndStop()); centerPanel.add(restartBtn); centerPanel.add(pauseBtn); centerPanel.add(stopBtn); - - menuBar.add(centerPanel); - menuBar.add(Box.createHorizontalGlue()); - - // Right: Window controls space - menuBar.add(Box.createHorizontalStrut(120)); + header.add(centerPanel, BorderLayout.CENTER); + + // Right: Placeholder for search or filter + JPanel rightPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 15, 8)); + rightPanel.setOpaque(false); + rightPanel.add(Box.createHorizontalStrut(150)); // Match mac window buttons space + header.add(rightPanel, BorderLayout.EAST); - setJMenuBar(menuBar); + return header; } /** - * Creates a stylized toolbar button for simulation control. - * @param icon The icon to display on the button. - * @param tip The tooltip text for the button. - * @return A configured JButton. + * Creates the status bar footer. + * @return A JPanel configured as a footer. */ - private JButton createControlBtn(Icon icon, String tip) { + private JPanel createFooter() { + JPanel footer = new JPanel(new BorderLayout()); + footer.setPreferredSize(new Dimension(0, 24)); + footer.setBackground(new Color(25, 25, 30)); + footer.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, new Color(50, 50, 55))); + + JPanel left = new JPanel(new FlowLayout(FlowLayout.LEFT, 12, 2)); + left.setOpaque(false); + statusLabel = new JLabel("● Running Storming Engine 2D"); + statusLabel.setFont(UIUtils.getFont(Font.PLAIN, 11f)); + statusLabel.setForeground(new Color(46, 204, 113)); + left.add(statusLabel); + + JPanel right = new JPanel(new FlowLayout(FlowLayout.RIGHT, 15, 2)); + right.setOpaque(false); + fpsLabel = new JLabel("60 FPS | 16.6ms | OpenGL 4.5 Core"); + fpsLabel.setFont(UIUtils.getFont(Font.PLAIN, 11f)); + fpsLabel.setForeground(UIManager.getColor("Label.disabledForeground")); + right.add(fpsLabel); + + footer.add(left, BorderLayout.WEST); + footer.add(right, BorderLayout.EAST); + return footer; + } + + private JButton createHeaderBtn(Icon icon, String tip) { JButton btn = new JButton(icon); btn.setToolTipText(tip); btn.putClientProperty(FlatClientProperties.BUTTON_TYPE, FlatClientProperties.BUTTON_TYPE_TOOLBAR_BUTTON); btn.setPreferredSize(new Dimension(34, 34)); + btn.setFocusable(false); return btn; } - /** - * Restarts the engine simulation by stopping the current process and launching a new one. - */ private void restartSimulation() { launcher.stop(); Timer t = new Timer(500, e -> startSimulation()); t.setRepeats(false); t.start(); } - /** - * Stops the simulation and closes the window. - */ private void closeAndStop() { launcher.stop(); dispose(); } /** - * Starts the engine simulation. - * Makes the window visible and initiates engine launch with shared memory. + * Initiates the simulation process and starts the shared memory stream. */ public void startSimulation() { setVisible(true); From df2e5f5165c22cc5812dd44ffc81f8f711997b5f Mon Sep 17 00:00:00 2001 From: BatistaCakewalk <118333712+BatistaCakewalk@users.noreply.github.com> Date: Sun, 1 Mar 2026 01:30:45 -0500 Subject: [PATCH 3/3] I forgot what I was doing --- .../java/com/parafield/storming/Icons.java | 4 +- .../storming/ui/panels/SceneViewPanel.java | 15 +- .../storming/ui/windows/SimulationWindow.java | 220 +++++++++++------- .../parafield/storming/icons/png/pause.png | Bin 0 -> 1905 bytes .../parafield/storming/icons/png/restart.png | Bin 0 -> 4732 bytes .../parafield/storming/icons/svg/pause.svg | 7 + .../parafield/storming/icons/svg/restart.svg | 7 + 7 files changed, 167 insertions(+), 86 deletions(-) create mode 100644 src/main/resources/com/parafield/storming/icons/png/pause.png create mode 100644 src/main/resources/com/parafield/storming/icons/png/restart.png create mode 100644 src/main/resources/com/parafield/storming/icons/svg/pause.svg create mode 100644 src/main/resources/com/parafield/storming/icons/svg/restart.svg diff --git a/src/main/java/com/parafield/storming/Icons.java b/src/main/java/com/parafield/storming/Icons.java index f4faaf8..2a41823 100644 --- a/src/main/java/com/parafield/storming/Icons.java +++ b/src/main/java/com/parafield/storming/Icons.java @@ -105,6 +105,6 @@ private static ImageIcon loadIcon(String name, int width, int height) { public static final ImageIcon PLUS = loadIcon("plus", 16, 16); public static final ImageIcon BRUSH = loadIcon("brush", 16, 16); public static final ImageIcon CLIPBOARD = loadIcon("clipboard", 16, 16); - public static final ImageIcon RESTART = loadIcon("restart", 18, 18); - public static final ImageIcon PAUSE = loadIcon("pause", 18, 18); + public static final ImageIcon RESTART = loadIcon("restart", 23, 23); + public static final ImageIcon PAUSE = loadIcon("pause", 23, 23); } diff --git a/src/main/java/com/parafield/storming/ui/panels/SceneViewPanel.java b/src/main/java/com/parafield/storming/ui/panels/SceneViewPanel.java index 7b4f897..df2cceb 100644 --- a/src/main/java/com/parafield/storming/ui/panels/SceneViewPanel.java +++ b/src/main/java/com/parafield/storming/ui/panels/SceneViewPanel.java @@ -44,6 +44,7 @@ public interface LibC extends Library { // 2D Overlays private boolean showGrid = true; private boolean showCollisions = false; + private final JPanel overlayToolbar; /** * Constructs a SceneViewPanel, initializing the image buffer and floating toolbar. @@ -56,7 +57,7 @@ public SceneViewPanel() { image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); // --- Floating Scene Toolbar --- - JPanel overlayToolbar = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 2)); + overlayToolbar = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 2)); overlayToolbar.setOpaque(true); overlayToolbar.setBackground(new Color(40, 40, 45, 180)); overlayToolbar.setBorder(BorderFactory.createLineBorder(new Color(100, 100, 100, 50))); @@ -89,6 +90,14 @@ public SceneViewPanel() { timer.start(); } + /** + * Toggles the visibility of the floating scene toolbar. + * @param visible true to show the toolbar, false to hide it. + */ + public void setToolbarVisible(boolean visible) { + overlayToolbar.setVisible(visible); + } + /** * Utility method to create a stylized toggle button for scene overlays. * @param tip The tooltip text. @@ -155,8 +164,8 @@ protected void paintComponent(Graphics g) { // Draw image centered and scaled g.drawImage(image, 0, 0, getWidth(), getHeight(), null); - // Draw custom grid if enabled - if (showGrid) { + // Draw custom grid if enabled (only if toolbar/overlays would be visible) + if (showGrid && overlayToolbar.isVisible()) { drawGrid(g); } } diff --git a/src/main/java/com/parafield/storming/ui/windows/SimulationWindow.java b/src/main/java/com/parafield/storming/ui/windows/SimulationWindow.java index 4b4a8e6..cff2200 100644 --- a/src/main/java/com/parafield/storming/ui/windows/SimulationWindow.java +++ b/src/main/java/com/parafield/storming/ui/windows/SimulationWindow.java @@ -4,28 +4,30 @@ import com.parafield.storming.Icons; import com.parafield.storming.core.EngineLauncher; import com.parafield.storming.ui.panels.SceneViewPanel; +import com.parafield.storming.ui.utils.UIAnimator; import com.parafield.storming.ui.utils.UIUtils; import javax.swing.*; import javax.swing.border.EmptyBorder; import java.awt.*; /** - * A simulation window inspired by Godot's runtime environment. - * Features a streamlined top bar with centered controls and a minimal footer - * for a focused debugging experience. + * An advanced simulation window with a Godot-inspired aesthetic. + * Features a pulsating "LIVE" indicator, real-time resource tracking, + * and smooth entrance animations for a high-end feel. */ public class SimulationWindow extends JFrame { private final SceneViewPanel viewport; private final EngineLauncher launcher; - private JLabel statusLabel; - private JLabel fpsLabel; + private AlphaPanel header; + private AlphaPanel footer; + private JLabel liveIndicator; + private JLabel memLabel; + private JProgressBar memBar; + + private boolean isPaused = false; - /** - * Constructs a SimulationWindow with a Godot-inspired layout. - * @param launcher The EngineLauncher instance to manage the engine process. - */ public SimulationWindow(EngineLauncher launcher) { this.launcher = launcher; @@ -34,7 +36,6 @@ public SimulationWindow(EngineLauncher launcher) { setLocationRelativeTo(null); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - // Modern Window setup rootPane.putClientProperty("apple.awt.fullWindowContent", true); rootPane.putClientProperty("apple.awt.transparentTitleBar", true); rootPane.putClientProperty("flatlaf.showWindowIcon", false); @@ -42,17 +43,16 @@ public SimulationWindow(EngineLauncher launcher) { JPanel root = new JPanel(new BorderLayout()); setContentPane(root); - // --- 1. Godot-style Header --- - root.add(createHeader(), BorderLayout.NORTH); + header = createHeader(); + root.add(header, BorderLayout.NORTH); - // --- 2. Main Viewport --- viewport = new SceneViewPanel(); + viewport.setToolbarVisible(false); root.add(viewport, BorderLayout.CENTER); - // --- 3. Minimal Footer --- - root.add(createFooter(), BorderLayout.SOUTH); + footer = createFooter(); + root.add(footer, BorderLayout.SOUTH); - // ESC to stop root.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "stopSim"); root.getActionMap().put("stopSim", new AbstractAction() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { closeAndStop(); } @@ -61,95 +61,135 @@ public SimulationWindow(EngineLauncher launcher) { addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { closeAndStop(); } }); + + startLivePulse(); + startResourceMonitor(); } - /** - * Creates the top bar with project info and centered playback controls. - * @return A JPanel configured as a header. - */ - private JPanel createHeader() { - JPanel header = new JPanel(new BorderLayout()); - header.setPreferredSize(new Dimension(0, 42)); - header.setBackground(new Color(30, 30, 35)); - header.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(60, 60, 65))); - - // Left: Title & Debug Badge - JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 15, 8)); - leftPanel.setOpaque(false); + private AlphaPanel createHeader() { + AlphaPanel p = new AlphaPanel(new BorderLayout()); + p.setPreferredSize(new Dimension(0, 42)); + p.setBackground(new Color(30, 30, 35)); + p.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(60, 60, 65))); + + JPanel left = new JPanel(new FlowLayout(FlowLayout.LEFT, 15, 8)); + left.setOpaque(false); + + liveIndicator = new JLabel("●"); + liveIndicator.setFont(UIUtils.getFont(Font.BOLD, 11f)); + liveIndicator.setForeground(new Color(46, 204, 113)); - JLabel titleLabel = new JLabel("New Adventure"); - titleLabel.setFont(UIUtils.getFont(Font.BOLD, 12f)); - titleLabel.setForeground(new Color(220, 220, 220)); + JLabel title = new JLabel("New Adventure"); + title.setFont(UIUtils.getFont(Font.BOLD, 12f)); + title.setForeground(new Color(220, 220, 220)); - JLabel debugBadge = new JLabel(" DEBUG "); - debugBadge.setFont(UIUtils.getFont(Font.BOLD, 10f)); - debugBadge.setForeground(new Color(231, 76, 60)); - debugBadge.setBorder(BorderFactory.createLineBorder(new Color(231, 76, 60, 150), 1)); + JLabel badge = new JLabel(" DEBUG "); + badge.setFont(UIUtils.getFont(Font.BOLD, 9f)); + badge.setForeground(new Color(231, 76, 60)); + badge.setBorder(BorderFactory.createLineBorder(new Color(231, 76, 60, 100))); - leftPanel.add(titleLabel); - leftPanel.add(debugBadge); - header.add(leftPanel, BorderLayout.WEST); + left.add(liveIndicator); + left.add(title); + left.add(badge); + p.add(left, BorderLayout.WEST); - // Center: Playback Controls - JPanel centerPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 2, 4)); - centerPanel.setOpaque(false); + JPanel center = new JPanel(new FlowLayout(FlowLayout.CENTER, 4, 4)); + center.setOpaque(false); JButton restartBtn = createHeaderBtn(Icons.RESTART, "Restart Simulation (F5)"); restartBtn.addActionListener(e -> restartSimulation()); JButton pauseBtn = createHeaderBtn(Icons.PAUSE, "Pause Simulation"); + pauseBtn.addActionListener(e -> togglePause()); JButton stopBtn = createHeaderBtn(Icons.STOP, "Stop Simulation (Esc)"); stopBtn.addActionListener(e -> closeAndStop()); - centerPanel.add(restartBtn); - centerPanel.add(pauseBtn); - centerPanel.add(stopBtn); - header.add(centerPanel, BorderLayout.CENTER); - - // Right: Placeholder for search or filter - JPanel rightPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 15, 8)); - rightPanel.setOpaque(false); - rightPanel.add(Box.createHorizontalStrut(150)); // Match mac window buttons space - header.add(rightPanel, BorderLayout.EAST); + center.add(restartBtn); + center.add(pauseBtn); + center.add(stopBtn); + p.add(center, BorderLayout.CENTER); - return header; + p.add(Box.createHorizontalStrut(150), BorderLayout.EAST); + return p; } - /** - * Creates the status bar footer. - * @return A JPanel configured as a footer. - */ - private JPanel createFooter() { - JPanel footer = new JPanel(new BorderLayout()); - footer.setPreferredSize(new Dimension(0, 24)); - footer.setBackground(new Color(25, 25, 30)); - footer.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, new Color(50, 50, 55))); - - JPanel left = new JPanel(new FlowLayout(FlowLayout.LEFT, 12, 2)); + private AlphaPanel createFooter() { + AlphaPanel p = new AlphaPanel(new BorderLayout()); + p.setPreferredSize(new Dimension(0, 26)); + p.setBackground(new Color(25, 25, 30)); + p.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, new Color(50, 50, 55))); + + JPanel left = new JPanel(new FlowLayout(FlowLayout.LEFT, 12, 4)); left.setOpaque(false); - statusLabel = new JLabel("● Running Storming Engine 2D"); - statusLabel.setFont(UIUtils.getFont(Font.PLAIN, 11f)); - statusLabel.setForeground(new Color(46, 204, 113)); - left.add(statusLabel); + JLabel stats = new JLabel("60 FPS | 16.6ms | OpenGL 4.5 Core"); + stats.setFont(UIUtils.getFont(Font.PLAIN, 10f)); + stats.setForeground(new Color(150, 150, 150)); + left.add(stats); + p.add(left, BorderLayout.WEST); - JPanel right = new JPanel(new FlowLayout(FlowLayout.RIGHT, 15, 2)); + JPanel right = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 4)); right.setOpaque(false); - fpsLabel = new JLabel("60 FPS | 16.6ms | OpenGL 4.5 Core"); - fpsLabel.setFont(UIUtils.getFont(Font.PLAIN, 11f)); - fpsLabel.setForeground(UIManager.getColor("Label.disabledForeground")); - right.add(fpsLabel); - - footer.add(left, BorderLayout.WEST); - footer.add(right, BorderLayout.EAST); - return footer; + + memLabel = new JLabel("0 / 0 MB"); + memLabel.setFont(UIUtils.getFont(Font.PLAIN, 10f)); + memLabel.setForeground(new Color(150, 150, 150)); + + memBar = new JProgressBar(0, 100); + memBar.setPreferredSize(new Dimension(80, 6)); + memBar.setForeground(new Color(52, 152, 219)); + memBar.setBackground(new Color(40, 40, 45)); + memBar.setBorder(null); + + right.add(memLabel); + right.add(memBar); + right.add(Box.createHorizontalStrut(5)); + p.add(right, BorderLayout.EAST); + + return p; + } + + private void togglePause() { + isPaused = !isPaused; + liveIndicator.setText(isPaused ? "● PAUSED" : "●"); + liveIndicator.setForeground(isPaused ? new Color(241, 196, 15) : new Color(46, 204, 113)); + } + + private void startLivePulse() { + Timer pulse = new Timer(1500, e -> { + if (!isPaused && isShowing()) { + UIAnimator.animate(1.0f, 0.2f, 600, a -> { + Color c = liveIndicator.getForeground(); + liveIndicator.setForeground(new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(a * 255))); + }, () -> { + UIAnimator.animate(0.2f, 1.0f, 600, a -> { + Color c = liveIndicator.getForeground(); + liveIndicator.setForeground(new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(a * 255))); + }, null); + }); + } + }); + pulse.start(); + } + + private void startResourceMonitor() { + Timer monitor = new Timer(2000, e -> { + if (isShowing()) { + Runtime r = Runtime.getRuntime(); + long total = r.totalMemory() / 1024 / 1024; + long used = (r.totalMemory() - r.freeMemory()) / 1024 / 1024; + memLabel.setText(String.format("%d / %d MB", used, total)); + memBar.setValue((int)((double)used / total * 100)); + } + }); + monitor.start(); } private JButton createHeaderBtn(Icon icon, String tip) { JButton btn = new JButton(icon); btn.setToolTipText(tip); btn.putClientProperty(FlatClientProperties.BUTTON_TYPE, FlatClientProperties.BUTTON_TYPE_TOOLBAR_BUTTON); - btn.setPreferredSize(new Dimension(34, 34)); + btn.setPreferredSize(new Dimension(32, 32)); btn.setFocusable(false); return btn; } @@ -165,13 +205,31 @@ private void closeAndStop() { dispose(); } - /** - * Initiates the simulation process and starts the shared memory stream. - */ public void startSimulation() { + header.setAlpha(0.0f); + footer.setAlpha(0.0f); setVisible(true); + + UIAnimator.animate(0.0f, 1.0f, 500, a -> { + header.setAlpha(a); + footer.setAlpha(a); + }, null); + String shmName = "/storming_shm_" + System.currentTimeMillis(); launcher.launch(shmName); viewport.startStreaming(shmName); } + + private static class AlphaPanel extends JPanel { + private float alpha = 1.0f; + public AlphaPanel(LayoutManager layout) { super(layout); } + public void setAlpha(float a) { this.alpha = a; repaint(); } + @Override + public void paint(Graphics g) { + Graphics2D g2 = (Graphics2D) g.create(); + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha)); + super.paint(g2); + g2.dispose(); + } + } } diff --git a/src/main/resources/com/parafield/storming/icons/png/pause.png b/src/main/resources/com/parafield/storming/icons/png/pause.png new file mode 100644 index 0000000000000000000000000000000000000000..21faa7d7272dfdafa665b1f4cbb665c15ff40450 GIT binary patch literal 1905 zcmeHI3saLv6kQS!38OGRN(UdYXvB(vh(K%*lPVDq2#TTz6BETy6~Z$jl*U8^D>&FH zD%c<~YPF?kP#~!U2*QMjpoq{?gCx8hLIi^lA>{FW{aQPn*1yos?9MrRchB9Kopbl* z@1O-6l;Q)NO8UTJS045~F*8*^i0Dz7O z0I383mz2`lotuyi)WOi8Kmf`MS9&8Whm_!b=?EgHkU5dCr2`@MoRDy;y$)?-OR^QI z0+7rA$Du}Z4jtgINO5T_1b{ce+Ye9JfG4cqP4FT45=p+k9s~jj84r3^{Y$`3K6E5L z>q7y7t=bF$6pZ({sVZkt6rD*==fuVNoL78Iy!5F5T0YHoZi^z^Zl%tXR?F0FKlAGX z-HO!vxbMkZT*9@f1mc_p7->hkFkLfap0(Hn=to{g2xrt%Y3tgdBEK)Hrhg9aEh&sq zwoBMueu*#c_Fll>6x4|4!ZEraYaGL{OjEcF{-tBKQ=6cWSC}e=h6J@^D0J5;h(UyK z!%FK)hCZaB4G%w4UKeBGrL)6I?y-nT*lU2TaTz}es}0z9!m44}I^*tYN2vZacB;_L z^yW=0lveEo)j!ftr7MPIrSBGv=fTaR`Wdf+*D@KyAUaI6U@OSOni;C5&-%PyOnIp( zVrT^oGIP%Gin&T20fC|Yg@LYRo?F(D!lLE7kQvVFdb&P(X`Y7 zK6rdl#58L$w`!+9ITM@TZGFNJr&*3=;Z;&Rl(&5{HCB>eVBTMIr8+8ge}Xl%52gOG zJUOFLT}~3$KvWvQO2~Jnv7SBS%vyR@yrZ?P6eREIAuf>;%R3T9yekWto%8oH_%CXF zmJn)KkR1*1`~o#&A>;+#(kKX*WFyYi3a-?<`aST4aH!19i8iT4_CsqiVNXvu^%qGZ zCr_p&H?zI(*gZ+g=Rpnxms`n~6Fn0%LM>D1Gg;_v9F$IJwoai-9O#rWgVEzrSsAu5 zPUKiJ|Ed}VTYzpe8e1{?cJH?V0c8GfF!L-7KR9h3v43`C8r5x`5~4G;sC9Nc;;m8W zloc1J^|xIy-{#C#FzC$R_&@zmze5qWku2(gk82Gd8At3Zm(}unMP0G|LM&x0)EWDy z>!Kb1;X1v@G5Rmp9c1Jff$JL~wlNtAV*aq=MKk)V=X)l3kC(r=hyK(^r*v7XBKVvQ z6Vi!dZLxe7!j;)V&JsShd9}1f9tbq2@%@6z);n*#(q<;9{!6dPFS^~5w9DJEr#x-7 z0`78eq?}kZ{<*%&{KqEg*p338^UF-w&7Go>M0mUwaJ|=f@v5wj+?;poVuJRsIO&96+&SPZi>f2p~nDhyK zmYrAB4?N{J)a*eXyts7SjG|Hf2j#t}3qt)*km8}tJj9#9oVG-24Du<_VX_5Vmt%$Y zF%0sfxeawN&wgOEY1041(S9egMIY1T*swp0*EVv4JE7;=eQmkzW-7Kak>4+y-c%<( z)C#{+F3B(q@H#NtENDh=k>xwN-nXn`Kr@5mSaQ9lSIM>Rbql$D#$tN&t`jX{(^a}c zZ;T=j1zi_MDdi@s!hP&BL5+K&s)gN6ikGkjlBBkbzRQW9Kxfr45RA&(^@$yk&TvNh O4+x>s0`G2N=KKyQL?%Z7 literal 0 HcmV?d00001 diff --git a/src/main/resources/com/parafield/storming/icons/png/restart.png b/src/main/resources/com/parafield/storming/icons/png/restart.png new file mode 100644 index 0000000000000000000000000000000000000000..6661f102b069f72af91c71eaae606558885d07b9 GIT binary patch literal 4732 zcma)AcTm&K*8U~*A`p7-O(PJB1Q0}}1Qcm1gcp$B37|lv6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x=ru};j@M1!V+XO*3!uH_wb+EjP8@;B0QVg1d|&Vo3&f;cKuNmvwj8E5Xic}nbw zLh8dqEJFlOD1Ak^Ukx-z^kWRm^;$^&4g}{YfG+F(jw6{NILqKkrYR9kY%!3T4}^7I zx3?1YW6T5vYks^p-5PX4Ig{4@VB47ToYQ0{$2bAJO+WG7bKy=5 z;&J7h5#{$E=LS{sB0Ev;-+$lYTDYNnzy9PO1V-D%L3~Bbqf5A*1bhA5t+6m63IHBq z$`uW!lM^PReffF@`ouVr<;GXEvK>lsJehU85(~p;iV(n_#X-p@er*J%l(wj<{8jKf z`b8pA6Ksqx%}Y;i`0Us3YIN;yC|VGb1u0>u2jwnAaYk~nrI)A}&xq7hs0g9-vUD5| z%LKMnxemH7$X-by_gb3(){;ll>85YGVtCnGH`5hcCd$^_e;^0ur;dz7`;)^NyC0P1@ed|-4KC|;+z3kvoC@d5TP)z1{&?OKBUK=@I~)3;P#b>T z_ts;^lU>NVy~fgv<}04Mm86f>#`1{zm({lI)oZ8Gm^jDh|`z<$%z{o zyyxer#*xP-m~goX65eaqEgKXW}ZyVnrR|EtyNzzTz}sHPDFzGm&(KQ$ytm{rh?K?0jucgaG$tc09ub z>kAlj?jlr7J}^8MUc(Qqkv_WE8!#*djPZk%+$+-S_}xfiYiLKx;TCirIC7{u*1!3h zM&!E8ebaw}NpCeqcoln_Q(S}wn352=c`1!bjZ(5Zh`g;4D7Md^d_}JPkDZFB!${%J XJ>?Y)`+byF3}C2dtXqBCKKg$E;#$)a literal 0 HcmV?d00001 diff --git a/src/main/resources/com/parafield/storming/icons/svg/pause.svg b/src/main/resources/com/parafield/storming/icons/svg/pause.svg new file mode 100644 index 0000000..3ce93d9 --- /dev/null +++ b/src/main/resources/com/parafield/storming/icons/svg/pause.svg @@ -0,0 +1,7 @@ + + + + + + pause [#ffffff] Created with Sketch. + \ No newline at end of file diff --git a/src/main/resources/com/parafield/storming/icons/svg/restart.svg b/src/main/resources/com/parafield/storming/icons/svg/restart.svg new file mode 100644 index 0000000..7ab9246 --- /dev/null +++ b/src/main/resources/com/parafield/storming/icons/svg/restart.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file