JAL-3310 JAL-3300 two getdown fixes merged
authorBen Soares <bsoares@dundee.ac.uk>
Mon, 17 Jun 2019 19:15:00 +0000 (20:15 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Mon, 17 Jun 2019 19:15:00 +0000 (20:15 +0100)
12 files changed:
build.gradle
getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/Config.java
getdown/src/getdown/launcher/pom.xml
getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java
getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java
getdown/src/getdown/pom.xml
j11lib/getdown-core.jar
j8lib/getdown-core.jar
src/jalview/bin/MemorySetting.java
src/jalview/jbgui/GCutAndPasteHtmlTransfer.java

index 9f00d2b..9aedd2f 100644 (file)
@@ -97,6 +97,19 @@ if (JAVA_VERSION.equals("1.8")) {
     '--module-path', ext.modules_compileClasspath.asPath,
     '--add-modules', j11modules
   ]
+} else if (JAVA_VERSION.equals("12") || JAVA_VERSION.equals("13")) {
+  JAVA_INTEGER_VERSION = JAVA_VERSION
+  libDir = j11libDir
+  libDistDir = j11libDir
+  compile_source_compatibility = JAVA_VERSION
+  compile_target_compatibility = JAVA_VERSION
+  getdown_alt_java_min_version = getdown_alt_java11_min_version
+  getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location
+  eclipse_java_runtime_name = "JavaSE-11"
+  additional_compiler_args += [
+    '--module-path', ext.modules_compileClasspath.asPath,
+    '--add-modules', j11modules
+  ]
 } else {
   throw new GradleException("JAVA_VERSION=$JAVA_VERSION not currently supported by Jalview")
 }
index 0c41ec2..bbeb351 100644 (file)
Binary files a/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar and b/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar differ
index bf83b3b..6323dc9 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index e20bae2..6ad2b4f 100644 (file)
@@ -436,8 +436,8 @@ public class Config
         } else if (allowedReplaceKeys.contains(mkey)){
           
           // replace value
-          
           _data.put(key, nvalue);
+          
         } else {
           log.warning("Not merging key '"+key+"' into config");
         }
index 10e1aa6..e77061a 100644 (file)
@@ -40,6 +40,7 @@
 
   <build>
     <plugins>
+      <!--
       <plugin>
         <groupId>com.github.wvengen</groupId>
         <artifactId>proguard-maven-plugin</artifactId>
           <addMavenDescriptor>false</addMavenDescriptor>
         </configuration>
       </plugin>
-
+      -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
             <goals>
               <goal>shade</goal>
             </goals>
+            <!--
+            <configuration>
+              <minimizeJar>true</minimizeJar>
+              <filters>
+                <filter>
+                  <artifact>install4j-runtime</artifact>
+                  <includes>
+                    <include>**</include>
+                  </includes>
+                </filter>
+              </filters>
+            </configuration>
+            -->
           </execution>
         </executions>
       </plugin>
index 539b47e..5750fce 100644 (file)
@@ -9,6 +9,7 @@ import java.awt.BorderLayout;
 import java.awt.Container;
 import java.awt.Dimension;
 import java.awt.EventQueue;
+import java.awt.Graphics;
 import java.awt.GraphicsEnvironment;
 import java.awt.Image;
 import java.awt.event.ActionEvent;
@@ -32,6 +33,7 @@ import javax.swing.AbstractAction;
 import javax.swing.JButton;
 import javax.swing.JFrame;
 import javax.swing.JLayeredPane;
+import javax.swing.JPanel;
 
 import com.samskivert.swing.util.SwingUtil;
 import com.threerings.getdown.data.*;
@@ -748,9 +750,10 @@ public abstract class Getdown extends Thread
         if (_silent || (_container != null && !reinit)) {
             return;
         }
