JAL-4113 belt and braces demo of Jalview MSA view in a JavaFX swing node window spikes/JAL-4113_javafx_with_Jalview_MSA
authorJim Procter <j.procter@dundee.ac.uk>
Wed, 11 Jan 2023 13:53:08 +0000 (13:53 +0000)
committerJim Procter <j.procter@dundee.ac.uk>
Wed, 11 Jan 2023 13:53:08 +0000 (13:53 +0000)
33 files changed:
j11lib/javafx-dylibs.jar [new file with mode: 0644]
j11lib/javafx-swt.jar [new file with mode: 0644]
j11lib/javafx.base.jar [new file with mode: 0644]
j11lib/javafx.controls.jar [new file with mode: 0644]
j11lib/javafx.fxml.jar [new file with mode: 0644]
j11lib/javafx.graphics.jar [new file with mode: 0644]
j11lib/javafx.media.jar [new file with mode: 0644]
j11lib/javafx.properties [new file with mode: 0644]
j11lib/javafx.swing.jar [new file with mode: 0644]
j11lib/javafx.web.jar [new file with mode: 0644]
j11lib/libdecora_sse.dylib [new file with mode: 0755]
j11lib/libfxplugins.dylib [new file with mode: 0755]
j11lib/libglass.dylib [new file with mode: 0755]
j11lib/libglib-lite.dylib [new file with mode: 0755]
j11lib/libgstreamer-lite.dylib [new file with mode: 0755]
j11lib/libjavafx_font.dylib [new file with mode: 0755]
j11lib/libjavafx_iio.dylib [new file with mode: 0755]
j11lib/libjfxmedia.dylib [new file with mode: 0755]
j11lib/libjfxmedia_avf.dylib [new file with mode: 0755]
j11lib/libjfxwebkit.dylib [new file with mode: 0755]
j11lib/libprism_common.dylib [new file with mode: 0755]
j11lib/libprism_es2.dylib [new file with mode: 0755]
j11lib/libprism_sw.dylib [new file with mode: 0755]
j11mod/javafx-dylibs.jar [new file with mode: 0644]
j11mod/javafx-swt.jar [new file with mode: 0644]
j11mod/javafx.base.jar [new file with mode: 0644]
j11mod/javafx.controls.jar [new file with mode: 0644]
j11mod/javafx.fxml.jar [new file with mode: 0644]
j11mod/javafx.graphics.jar [new file with mode: 0644]
j11mod/javafx.media.jar [new file with mode: 0644]
j11mod/javafx.swing.jar [new file with mode: 0644]
j11mod/javafx.web.jar [new file with mode: 0644]
src/jalview/bin/JalviewFX.java [new file with mode: 0644]

