JAL-3322 New progress bar. Added option to report appbase in launcher window. Added...
[jalview.git] / getdown / src / getdown / launcher / src / main / java / com / threerings / getdown / launcher / Getdown.java
index d82ed15..fc3cfbd 100644 (file)
@@ -231,6 +231,7 @@ public abstract class Getdown extends Thread
         Config config = _app.init(true);
         if (preloads) doPredownloads(_app.getResources());
         _ifc = new Application.UpdateInterface(config);
+        _status.setAppbase(_app.getAppbase());
     }
 
     /**
@@ -702,7 +703,7 @@ public abstract class Getdown extends Thread
                 } else {
                     proc = _app.createProcess(false);
                 }
-
+                
                 // close standard in to avoid choking standard out of the launched process
                 proc.getInputStream().close();
                 // close standard out, since we're not going to write to anything to it anyway
@@ -731,6 +732,9 @@ public abstract class Getdown extends Thread
                 }
             }
 
+            _container.setVisible(true);
+            _container.validate();
+
             // if we have a UI open and we haven't been around for at least 5 seconds (the default
             // for min_show_seconds), don't stick a fork in ourselves straight away but give our
             // lovely user a chance to see what we're doing
@@ -782,34 +786,41 @@ public abstract class Getdown extends Thread
                     try {
                       readConfig(false);
                       Graphics g = _container.getGraphics();
-                      String imageFile = _ifc.backgroundImage;
-                      BufferedImage bgImage = loadImage(_ifc.backgroundImage);
-                      int bwidth = bgImage.getWidth();
-                      int bheight = bgImage.getHeight();
-
-                      instantSplashPane = new JPanel() {
-                        @Override
-                        protected void paintComponent(Graphics g)
-                        {
-                          super.paintComponent(g);
-                          // attempt to draw a background image...
-                          if (bgImage != null) {
-                            g.drawImage(bgImage, 0, 0, this);
-                          }
-                        }
-                      };
-
-                      instantSplashPane.setSize(bwidth,bheight);
-                      instantSplashPane.setPreferredSize(new Dimension(bwidth,bheight));
-
-                      _layers.add(instantSplashPane, Integer.valueOf(0));
-                    
-                      _container.setPreferredSize(new Dimension(bwidth,bheight));
+                      BufferedImage iBgImage = loadImage(_ifc.instantBackgroundImage);
+                      boolean ibg = true;
+                      if (iBgImage == null) {
+                         iBgImage = loadImage(_ifc.backgroundImage);
+                         ibg = false;
+                      }
+                      if (iBgImage != null) {
+                                                 final BufferedImage bgImage = iBgImage;
+                                                 int bwidth = bgImage.getWidth();
+                                                 int bheight = bgImage.getHeight();
+                                                 
+                                                 log.info("Displaying instant background image", ibg?"instant_background_image":"background_image");
+
+                                                 instantSplashPane = new JPanel() {
+                                                       @Override
+                                                       protected void paintComponent(Graphics g)
+                                                       {
+                                                         super.paintComponent(g);
+                                                         // attempt to draw a background image...
+                                                         if (bgImage != null) {
+                                                               g.drawImage(bgImage, 0, 0, this);
+                                                         }
+                                                       }
+                                                 };
+
+                                                 instantSplashPane.setSize(bwidth,bheight);
+                                                 instantSplashPane.setPreferredSize(new Dimension(bwidth,bheight));
+
+                                                 _layers.add(instantSplashPane, Integer.valueOf(0));
+                                               
+                                                 _container.setPreferredSize(new Dimension(bwidth,bheight));
+                      }
                     } catch (Exception e) {
-                      log.warning("Failed to set instant background image", "bg", _ifc.backgroundImage);
+                      log.warning("Failed to set instant background image", "ibg", _ifc.instantBackgroundImage);
                     }
-
-                    
                     
                     _container.add(_layers, BorderLayout.CENTER);
                     _patchNotes = new JButton(new AbstractAction(_msgs.getString("m.patch_notes")) {
@@ -844,6 +855,7 @@ public abstract class Getdown extends Thread
         _status.init(_ifc, _background, getProgressImage());
         Dimension size = _status.getPreferredSize();
         _status.setSize(size);
+        //_status.updateStatusLabel();
         _layers.setPreferredSize(size);
 
         _patchNotes.setBounds(_ifc.patchNotes.x, _ifc.patchNotes.y,