From cbe8877688ba73d591239cf9a654eb2582f771b8 Mon Sep 17 00:00:00 2001 From: hansonr Date: Wed, 25 Jul 2018 02:08:29 -0500 Subject: [PATCH] merged --- src/jalview/jbgui/GAlignFrame.java | 37 ++++++++++------ src/jalview/jbgui/GDesktop.java | 83 ++++++++++++++++++------------------ 2 files changed, 66 insertions(+), 54 deletions(-) diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index a83c688..3a6e603 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -23,6 +23,7 @@ package jalview.jbgui; import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder; import jalview.api.SplitContainerI; import jalview.bin.Cache; +import jalview.bin.Jalview; import jalview.gui.JvSwingUtils; import jalview.gui.Preferences; import jalview.io.FileFormats; @@ -169,7 +170,7 @@ public class GAlignFrame extends JInternalFrame protected JCheckBoxMenuItem hiddenMarkers = new JCheckBoxMenuItem(); - protected JTabbedPane tabbedPane = jalview.jbgui.swing.JTabbedPane.createTabbedPane(); + protected JTabbedPane tabbedPane = jalview.jbgui.GDesktop.createTabbedPane(); protected JMenuItem reload = new JMenuItem(); @@ -1716,7 +1717,10 @@ public class GAlignFrame extends JInternalFrame alignFrameMenuBar.add(formatMenu); alignFrameMenuBar.add(colourMenu); alignFrameMenuBar.add(calculateMenu); - alignFrameMenuBar.add(webService); + if (!Jalview.isJS()) + { + alignFrameMenuBar.add(webService); + } fileMenu.add(fetchSequence); fileMenu.add(addSequenceMenu); @@ -1734,10 +1738,7 @@ public class GAlignFrame extends JInternalFrame fileMenu.add(exportAnnotations); fileMenu.add(loadTreeMenuItem); fileMenu.add(associatedData); - /* - * No VCF import in Jalview-JS - * @j2sNative - */ + if (!Jalview.isJS()) { fileMenu.add(loadVcf); } @@ -1774,8 +1775,11 @@ public class GAlignFrame extends JInternalFrame hideMenu.add(hideAllSelection); hideMenu.add(hideAllButSelection); viewMenu.add(newView); - viewMenu.add(expandViews); - viewMenu.add(gatherViews); + if (!Jalview.isJS()) + { + viewMenu.add(expandViews); + viewMenu.add(gatherViews); + } viewMenu.addSeparator(); viewMenu.add(showMenu); viewMenu.add(hideMenu); @@ -1835,17 +1839,26 @@ public class GAlignFrame extends JInternalFrame calculateMenu.addSeparator(); calculateMenu.add(expandAlignment); calculateMenu.add(extractScores); - calculateMenu.addSeparator(); - calculateMenu.add(runGroovy); + if (!Jalview.isJS()) + { + calculateMenu.addSeparator(); + calculateMenu.add(runGroovy); + } webServiceNoServices = new JMenuItem( MessageManager.getString("label.no_services")); webService.add(webServiceNoServices); - exportImageMenu.add(htmlMenuItem); + if (!Jalview.isJS()) + { + exportImageMenu.add(htmlMenuItem); + } exportImageMenu.add(epsFile); exportImageMenu.add(createPNG); exportImageMenu.add(createBioJS); - exportImageMenu.add(createSVG); + if (!Jalview.isJS()) + { + exportImageMenu.add(createSVG); + } addSequenceMenu.add(addFromFile); addSequenceMenu.add(addFromText); addSequenceMenu.add(addFromURL); diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index 11a558c..4b4d28d 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -21,6 +21,7 @@ package jalview.jbgui; import jalview.api.AlignmentViewPanel; +import jalview.bin.Jalview; import jalview.io.FileFormatException; import jalview.util.MessageManager; import jalview.util.Platform; @@ -44,6 +45,23 @@ import javax.swing.JMenuItem; */ public class GDesktop extends JFrame { + + public static javax.swing.JTabbedPane createTabbedPane() + { + // now just always return JTabbedPane + return new javax.swing.JTabbedPane(); +// // BH 2018 coercing jalview.jbgui.swing.JTabbedPane() for now +// if (/** @j2sNative false && */ +// true) +// { +// // Java +// return new javax.swing.JTabbedPane(); +// } +// // JavaScript +// return (javax.swing.JTabbedPane) (Object) new jalview.jbgui.swing.JTabbedPane(); + } + + protected static JMenu windowMenu = new JMenu(); JMenuBar desktopMenubar = new JMenuBar(); @@ -225,7 +243,7 @@ public class GDesktop extends JFrame @Override public void actionPerformed(ActionEvent e) { - documentationMenuItem_actionPerformed(e); + documentationMenuItem_actionPerformed(); } }); this.getContentPane().setLayout(flowLayout1); @@ -246,7 +264,7 @@ public class GDesktop extends JFrame @Override public void actionPerformed(ActionEvent e) { - saveState_actionPerformed(e); + saveState_actionPerformed(); } }); loadState.setText(MessageManager.getString("action.load_project")); @@ -255,7 +273,7 @@ public class GDesktop extends JFrame @Override public void actionPerformed(ActionEvent e) { - loadState_actionPerformed(e); + loadState_actionPerformed(); } }); inputMenu.setText(MessageManager.getString("label.input_alignment")); @@ -423,9 +441,12 @@ public class GDesktop extends JFrame desktopMenubar.add(windowMenu); FileMenu.add(inputMenu); FileMenu.add(inputSequence); - FileMenu.addSeparator(); - FileMenu.add(saveState); - FileMenu.add(loadState); + if (!Jalview.isJS()) + { + FileMenu.addSeparator(); + FileMenu.add(saveState); + FileMenu.add(loadState); + } FileMenu.addSeparator(); FileMenu.add(quit); HelpMenu.add(aboutMenuItem); @@ -437,11 +458,17 @@ public class GDesktop extends JFrame VamsasMenu.add(vamsasSave); VamsasMenu.add(vamsasStop); toolsMenu.add(preferences); - toolsMenu.add(showMemusage); - toolsMenu.add(showConsole); - toolsMenu.add(showNews); - toolsMenu.add(garbageCollect); - toolsMenu.add(groovyShell); + if (!Jalview.isJS()) + { + toolsMenu.add(showMemusage); + toolsMenu.add(showConsole); + } + if (!Jalview.isJS()) + { + toolsMenu.add(showNews); + toolsMenu.add(garbageCollect); + toolsMenu.add(groovyShell); + } toolsMenu.add(experimentalFeatures); // toolsMenu.add(snapShotWindow); inputMenu.add(inputLocalFileMenuItem); @@ -551,13 +578,7 @@ public class GDesktop extends JFrame { } - /** - * DOCUMENT ME! - * - * @param e - * DOCUMENT ME! - */ - protected void documentationMenuItem_actionPerformed(ActionEvent e) + protected void documentationMenuItem_actionPerformed() { } @@ -581,33 +602,11 @@ public class GDesktop extends JFrame { } - /** - * DOCUMENT ME! - * - * @param e - * DOCUMENT ME! - */ - public void saveState_actionPerformed(ActionEvent e) - { - } - - /** - * DOCUMENT ME! - * - * @param e - * DOCUMENT ME! - */ - public void loadState_actionPerformed(ActionEvent e) + public void saveState_actionPerformed() { } - /** - * DOCUMENT ME! - * - * @param e - * DOCUMENT ME! - */ - public void loadJalviewAlign_actionPerformed(ActionEvent e) + public void loadState_actionPerformed() { } -- 1.7.10.2