From: hansonr Date: Wed, 3 Apr 2019 23:52:20 +0000 (-0500) Subject: replacing @j2sNative with @j2sIgnore where appropriate - requires NEW X-Git-Tag: Release_2_11_4_0~45^2~18^2~176 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=577b0bf651763fe609eb6d6343754662023b3eac;p=jalview.git replacing @j2sNative with @j2sIgnore where appropriate - requires NEW TRANSPILER --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 9dcc949..b6ff253 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -1088,18 +1088,4 @@ public class Cache } } - /** - * Add a known domain that implements access-control-allow-origin:* bh 2018 - * - * @param defaultUniprotDomain - */ - public static void addJ2SDirectDatabaseCall(String domain) - { - - /** - * @j2sNative - * - * J2S.addDirectDatabaseCall(domain); - */ - } } diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 330919b..226888f 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -127,7 +127,7 @@ public class Jalview /** * Java only * - * @j2sNative + * @j2sIgnore */ { // grab all the rights we can for the JVM @@ -239,12 +239,21 @@ public class Jalview @SuppressWarnings("unused") private static void setLogging() { + + /** + * @j2sIgnore + * + */ + { + System.out.println("not in js"); + } + // BH - for event debugging in JavaScript (Java mode only) if (!Platform.isJS()) /** * Java only * - * @j2sNative + * @j2sIgnore */ { Logger.getLogger("").setLevel(Level.ALL); @@ -292,7 +301,7 @@ public class Jalview /** * Java only * - * @j2sNative + * @j2sIgnore */ { if (aparser.contains("help") || aparser.contains("h")) @@ -435,7 +444,7 @@ public class Jalview /** * Java only * - * @j2sNative + * @j2sIgnore */ { desktop.startServiceDiscovery(); @@ -609,7 +618,7 @@ public class Jalview /** * ignore in JavaScript -- can't just file existence - could load it? * - * @j2sNative + * @j2sIgnore */ { if (!file.startsWith("http://") && !file.startsWith("https://")) @@ -844,7 +853,7 @@ public class Jalview /** * Java only * - * @j2sNative + * @j2sIgnore */ { file = jalview.bin.Cache.getDefault("STARTUP_FILE", diff --git a/src/jalview/ext/ensembl/EnsemblRestClient.java b/src/jalview/ext/ensembl/EnsemblRestClient.java index 9a647f4..b605232 100644 --- a/src/jalview/ext/ensembl/EnsemblRestClient.java +++ b/src/jalview/ext/ensembl/EnsemblRestClient.java @@ -20,7 +20,6 @@ */ package jalview.ext.ensembl; -import jalview.bin.Cache; import jalview.util.Platform; import jalview.util.StringUtils; @@ -50,8 +49,8 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher static { - Cache.addJ2SDirectDatabaseCall("http://rest.ensembl"); - Cache.addJ2SDirectDatabaseCall("https://rest.ensembl"); + Platform.addJ2SDirectDatabaseCall("http://rest.ensembl"); + Platform.addJ2SDirectDatabaseCall("https://rest.ensembl"); } private static final int DEFAULT_READ_TIMEOUT = 5 * 60 * 1000; // 5 minutes diff --git a/src/jalview/fts/service/pdb/PDBFTSRestClient.java b/src/jalview/fts/service/pdb/PDBFTSRestClient.java index 8a10c66..0b5d431 100644 --- a/src/jalview/fts/service/pdb/PDBFTSRestClient.java +++ b/src/jalview/fts/service/pdb/PDBFTSRestClient.java @@ -135,7 +135,7 @@ public class PDBFTSRestClient extends FTSRestClient /** * Java only * - * @j2sNative + * @j2sIgnore */ { client = Client.create(new DefaultClientConfig()); diff --git a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java index 1f4d56a..ae8f6e5 100644 --- a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java +++ b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java @@ -48,7 +48,7 @@ public class UniProtFTSRestClient extends FTSRestClient private static final String DEFAULT_UNIPROT_DOMAIN = "https://www.uniprot.org"; static { - Cache.addJ2SDirectDatabaseCall(DEFAULT_UNIPROT_DOMAIN); + Platform.addJ2SDirectDatabaseCall(DEFAULT_UNIPROT_DOMAIN); } private static FTSRestClientI instance = null; @@ -62,6 +62,7 @@ public class UniProtFTSRestClient extends FTSRestClient DEFAULT_UNIPROT_DOMAIN) + "/uniprot/"; } + @SuppressWarnings("unchecked") @Override public FTSRestResponse executeRequest(FTSRestRequest uniprotRestRequest) throws Exception @@ -106,7 +107,7 @@ public class UniProtFTSRestClient extends FTSRestClient /** * Java only * - * @j2sNative + * @j2sIgnore */ { // Java only @@ -213,38 +214,39 @@ public class UniProtFTSRestClient extends FTSRestClient return searchResult; } - /** - * Takes a collection of FTSDataColumnI and converts its 'code' values into a - * tab delimited string. - * - * @param dataColumnFields - * the collection of FTSDataColumnI to process - * @return the generated comma delimited string from the supplied - * FTSDataColumnI collection - */ - private String getDataColumnsFieldsAsTabDelimitedString( - Collection dataColumnFields) - { - String result = ""; - if (dataColumnFields != null && !dataColumnFields.isEmpty()) - { - StringBuilder returnedFields = new StringBuilder(); - for (FTSDataColumnI field : dataColumnFields) - { - if (field.getName().equalsIgnoreCase("Uniprot Id")) - { - returnedFields.append("\t").append("Entry"); - } - else - { - returnedFields.append("\t").append(field.getName()); - } - } - returnedFields.deleteCharAt(0); - result = returnedFields.toString(); - } - return result; - } + // /** + // * Takes a collection of FTSDataColumnI and converts its 'code' values into + // a + // * tab delimited string. + // * + // * @param dataColumnFields + // * the collection of FTSDataColumnI to process + // * @return the generated comma delimited string from the supplied + // * FTSDataColumnI collection + // */ + // private String getDataColumnsFieldsAsTabDelimitedString( + // Collection dataColumnFields) + // { + // String result = ""; + // if (dataColumnFields != null && !dataColumnFields.isEmpty()) + // { + // StringBuilder returnedFields = new StringBuilder(); + // for (FTSDataColumnI field : dataColumnFields) + // { + // if (field.getName().equalsIgnoreCase("Uniprot Id")) + // { + // returnedFields.append("\t").append("Entry"); + // } + // else + // { + // returnedFields.append("\t").append(field.getName()); + // } + // } + // returnedFields.deleteCharAt(0); + // result = returnedFields.toString(); + // } + // return result; + // } public static FTSData getFTSData(String tabDelimittedDataStr, FTSRestRequest request) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 270023e..b655b2e 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -3325,7 +3325,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Java only * - * @j2sNative + * @j2sIgnore */ { JEditorPane editPane = new JEditorPane("text/html", ""); diff --git a/src/jalview/gui/AnnotationColumnChooser.java b/src/jalview/gui/AnnotationColumnChooser.java index d841177..8046902 100644 --- a/src/jalview/gui/AnnotationColumnChooser.java +++ b/src/jalview/gui/AnnotationColumnChooser.java @@ -88,8 +88,10 @@ public class AnnotationColumnChooser extends AnnotationRowFilter private HiddenColumns oldHiddenColumns; + // J2SHIDDENCODE protected static int MIN_WIDTH = (/** @j2sNative 370||*/420); + // J2SHIDDENCODE protected static int MIN_HEIGHT = (/** @j2sNative 370||*/430); public AnnotationColumnChooser(AlignViewport av, final AlignmentPanel ap) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index b7e1117..14beac2 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -410,7 +410,7 @@ public class Desktop extends jalview.jbgui.GDesktop /** * Java only * - * @j2sNative + * @j2sIgnore */ { @@ -1192,7 +1192,7 @@ public class Desktop extends jalview.jbgui.GDesktop /** * Java only * - * @j2sNative + * @j2sIgnore */ { JComboBox asCombo = new JComboBox<>(); @@ -1455,7 +1455,7 @@ public class Desktop extends jalview.jbgui.GDesktop /** * Java only * - * @j2sNative + * @j2sIgnore */ { Help.showHelpWindow(); diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 0cd8620..872fe15 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -1716,7 +1716,7 @@ class ColorEditor extends AbstractCellEditor /** * Java only * - * @j2sNative + * @j2sIgnore */ { chooser.setRequestFocusEnabled(true); diff --git a/src/jalview/gui/Help.java b/src/jalview/gui/Help.java index 48f84c3..8bd01ea 100644 --- a/src/jalview/gui/Help.java +++ b/src/jalview/gui/Help.java @@ -105,7 +105,7 @@ public class Help /** * Java only * - * @j2sNative + * @j2sIgnore */ { diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index 8f97f9a..6b312ad 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -353,7 +353,7 @@ public class IdPanel extends JPanel /** * Java only * - * @j2sNative + * @j2sIgnore */ { scrollThread.start(); diff --git a/src/jalview/gui/JvOptionPane.java b/src/jalview/gui/JvOptionPane.java index 0e3d5ef..bf15b86 100644 --- a/src/jalview/gui/JvOptionPane.java +++ b/src/jalview/gui/JvOptionPane.java @@ -793,7 +793,7 @@ public class JvOptionPane extends JOptionPane implements DialogRunnerI, /** * Java only * - * @j2sNative + * @j2sIgnore */ { handleResponse(response); @@ -827,7 +827,7 @@ public class JvOptionPane extends JOptionPane implements DialogRunnerI, /** * Java only * - * @j2sNative + * @j2sIgnore */ { handleResponse(response); diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 3a6f9e4..ad33110 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -811,7 +811,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener /** * Java only * - * @j2sNative + * @j2sIgnore */ { CutAndPasteHtmlTransfer cap = new CutAndPasteHtmlTransfer(); @@ -1736,7 +1736,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener /** * Java only * - * @j2sNative + * @j2sIgnore */ { CutAndPasteHtmlTransfer cap = new CutAndPasteHtmlTransfer(); diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index f961712..9d5596e 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -193,7 +193,7 @@ public class Preferences extends GPreferences /** * Java only * - * @j2sNative + * @j2sIgnore */ { wsPrefs = new WsPreferences(); @@ -1077,7 +1077,7 @@ public class Preferences extends GPreferences /** * Java only * - * @j2sNative + * @j2sIgnore */ { JFileChooser chooser = new JFileChooser("."); diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java index f7d7cbf..2b87e10 100755 --- a/src/jalview/gui/SplashScreen.java +++ b/src/jalview/gui/SplashScreen.java @@ -97,7 +97,7 @@ public class SplashScreen extends JPanel /** * Java only * - * @j2sNative + * @j2sIgnore */ { authlist = new JTextPane(); @@ -180,7 +180,7 @@ public class SplashScreen extends JPanel /** * Java only * - * @j2sNative + * @j2sIgnore */ { ((JTextPane) authlist).setEditable(false); @@ -221,7 +221,7 @@ public class SplashScreen extends JPanel /** * Java only * - * @j2sNative + * @j2sIgnore */ { authlist = new JTextPane(); diff --git a/src/jalview/gui/UserDefinedColours.java b/src/jalview/gui/UserDefinedColours.java index 621f49d..4846049 100755 --- a/src/jalview/gui/UserDefinedColours.java +++ b/src/jalview/gui/UserDefinedColours.java @@ -490,7 +490,7 @@ public class UserDefinedColours extends GUserDefinedColours /** * Java only * - * @j2sNative + * @j2sIgnore */ { String name = schemeName.getText().trim(); @@ -753,7 +753,7 @@ public class UserDefinedColours extends GUserDefinedColours /** * java only * - * @j2sNative + * @j2sIgnore */ { int reply = JvOptionPane.showInternalConfirmDialog(Desktop.desktop, diff --git a/src/jalview/io/JalviewFileChooser.java b/src/jalview/io/JalviewFileChooser.java index acd0e18..88a20e7 100755 --- a/src/jalview/io/JalviewFileChooser.java +++ b/src/jalview/io/JalviewFileChooser.java @@ -224,7 +224,7 @@ public class JalviewFileChooser extends JFileChooser implements DialogRunnerI, /** * Java only * - * @j2sNative + * @j2sIgnore */ { /* diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 1cd3d3b..548291c 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -1505,7 +1505,7 @@ public class AnnotationRenderer /** * Java only * - * @j2sNative + * @j2sIgnore */ { // Java ('normal') method is to scale the font to fit diff --git a/src/jalview/util/BrowserLauncher.java b/src/jalview/util/BrowserLauncher.java index 45b7551..8119daa 100755 --- a/src/jalview/util/BrowserLauncher.java +++ b/src/jalview/util/BrowserLauncher.java @@ -240,7 +240,7 @@ public class BrowserLauncher /** * Java only * - * @j2sNative + * @j2sIgnore * */ { @@ -340,7 +340,7 @@ public class BrowserLauncher /** * Java only * - * @j2sNative + * @j2sIgnore * */ { @@ -547,7 +547,7 @@ public class BrowserLauncher /** * Java only * - * @j2sNative + * @j2sIgnore * */ { @@ -752,7 +752,7 @@ public class BrowserLauncher /** * Java only * - * @j2sNative + * @j2sIgnore */ { diff --git a/src/jalview/util/Platform.java b/src/jalview/util/Platform.java index 68985b5..c0c8966 100644 --- a/src/jalview/util/Platform.java +++ b/src/jalview/util/Platform.java @@ -521,10 +521,10 @@ public class Platform public static void streamToFile(InputStream is, File outFile) throws IOException { - if (!isJS() || /** - * @j2sNative outFile.setBytes$O && outFile.setBytes$O(is) || - */ - false) + if (isJS() && /** + * @j2sNative outFile.setBytes$O && outFile.setBytes$O(is) && + */ + true) { return; } @@ -543,4 +543,29 @@ public class Platform } } + /** + * Add a known domain that implements access-control-allow-origin:* + * + * These should be reviewed periodically. + * + * @param domain + * for a service that is not allowing ajax + * + * @author hansonr@stolaf.edu + * + */ + public static void addJ2SDirectDatabaseCall(String domain) + { + + System.out.println( + "Platform adding no-access-control-allow-origin domain " + + domain); + + /** + * @j2sNative + * + * J2S.addDirectDatabaseCall(domain); + */ + } + } diff --git a/swingjs/net.sf.j2s.core.jar b/swingjs/net.sf.j2s.core.jar index 5bb94fa..30f7d1f 100644 Binary files a/swingjs/net.sf.j2s.core.jar and b/swingjs/net.sf.j2s.core.jar differ diff --git a/swingjs/timestamp b/swingjs/timestamp index 57e631c..6860e8b 100644 --- a/swingjs/timestamp +++ b/swingjs/timestamp @@ -1 +1 @@ -20190403083450 +20190403175448 diff --git a/swingjs/ver/3.2.4/net.sf.j2s.core.jar b/swingjs/ver/3.2.4/net.sf.j2s.core.jar index 5bb94fa..30f7d1f 100644 Binary files a/swingjs/ver/3.2.4/net.sf.j2s.core.jar and b/swingjs/ver/3.2.4/net.sf.j2s.core.jar differ diff --git a/swingjs/ver/3.2.4/timestamp b/swingjs/ver/3.2.4/timestamp index 57e631c..6860e8b 100644 --- a/swingjs/ver/3.2.4/timestamp +++ b/swingjs/ver/3.2.4/timestamp @@ -1 +1 @@ -20190403083450 +20190403175448