diff --git a/src/net/apocalypselabs/symat/MainGUI.java b/src/net/apocalypselabs/symat/MainGUI.java index 1f0f327..f82dff6 100644 --- a/src/net/apocalypselabs/symat/MainGUI.java +++ b/src/net/apocalypselabs/symat/MainGUI.java @@ -42,6 +42,8 @@ import java.util.Date; import javax.swing.ImageIcon; import javax.swing.JInternalFrame; import javax.swing.ListModel; +import javax.swing.UIManager; +import javax.swing.plaf.ColorUIResource; /** * This class is like the Force: A light theme, a dark theme, and it binds the @@ -744,7 +746,7 @@ public class MainGUI extends javax.swing.JFrame { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); + UIManager.setLookAndFeel(info.getClassName()); break; } } diff --git a/src/net/apocalypselabs/symat/SplashScreen.form b/src/net/apocalypselabs/symat/SplashScreen.form index d163e47..1bc3cb5 100644 --- a/src/net/apocalypselabs/symat/SplashScreen.form +++ b/src/net/apocalypselabs/symat/SplashScreen.form @@ -1,6 +1,6 @@ -
+ @@ -32,6 +32,7 @@ + @@ -54,7 +55,6 @@ - @@ -71,7 +71,7 @@ - + diff --git a/src/net/apocalypselabs/symat/SplashScreen.java b/src/net/apocalypselabs/symat/SplashScreen.java index 2892ad8..27ce660 100644 --- a/src/net/apocalypselabs/symat/SplashScreen.java +++ b/src/net/apocalypselabs/symat/SplashScreen.java @@ -27,8 +27,15 @@ */ package net.apocalypselabs.symat; +import java.awt.Color; +import java.awt.Graphics2D; import javax.swing.ImageIcon; +import javax.swing.JProgressBar; +import javax.swing.Painter; import javax.swing.SwingUtilities; +import javax.swing.UIDefaults; +import javax.swing.UIManager; +import javax.swing.plaf.ColorUIResource; /** * @@ -41,10 +48,36 @@ public class SplashScreen extends javax.swing.JFrame { */ public SplashScreen() { initComponents(); - setIconImage((new ImageIcon(getClass().getResource("icon.png"))).getImage()); + UIDefaults defaults = new UIDefaults(); + defaults.put("ProgressBar[Enabled].backgroundPainter", new ProgressPainter(false)); + defaults.put("ProgressBar[Enabled].foregroundPainter", new ProgressPainter(true)); + progBar.putClientProperty("Nimbus.Overrides.InheritDefaults", Boolean.TRUE); + progBar.putClientProperty("Nimbus.Overrides", defaults); + + setIconImage((new ImageIcon( + getClass().getResource("icon.png"))).getImage()); setLocationRelativeTo(null); } + class ProgressPainter implements Painter { + + private final Color color; + + public ProgressPainter(boolean foreground) { + if (foreground) { + this.color = new Color(86, 161, 243); + } else { + this.color = new Color(59, 127, 243); + } + } + + @Override + public void paint(Graphics2D gd, JProgressBar t, int width, int height) { + gd.setColor(color); + gd.fillRect(0, 0, width, height); + } + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -69,14 +102,13 @@ public class SplashScreen extends javax.swing.JFrame { } }); - progBar.setIndeterminate(true); progBar.setMaximumSize(new java.awt.Dimension(32767, 20)); progBar.setMinimumSize(new java.awt.Dimension(10, 20)); progBar.setPreferredSize(new java.awt.Dimension(146, 20)); progBar.setString(""); progBar.setStringPainted(true); - jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/anim-splash.gif"))); // NOI18N + jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/splash.gif"))); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); @@ -125,7 +157,7 @@ public class SplashScreen extends javax.swing.JFrame { // Get editor going too CodeEditor edit = new CodeEditor(); } - + setProgress(85, "Loading main interface..."); new MainGUI().setVisible(true); setProgress(100, "Done!"); diff --git a/src/net/apocalypselabs/symat/splash.gif b/src/net/apocalypselabs/symat/splash.gif new file mode 100644 index 0000000..5a0aa32 Binary files /dev/null and b/src/net/apocalypselabs/symat/splash.gif differ