From 6d35ae6c809d36b2e2fa984436134dbff712a377 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 20 Aug 2018 10:32:14 +0100 Subject: [PATCH] JAL-3084 hide startup file, Chimera, HTML/SVG, Web Services options/tab in JalviewJS --- src/jalview/gui/Preferences.java | 21 +++++++++++++----- src/jalview/jbgui/GPreferences.java | 42 +++++++++++++++++++++++++++++------ 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index 31842e4..6271ba9 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -22,6 +22,7 @@ package jalview.gui; import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder; import jalview.bin.Cache; +import jalview.bin.Jalview; import jalview.gui.Help.HelpId; import jalview.gui.StructureViewer.ViewerType; import jalview.io.FileFormatI; @@ -188,10 +189,12 @@ public class Preferences extends GPreferences super(); frame = new JInternalFrame(); frame.setContentPane(this); - wsPrefs = new WsPreferences(); - wsTab.add(wsPrefs, BorderLayout.CENTER); + if (!Jalview.isJS()) + { + wsPrefs = new WsPreferences(); + wsTab.add(wsPrefs, BorderLayout.CENTER); + } int width = 500, height = 450; - new jalview.util.Platform(); if (Platform.isAMac()) { width = 570; @@ -813,7 +816,10 @@ public class Preferences extends GPreferences Cache.applicationProperties.setProperty("PAD_GAPS", Boolean.toString(padGaps.isSelected())); - wsPrefs.updateAndRefreshWsMenuConfig(false); + if (!Jalview.isJS()) + { + wsPrefs.updateAndRefreshWsMenuConfig(false); + } Cache.saveProperties(); Desktop.instance.doConfigureStructurePrefs(); try @@ -887,8 +893,11 @@ public class Preferences extends GPreferences { try { - wsPrefs.updateWsMenuConfig(true); - wsPrefs.refreshWs_actionPerformed(e); + if (!Jalview.isJS()) + { + wsPrefs.updateWsMenuConfig(true); + wsPrefs.refreshWs_actionPerformed(e); + } frame.setClosed(true); } catch (Exception ex) { diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index 4d8272b..351a030 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -20,6 +20,7 @@ */ package jalview.jbgui; +import jalview.bin.Jalview; import jalview.fts.core.FTSDataColumnPreferences; import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource; import jalview.fts.service.pdb.PDBFTSRestClient; @@ -328,8 +329,11 @@ public class GPreferences extends JPanel /* * See WsPreferences for the real work of configuring this tab. */ - wsTab.setLayout(new BorderLayout()); - tabbedPane.add(wsTab, MessageManager.getString("label.web_services")); + if (!Jalview.isJS()) + { + wsTab.setLayout(new BorderLayout()); + tabbedPane.add(wsTab, MessageManager.getString("label.web_services")); + } /* * Handler to validate a tab before leaving it - currently only for @@ -510,13 +514,19 @@ public class GPreferences extends JPanel outputTab.add(userIdWidth); outputTab.add(userIdWidthlabel); outputTab.add(modellerOutput); - outputTab.add(embbedBioJSON); + if (!Jalview.isJS()) + { + outputTab.add(embbedBioJSON); + } outputTab.add(epsLabel); outputTab.add(epsRendering); - outputTab.add(htmlLabel); - outputTab.add(htmlRendering); - outputTab.add(svgLabel); - outputTab.add(svgRendering); + if (!Jalview.isJS()) + { + outputTab.add(htmlLabel); + outputTab.add(htmlRendering); + outputTab.add(svgLabel); + outputTab.add(svgRendering); + } outputTab.add(jPanel11); return outputTab; } @@ -1276,6 +1286,17 @@ public class GPreferences extends JPanel docFieldPref.setBounds(new Rectangle(10, ypos, 450, 120)); structureTab.add(docFieldPref); + /* + * hide Chimera options in JalviewJS + */ + if (Jalview.isJS()) + { + pathLabel.setVisible(false); + chimeraPath.setVisible(false); + viewerLabel.setVisible(false); + structViewer.setVisible(false); + } + return structureTab; } @@ -1652,6 +1673,13 @@ public class GPreferences extends JPanel visualTab.add(fontNameCB); visualTab.add(fontSizeCB); visualTab.add(fontStyleCB); + + if (Jalview.isJS()) + { + startupCheckbox.setVisible(false); + startupFileTextfield.setVisible(false); + } + return visualTab; } -- 1.7.10.2