-
+/*
         EventQueue.invokeLater(new Runnable() {
             public void run () {
+*/
                 if (_container == null || reinit) {
                     if (_container == null) {
                         _container = createContainer();
@@ -759,6 +762,42 @@ public abstract class Getdown extends Thread
                     }
                     configureContainer();
                     _layers = new JLayeredPane();
+                    
+                    
+                    
+                    // added in the instant display of a splashscreen
+                    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));
+                    } catch (Exception e) {
+                      log.warning("Failed to set instant background image", "bg", _ifc.backgroundImage);
+                    }
+
+                    
+                    
                     _container.add(_layers, BorderLayout.CENTER);
                     _patchNotes = new JButton(new AbstractAction(_msgs.getString("m.patch_notes")) {
                         @Override public void actionPerformed (ActionEvent event) {
@@ -768,12 +807,14 @@ public abstract class Getdown extends Thread
                     _patchNotes.setFont(StatusPanel.FONT);
                     _layers.add(_patchNotes);
                     _status = new StatusPanel(_msgs);
-                    _layers.add(_status);
+                    _layers.add(_status, Integer.valueOf(10));
                     initInterface();
                 }
                 showContainer();
+/*
             }
         });
+*/
     }
 
     /**
@@ -804,13 +845,12 @@ public abstract class Getdown extends Thread
 
     protected RotatingBackgrounds getBackground ()
     {
-        if (_ifc.rotatingBackgrounds != null) {
+        if (_ifc.rotatingBackgrounds != null && _ifc.rotatingBackgrounds.size() > 0) {
             if (_ifc.backgroundImage != null) {
                 log.warning("ui.background_image and ui.rotating_background were both specified. " +
                             "The background image is being used.");
             }
-            return new RotatingBackgrounds(loadImage(_ifc.backgroundImage));
-            //return new RotatingBackgrounds(_ifc.rotatingBackgrounds, _ifc.errorBackground, Getdown.this);
+            return new RotatingBackgrounds(_ifc.rotatingBackgrounds, _ifc.errorBackground, Getdown.this);
         } else if (_ifc.backgroundImage != null) {
             return new RotatingBackgrounds(loadImage(_ifc.backgroundImage));
         } else {
@@ -1044,6 +1084,7 @@ public abstract class Getdown extends Thread
     protected ResourceBundle _msgs;
     protected Container _container;
     protected JLayeredPane _layers;
+    protected JPanel instantSplashPane;
     protected StatusPanel _status;
     protected JButton _patchNotes;
     protected AbortPanel _abort;
index 799fa96..2d19089 100644 (file)
@@ -163,7 +163,7 @@ public class GetdownApp
           log.warning("Failed to set background", "bg", _ifc.background, e);
         }
 
-        if (_ifc.iconImages != null) {
+        if (_ifc.iconImages != null && _ifc.iconImages.size() > 0) {
           ArrayList<Image> icons = new ArrayList<>();
           for (String path : _ifc.iconImages) {
             Image img = loadImage(path);
index e2f1ead..78d67b0 100644 (file)
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
-          <version>3.7.0</version>
+          <version>3.8.1</version>
           <configuration>
-            <source>1.7</source>
-            <target>1.7</target>
+            <source>1.8</source>
+            <target>1.8</target>
             <fork>true</fork>
             <showDeprecation>true</showDeprecation>
             <showWarnings>true</showWarnings>
index 0c41ec2..bbeb351 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index 0c41ec2..bbeb351 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ
index b3bae2d..c8bc222 100644 (file)
@@ -24,7 +24,7 @@ public class MemorySetting
     } catch (NoClassDefFoundError e)
     {
       // com.sun.management.OperatingSystemMXBean doesn't exist in this JVM
-      System.out.println("No com.sun.management.OperatingSystemMXBean");
+      Cache.log.error("No com.sun.management.OperatingSystemMXBean");
     }
 
     // We didn't get a com.sun.management.OperatingSystemMXBean.
index 3f0df21..1c9e907 100644 (file)
@@ -22,7 +22,6 @@ package jalview.jbgui;
 
 import jalview.gui.JvSwingUtils;
 import jalview.util.MessageManager;
-import jalview.util.ShortcutKeyMaskExWrapper;
 
 import java.awt.BorderLayout;
 import java.awt.Font;
@@ -136,11 +135,15 @@ public class GCutAndPasteHtmlTransfer extends JInternalFrame
     });
     close.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
             java.awt.event.KeyEvent.VK_W,
-            ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false));
+            jalview.util.ShortcutKeyMaskExWrapper
+                    .getMenuShortcutKeyMaskEx(),
+            false));
     selectAll.setText(MessageManager.getString("action.select_all"));
     selectAll.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
             java.awt.event.KeyEvent.VK_A,
-            ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false));
+            jalview.util.ShortcutKeyMaskExWrapper
+                    .getMenuShortcutKeyMaskEx(),
+            false));
     selectAll.addActionListener(new ActionListener()
     {
       @Override
@@ -153,7 +156,9 @@ public class GCutAndPasteHtmlTransfer extends JInternalFrame
     save.setText(MessageManager.getString("action.save"));
     save.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
             java.awt.event.KeyEvent.VK_S,
-            ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false));
+            jalview.util.ShortcutKeyMaskExWrapper
+                    .getMenuShortcutKeyMaskEx(),
+            false));
     save.addActionListener(new ActionListener()
     {
       @Override
@@ -164,7 +169,9 @@ public class GCutAndPasteHtmlTransfer extends JInternalFrame
     });
     copyItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
             java.awt.event.KeyEvent.VK_C,
-            ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false));
+            jalview.util.ShortcutKeyMaskExWrapper
+                    .getMenuShortcutKeyMaskEx(),
+            false));
 
     editMenubar.add(jMenu1);
     editMenubar.add(editMenu);