From: tcofoegbu Date: Wed, 25 Nov 2015 15:13:40 +0000 (+0000) Subject: JAL-1479 applet build debug X-Git-Tag: Release_2_10_0~334 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d9b79c023346253c10dc907d1e75f509823266c4;p=jalview.git JAL-1479 applet build debug --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 67d359a..b492067 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -217,6 +217,10 @@ public class Cache public static final String DAS_ACTIVE_SOURCE = "DAS_ACTIVE_SOURCE"; + public static final String DEFAULT_SIFTS_DOWNLOAD_DIR = System + .getProperty("user.home") + + File.separatorChar + + ".sifts_downloads" + File.separatorChar; /** * Initialises the Jalview Application Log */ @@ -399,6 +403,9 @@ public class Cache SiftsSettings .setMapWithSifts(Cache.getDefault("MAP_WITH_SIFTS", false)); + SiftsSettings.setSiftDownloadDirectory(jalview.bin.Cache.getDefault( + "sifts_download_dir", DEFAULT_SIFTS_DOWNLOAD_DIR)); + System.out .println("Jalview Version: " + codeVersion + codeInstallation); diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 3df7e0c..c86a90f 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -786,6 +786,8 @@ public class StructureChooser extends GStructureChooser ArrayList seqsMap = new ArrayList(); for (SequenceI seq : sequences) { + new jalview.ws.DBRefFetcher(new SequenceI[] { seq }, null, + null, null, false).fetchDBRefs(true); seqsMap.add(new SequenceI[] { seq }); } SequenceI[][] collatedSeqs = seqsMap.toArray(new SequenceI[0][0]); diff --git a/src/jalview/ws/sifts/SiftsClient.java b/src/jalview/ws/sifts/SiftsClient.java index 4951d2f..32bb7b7 100644 --- a/src/jalview/ws/sifts/SiftsClient.java +++ b/src/jalview/ws/sifts/SiftsClient.java @@ -96,14 +96,6 @@ public class SiftsClient implements SiftsClientI private static final String SIFTS_FTP_BASE_URL = "ftp://ftp.ebi.ac.uk/pub/databases/msd/sifts/xml/"; - public static final String DEFAULT_SIFTS_DOWNLOAD_DIR = System - .getProperty("user.home") - + File.separatorChar - + ".sifts_downloads" + File.separatorChar; - - public static final String SIFTS_DOWNLOAD_DIR = jalview.bin.Cache - .getDefault("sifts_download_dir", DEFAULT_SIFTS_DOWNLOAD_DIR); - private final static String NEWLINE = System.lineSeparator(); private String curSourceDBRef; @@ -227,7 +219,8 @@ public class SiftsClient implements SiftsClientI */ public static File getSiftsFile(String pdbId) throws SiftsException { - File siftsFile = new File(SIFTS_DOWNLOAD_DIR + pdbId.toLowerCase() + File siftsFile = new File(SiftsSettings.getSiftDownloadDirectory() + + pdbId.toLowerCase() + ".xml.gz"); if (siftsFile.exists()) { @@ -252,8 +245,10 @@ public class SiftsClient implements SiftsClientI { String siftFile = pdbId + ".xml.gz"; String siftsFileFTPURL = SIFTS_FTP_BASE_URL + siftFile; - String downloadedSiftsFile = SIFTS_DOWNLOAD_DIR + siftFile; - File siftsDownloadDir = new File(SIFTS_DOWNLOAD_DIR); + String downloadedSiftsFile = SiftsSettings.getSiftDownloadDirectory() + + siftFile; + File siftsDownloadDir = new File( + SiftsSettings.getSiftDownloadDirectory()); if (!siftsDownloadDir.exists()) { siftsDownloadDir.mkdirs(); @@ -291,7 +286,8 @@ public class SiftsClient implements SiftsClientI */ public static boolean deleteSiftsFileByPDBId(String pdbId) { - File siftsFile = new File(SIFTS_DOWNLOAD_DIR + pdbId.toLowerCase() + File siftsFile = new File(SiftsSettings.getSiftDownloadDirectory() + + pdbId.toLowerCase() + ".xml.gz"); if (siftsFile.exists()) { @@ -322,13 +318,13 @@ public class SiftsClient implements SiftsClientI else { DBRefEntry[] dbRefs = seq.getDBRefs(); - if (dbRefs == null || dbRefs.length < 1) - { - final SequenceI[] seqs = new SequenceI[] { seq }; - new jalview.ws.DBRefFetcher(seqs, null, null, null, false) - .fetchDBRefs(true); - dbRefs = seq.getDBRefs(); - } + // if (dbRefs == null || dbRefs.length < 1) + // { + // // final SequenceI[] seqs = new SequenceI[] { seq }; + // // new jalview.ws.DBRefFetcher(seqs, null, null, null, false) + // // .fetchDBRefs(true); + // dbRefs = seq.getDBRefs(); + // } if (dbRefs == null || dbRefs.length < 1) { diff --git a/src/jalview/ws/sifts/SiftsSettings.java b/src/jalview/ws/sifts/SiftsSettings.java index c666e2c..5554658 100644 --- a/src/jalview/ws/sifts/SiftsSettings.java +++ b/src/jalview/ws/sifts/SiftsSettings.java @@ -4,6 +4,8 @@ public class SiftsSettings { private static boolean mapWithSifts = false; + private static String siftDownloadDirectory; + public static boolean isMapWithSifts() { return mapWithSifts; @@ -13,4 +15,14 @@ public class SiftsSettings { SiftsSettings.mapWithSifts = mapWithSifts; } + + public static String getSiftDownloadDirectory() + { + return siftDownloadDirectory; + } + + public static void setSiftDownloadDirectory(String siftDownloadDirectory) + { + SiftsSettings.siftDownloadDirectory = siftDownloadDirectory; + } }