diff --git a/j11lib/javafx-dylibs.jar b/j11lib/javafx-dylibs.jar
new file mode 100644 (file)
index 0000000..492202c
Binary files /dev/null and b/j11lib/javafx-dylibs.jar differ
diff --git a/j11lib/javafx-swt.jar b/j11lib/javafx-swt.jar
new file mode 100644 (file)
index 0000000..b98c908
Binary files /dev/null and b/j11lib/javafx-swt.jar differ
diff --git a/j11lib/javafx.base.jar b/j11lib/javafx.base.jar
new file mode 100644 (file)
index 0000000..436357c
Binary files /dev/null and b/j11lib/javafx.base.jar differ
diff --git a/j11lib/javafx.controls.jar b/j11lib/javafx.controls.jar
new file mode 100644 (file)
index 0000000..e5ad830
Binary files /dev/null and b/j11lib/javafx.controls.jar differ
diff --git a/j11lib/javafx.fxml.jar b/j11lib/javafx.fxml.jar
new file mode 100644 (file)
index 0000000..89330dc
Binary files /dev/null and b/j11lib/javafx.fxml.jar differ
diff --git a/j11lib/javafx.graphics.jar b/j11lib/javafx.graphics.jar
new file mode 100644 (file)
index 0000000..1768c6d
Binary files /dev/null and b/j11lib/javafx.graphics.jar differ
diff --git a/j11lib/javafx.media.jar b/j11lib/javafx.media.jar
new file mode 100644 (file)
index 0000000..35e1abe
Binary files /dev/null and b/j11lib/javafx.media.jar differ
diff --git a/j11lib/javafx.properties b/j11lib/javafx.properties
new file mode 100644 (file)
index 0000000..5496314
--- /dev/null
@@ -0,0 +1,3 @@
+javafx.version=19
+javafx.runtime.version=19+11
+javafx.runtime.build=11
diff --git a/j11lib/javafx.swing.jar b/j11lib/javafx.swing.jar
new file mode 100644 (file)
index 0000000..03b7880
Binary files /dev/null and b/j11lib/javafx.swing.jar differ
diff --git a/j11lib/javafx.web.jar b/j11lib/javafx.web.jar
new file mode 100644 (file)
index 0000000..5fb0cfb
Binary files /dev/null and b/j11lib/javafx.web.jar differ
diff --git a/j11lib/libdecora_sse.dylib b/j11lib/libdecora_sse.dylib
new file mode 100755 (executable)
index 0000000..4c1fd81
Binary files /dev/null and b/j11lib/libdecora_sse.dylib differ
diff --git a/j11lib/libfxplugins.dylib b/j11lib/libfxplugins.dylib
new file mode 100755 (executable)
index 0000000..dbb2c0a
Binary files /dev/null and b/j11lib/libfxplugins.dylib differ
diff --git a/j11lib/libglass.dylib b/j11lib/libglass.dylib
new file mode 100755 (executable)
index 0000000..59c2894
Binary files /dev/null and b/j11lib/libglass.dylib differ
diff --git a/j11lib/libglib-lite.dylib b/j11lib/libglib-lite.dylib
new file mode 100755 (executable)
index 0000000..f523c94
Binary files /dev/null and b/j11lib/libglib-lite.dylib differ
diff --git a/j11lib/libgstreamer-lite.dylib b/j11lib/libgstreamer-lite.dylib
new file mode 100755 (executable)
index 0000000..08fc88c
Binary files /dev/null and b/j11lib/libgstreamer-lite.dylib differ
diff --git a/j11lib/libjavafx_font.dylib b/j11lib/libjavafx_font.dylib
new file mode 100755 (executable)
index 0000000..43b76b4
Binary files /dev/null and b/j11lib/libjavafx_font.dylib differ
diff --git a/j11lib/libjavafx_iio.dylib b/j11lib/libjavafx_iio.dylib
new file mode 100755 (executable)
index 0000000..d486063
Binary files /dev/null and b/j11lib/libjavafx_iio.dylib differ
diff --git a/j11lib/libjfxmedia.dylib b/j11lib/libjfxmedia.dylib
new file mode 100755 (executable)
index 0000000..fedb404
Binary files /dev/null and b/j11lib/libjfxmedia.dylib differ
diff --git a/j11lib/libjfxmedia_avf.dylib b/j11lib/libjfxmedia_avf.dylib
new file mode 100755 (executable)
index 0000000..fc73b0e
Binary files /dev/null and b/j11lib/libjfxmedia_avf.dylib differ
diff --git a/j11lib/libjfxwebkit.dylib b/j11lib/libjfxwebkit.dylib
new file mode 100755 (executable)
index 0000000..175e6fb
Binary files /dev/null and b/j11lib/libjfxwebkit.dylib differ
diff --git a/j11lib/libprism_common.dylib b/j11lib/libprism_common.dylib
new file mode 100755 (executable)
index 0000000..e0d46d0
Binary files /dev/null and b/j11lib/libprism_common.dylib differ
diff --git a/j11lib/libprism_es2.dylib b/j11lib/libprism_es2.dylib
new file mode 100755 (executable)
index 0000000..8615601
Binary files /dev/null and b/j11lib/libprism_es2.dylib differ
diff --git a/j11lib/libprism_sw.dylib b/j11lib/libprism_sw.dylib
new file mode 100755 (executable)
index 0000000..b59d5ea
Binary files /dev/null and b/j11lib/libprism_sw.dylib differ
diff --git a/j11mod/javafx-dylibs.jar b/j11mod/javafx-dylibs.jar
new file mode 100644 (file)
index 0000000..492202c
Binary files /dev/null and b/j11mod/javafx-dylibs.jar differ
diff --git a/j11mod/javafx-swt.jar b/j11mod/javafx-swt.jar
new file mode 100644 (file)
index 0000000..b98c908
Binary files /dev/null and b/j11mod/javafx-swt.jar differ
diff --git a/j11mod/javafx.base.jar b/j11mod/javafx.base.jar
new file mode 100644 (file)
index 0000000..436357c
Binary files /dev/null and b/j11mod/javafx.base.jar differ
diff --git a/j11mod/javafx.controls.jar b/j11mod/javafx.controls.jar
new file mode 100644 (file)
index 0000000..e5ad830
Binary files /dev/null and b/j11mod/javafx.controls.jar differ
diff --git a/j11mod/javafx.fxml.jar b/j11mod/javafx.fxml.jar
new file mode 100644 (file)
index 0000000..89330dc
Binary files /dev/null and b/j11mod/javafx.fxml.jar differ
diff --git a/j11mod/javafx.graphics.jar b/j11mod/javafx.graphics.jar
new file mode 100644 (file)
index 0000000..1768c6d
Binary files /dev/null and b/j11mod/javafx.graphics.jar differ
diff --git a/j11mod/javafx.media.jar b/j11mod/javafx.media.jar
new file mode 100644 (file)
index 0000000..35e1abe
Binary files /dev/null and b/j11mod/javafx.media.jar differ
diff --git a/j11mod/javafx.swing.jar b/j11mod/javafx.swing.jar
new file mode 100644 (file)
index 0000000..03b7880
Binary files /dev/null and b/j11mod/javafx.swing.jar differ
diff --git a/j11mod/javafx.web.jar b/j11mod/javafx.web.jar
new file mode 100644 (file)
index 0000000..5fb0cfb
Binary files /dev/null and b/j11mod/javafx.web.jar differ
diff --git a/src/jalview/bin/JalviewFX.java b/src/jalview/bin/JalviewFX.java
new file mode 100644 (file)
index 0000000..3bf7d9d
--- /dev/null
@@ -0,0 +1,56 @@
+package jalview.bin;
+
+import java.awt.Dimension;
+
+import javax.swing.JButton;
+import javax.swing.SwingUtilities;
+
+import jalview.gui.AlignFrame;
+import jalview.io.DataSourceType;
+import jalview.io.FileLoader;
+import javafx.application.Application;
+import javafx.embed.swing.SwingNode;
+import javafx.scene.Scene;
+import javafx.scene.layout.StackPane;
+import javafx.stage.Stage;
+
+public class JalviewFX extends Application {
+
+  @Override
+  public void start(Stage stage) {
+    // load an alignment   
+    af = new FileLoader(false).LoadFileWaitTillLoaded("examples/uniref50.fa", DataSourceType.FILE);
+    // we may need to wait around because of some concurrency issues
+    //while (af==null) {
+    //  try { Thread.sleep(50); } catch (InterruptedException x) {}
+    //  
+    //}
+    af.setPreferredSize(new Dimension(800,550));
+      final SwingNode swingNode = new SwingNode();
+      createAndSetSwingContent(swingNode);
+
+      StackPane pane = new StackPane();
+      pane.getChildren().add(swingNode);
+
+      stage.setScene(new Scene(pane, 800, 550));
+      stage.show();
+  }
+  AlignFrame af=null;
+  private void createAndSetSwingContent(final SwingNode swingNode) {
+    
+      SwingUtilities.invokeLater(new Runnable() {
+          @Override
+          public void run() {
+            // just show the alignment panel - mouse events are handled but no keyboard events 
+            swingNode.setContent((jalview.gui.AlignmentPanel)af.getAlignPanels().get(0));
+            // alternatively this shows the whole alignment window - properly handles keyboard events
+            //            swingNode.setContent(af);
+            //            af.setVisible(true);
+          }
+      });
+  }
+
+  public static void main(String[] args) {
+      launch(args);
+  }
+}
\ No newline at end of file