JAL-3626 from JAL-3253-applet Cache applicationProperties made private
authorBobHanson <hansonr@stolaf.edu>
Tue, 2 Jun 2020 03:10:58 +0000 (22:10 -0500)
committerBobHanson <hansonr@stolaf.edu>
Tue, 2 Jun 2020 03:10:58 +0000 (22:10 -0500)
-- adds remove/setPropertyNoSave

18 files changed:
build-libjs.xml [new file with mode: 0644]
test/jalview/analysis/FinderTest.java
test/jalview/ext/jmol/JmolParserTest.java
test/jalview/gui/AlignFrameTest.java
test/jalview/gui/AlignViewportTest.java
test/jalview/gui/AlignmentPanelTest.java
test/jalview/gui/AnnotationChooserTest.java
test/jalview/gui/AnnotationColumnChooserTest.java
test/jalview/gui/AnnotationRowFilterTest.java
test/jalview/gui/CalculationChooserTest.java
test/jalview/gui/FreeUpMemoryTest.java
test/jalview/gui/SeqCanvasTest.java
test/jalview/gui/SeqPanelTest.java
test/jalview/io/AnnotatedPDBFileInputTest.java
test/jalview/io/BackupFilesTest.java
test/jalview/ws/PDBSequenceFetcherTest.java
test/jalview/ws/dbsources/RemoteFormatTest.java
test/mc_view/PDBfileTest.java

diff --git a/build-libjs.xml b/build-libjs.xml
new file mode 100644 (file)
index 0000000..3fb3cd3
--- /dev/null
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<!--
+ * just a crude zip up of non-Jalview classes for development purposes -BH 2018
+ *
+ * external JAR class treatment for JavaScript: see src2/README_SWINGJS.txt
+ * 
+ -->
+
+<project name="jalviewX" default="zipall" basedir="."
+ xmlns:if="ant:if"
+    xmlns:unless="ant:unless">
+
+       <!-- inputs directories -->
+    <property name="resource.dir" value="resources" />         
+    <property name="swingjs.dir" value="swingjs"/>
+       <!-- output directories -->
+       <property name="site.dir" value="site"/>
+       <property name="j2s.dir" value="${site.dir}/swingjs/j2s"/>
+       <property name="libjs.dir" value="libjs"/>
+
+       <target name="zipall" depends="zipvarna,zipmig,zipintervalstore">
+               
+               
+  </target>
+
+  <target name="zipvarna">
+    <!-- VARNA -->
+           <property name="varna.zip" value="${libjs.dir}/VARNA-site.zip" />                   
+               <echo> Zipping up ${varna.zip} </echo>
+               <zip destfile="${varna.zip}" basedir="${site.dir}" includes="fr_*.html,swingjs/j2s/fr/**" />
+       </target>
+
+       <target name="zipmig">
+         <!-- net.miginfo.com MiGLayout -->
+                   <property name="mig.zip" value="${libjs.dir}/MiGLayout-site.zip" />                 
+                       <echo> Zipping up ${mig.zip} </echo>
+                       <zip destfile="${mig.zip}" basedir="${site.dir}" includes="swingjs/j2s/net/miginfocom/**" />
+       </target>
+
+       <target name="zipintervalstore">
+         <!-- intervalstore.impl NCList implementation -->
+                   <property name="intervalstore.zip" value="${libjs.dir}/intervalstore-site.zip" />                   
+                       <echo> Zipping up ${intervalstore.zip} </echo>
+                       <zip destfile="${intervalstore.zip}" basedir="${site.dir}" includes="swingjs/j2s/intervalstore/**" />
+       </target>
+
+       <!-- already in SwingJS
+       <target name="zipjson"  already in SwingJS>
+                   <property name="json.zip" value="${libjs.dir}/json-site.zip" />                     
+                       <echo> Zipping up ${json.zip} </echo>
+                       <zip destfile="${json.zip}" basedir="${site.dir}" includes="swingjs/j2s/org/json/**" />
+       </target>
+       -->
+
+       <!-- log4j minimal implementation is already in jalview/javascript
+             and is mapped from org.apache.log4j by the following .j2s line:
+             
+             j2s.class.replacements=org.apache.log4j.->jalview.javascript.log4j.
+              
+       <target name="ziplog4j">
+                 <!- org.apache.log4j ->
+                   <property name="log4j.zip" value="${libjs.dir}/log4j-site.zip" />                   
+                       <echo> Zipping up ${log4j.zip} </echo>
+                       <zip destfile="${log4j.zip}" basedir="${site.dir}" includes="swingjs/j2s/org/apache/log4j/**" />
+       </target>
+    -->
+</project>
index 5f64b28..bd18abd 100644 (file)
@@ -68,7 +68,7 @@ public class FinderTest
   public void setUp()
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
-    Cache.applicationProperties.setProperty("PAD_GAPS",
+    Cache.setPropertyNoSave("PAD_GAPS",
             Boolean.FALSE.toString());
 
     String seqData = "seq1seq1/8-18 ABCD--EF-GHIJI\n" + "seq2 A--BCDefHI\n"
index 2832135..0977669 100644 (file)
@@ -98,11 +98,11 @@ public class JmolParserTest
   public void setUp()
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
-    Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
+    Cache.setPropertyNoSave("STRUCT_FROM_PDB",
             Boolean.TRUE.toString());
-    Cache.applicationProperties.setProperty("ADD_TEMPFACT_ANN",
+    Cache.setPropertyNoSave("ADD_TEMPFACT_ANN",
             Boolean.FALSE.toString());
-    Cache.applicationProperties.setProperty("ADD_SS_ANN",
+    Cache.setPropertyNoSave("ADD_SS_ANN",
             Boolean.TRUE.toString());
     StructureImportSettings.setDefaultStructureFileFormat("PDB");
     StructureImportSettings
index d362d35..00af72d 100644 (file)
@@ -86,7 +86,7 @@ public class AlignFrameTest
   public void setUp()
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
-    Cache.applicationProperties.setProperty("SHOW_IDENTITY",
+    Cache.setPropertyNoSave("SHOW_IDENTITY",
             Boolean.TRUE.toString());
     af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa",
             DataSourceType.FILE);
index 00267b3..76021ce 100644 (file)
@@ -280,15 +280,15 @@ public class AlignViewportTest
   @Test(groups = { "Functional" }, timeOut=2000)
   public void testUpdateConservation_qualityOnly()
   {
-    Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS",
+    Cache.setPropertyNoSave("SHOW_ANNOTATIONS",
             Boolean.TRUE.toString());
-    Cache.applicationProperties.setProperty("SHOW_QUALITY",
+    Cache.setPropertyNoSave("SHOW_QUALITY",
             Boolean.TRUE.toString());
-    Cache.applicationProperties.setProperty("SHOW_CONSERVATION",
+    Cache.setPropertyNoSave("SHOW_CONSERVATION",
             Boolean.FALSE.toString());
-    Cache.applicationProperties.setProperty("SHOW_OCCUPANCY",
+    Cache.setPropertyNoSave("SHOW_OCCUPANCY",
             Boolean.FALSE.toString());
-    Cache.applicationProperties.setProperty("SHOW_IDENTITY",
+    Cache.setPropertyNoSave("SHOW_IDENTITY",
             Boolean.FALSE.toString());
     AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
             "examples/uniref50.fa", DataSourceType.FILE);
@@ -337,8 +337,8 @@ public class AlignViewportTest
     /*
      * test for JAL-2283: don't inadvertently turn on colour by conservation
      */
-    Cache.applicationProperties.setProperty("DEFAULT_COLOUR_PROT", "None");
-    Cache.applicationProperties.setProperty("SHOW_CONSERVATION",
+    Cache.setPropertyNoSave("DEFAULT_COLOUR_PROT", "None");
+    Cache.setPropertyNoSave("SHOW_CONSERVATION",
             Boolean.TRUE.toString());
     AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
             "examples/uniref50.fa", DataSourceType.FILE);
index 8871249..24b658f 100644 (file)
@@ -52,7 +52,7 @@ public class AlignmentPanelTest
     Jalview.main(new String[] { "-nonews", "-props",
         "test/jalview/testProps.jvprops" });
 
-    Cache.applicationProperties.setProperty("SHOW_IDENTITY",
+    Cache.setPropertyNoSave("SHOW_IDENTITY",
             Boolean.TRUE.toString());
     af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa",
             DataSourceType.FILE);
index fbdda09..f0c4632 100644 (file)
@@ -88,14 +88,14 @@ public class AnnotationChooserTest
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
     // pin down annotation sort order for test
-    Cache.applicationProperties.setProperty(Preferences.SORT_ANNOTATIONS,
+    Cache.setPropertyNoSave(Preferences.SORT_ANNOTATIONS,
             SequenceAnnotationOrder.NONE.name());
     final String TRUE = Boolean.TRUE.toString();
-    Cache.applicationProperties.setProperty(
+    Cache.setPropertyNoSave(
             Preferences.SHOW_AUTOCALC_ABOVE, TRUE);
-    Cache.applicationProperties.setProperty("SHOW_QUALITY", TRUE);
-    Cache.applicationProperties.setProperty("SHOW_CONSERVATION", TRUE);
-    Cache.applicationProperties.setProperty("SHOW_IDENTITY", TRUE);
+    Cache.setPropertyNoSave("SHOW_QUALITY", TRUE);
+    Cache.setPropertyNoSave("SHOW_CONSERVATION", TRUE);
+    Cache.setPropertyNoSave("SHOW_IDENTITY", TRUE);
 
     AlignmentI al = new FormatAdapter().readFile(TEST_DATA,
             DataSourceType.PASTE, FileFormat.Fasta);
index 912cd27..36d49dc 100644 (file)
@@ -76,14 +76,14 @@ public class AnnotationColumnChooserTest
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
     // pin down annotation sort order for test
-    Cache.applicationProperties.setProperty(Preferences.SORT_ANNOTATIONS,
+    Cache.setPropertyNoSave(Preferences.SORT_ANNOTATIONS,
             SequenceAnnotationOrder.NONE.name());
     final String TRUE = Boolean.TRUE.toString();
-    Cache.applicationProperties.setProperty(Preferences.SHOW_AUTOCALC_ABOVE,
+    Cache.setPropertyNoSave(Preferences.SHOW_AUTOCALC_ABOVE,
             TRUE);
-    Cache.applicationProperties.setProperty("SHOW_QUALITY", TRUE);
-    Cache.applicationProperties.setProperty("SHOW_CONSERVATION", TRUE);
-    Cache.applicationProperties.setProperty("SHOW_IDENTITY", TRUE);
+    Cache.setPropertyNoSave("SHOW_QUALITY", TRUE);
+    Cache.setPropertyNoSave("SHOW_CONSERVATION", TRUE);
+    Cache.setPropertyNoSave("SHOW_IDENTITY", TRUE);
 
     AlignmentI al = new FormatAdapter().readFile(TEST_DATA,
             DataSourceType.PASTE, FileFormat.Fasta);
index 69a41c5..47bd924 100644 (file)
@@ -27,9 +27,9 @@ public class AnnotationRowFilterTest
   public void setUp()
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
-    Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS",
+    Cache.setPropertyNoSave("SHOW_ANNOTATIONS",
             Boolean.TRUE.toString());
-    Cache.applicationProperties.setProperty(
+    Cache.setPropertyNoSave(
             Preferences.SHOW_AUTOCALC_ABOVE, Boolean.TRUE.toString());
     af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa",
             DataSourceType.FILE);
index 6c2e777..595baef 100644 (file)
@@ -19,7 +19,7 @@ public class CalculationChooserTest
   {
     // read-only Jalview properties
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
-    Cache.applicationProperties.setProperty("BLOSUM62_PCA_FOR_NUCLEOTIDE",
+    Cache.setPropertyNoSave("BLOSUM62_PCA_FOR_NUCLEOTIDE",
             Boolean.FALSE.toString());
   }
 
@@ -73,7 +73,7 @@ public class CalculationChooserTest
     /*
      * enable inclusion of BLOSUM62 for nucleotide PCA (JAL-2962)
      */
-    Cache.applicationProperties.setProperty("BLOSUM62_PCA_FOR_NUCLEOTIDE",
+    Cache.setPropertyNoSave("BLOSUM62_PCA_FOR_NUCLEOTIDE",
             Boolean.TRUE.toString());
 
     /*
index 24697c0..43064a3 100644 (file)
@@ -35,11 +35,11 @@ public class FreeUpMemoryTest
     Jalview.main(new String[] { "-nonews", "-props",
         "test/jalview/testProps.jvprops" });
     String True = Boolean.TRUE.toString();
-    Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", True);
-    Cache.applicationProperties.setProperty("SHOW_QUALITY", True);
-    Cache.applicationProperties.setProperty("SHOW_CONSERVATION", True);
-    Cache.applicationProperties.setProperty("SHOW_OCCUPANCY", True);
-    Cache.applicationProperties.setProperty("SHOW_IDENTITY", True);
+    Cache.setPropertyNoSave("SHOW_ANNOTATIONS", True);
+    Cache.setPropertyNoSave("SHOW_QUALITY", True);
+    Cache.setPropertyNoSave("SHOW_CONSERVATION", True);
+    Cache.setPropertyNoSave("SHOW_OCCUPANCY", True);
+    Cache.setPropertyNoSave("SHOW_IDENTITY", True);
   }
 
   /**
index aaacce0..e3b1191 100644 (file)
@@ -340,7 +340,7 @@ public class SeqCanvasTest
   public void setUp()
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
-    Cache.applicationProperties.setProperty("SHOW_IDENTITY",
+    Cache.setPropertyNoSave("SHOW_IDENTITY",
             Boolean.TRUE.toString());
     af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa",
             DataSourceType.FILE);
index a03819d..2fdbe7e 100644 (file)
@@ -258,8 +258,8 @@ public class SeqPanelTest
   @Test(groups = "Functional")
   public void testFindMousePosition_wrapped_annotations()
   {
-    Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "true");
-    Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
+    Cache.setPropertyNoSave("SHOW_ANNOTATIONS", "true");
+    Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true");
     AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
             "examples/uniref50.fa", DataSourceType.FILE);
     AlignViewportI av = alignFrame.getViewport();
@@ -433,8 +433,8 @@ public class SeqPanelTest
   @Test(groups = "Functional")
   public void testFindMousePosition_wrapped_scaleAbove()
   {
-    Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "true");
-    Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
+    Cache.setPropertyNoSave("SHOW_ANNOTATIONS", "true");
+    Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true");
     AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
             "examples/uniref50.fa", DataSourceType.FILE);
     AlignViewportI av = alignFrame.getViewport();
@@ -633,8 +633,8 @@ public class SeqPanelTest
   @Test(groups = "Functional")
   public void testFindMousePosition_wrapped_noAnnotations()
   {
-    Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "false");
-    Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
+    Cache.setPropertyNoSave("SHOW_ANNOTATIONS", "false");
+    Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true");
     AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
             "examples/uniref50.fa", DataSourceType.FILE);
     AlignViewportI av = alignFrame.getViewport();
@@ -721,7 +721,7 @@ public class SeqPanelTest
   @Test(groups = "Functional")
   public void testFindColumn_unwrapped()
   {
-    Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "false");
+    Cache.setPropertyNoSave("WRAP_ALIGNMENT", "false");
     AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
             "examples/uniref50.fa", DataSourceType.FILE);
     SeqPanel testee = alignFrame.alignPanel.getSeqPanel();
@@ -790,7 +790,7 @@ public class SeqPanelTest
   @Test(groups = "Functional")
   public void testFindColumn_wrapped()
   {
-    Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
+    Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true");
     AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
             "examples/uniref50.fa", DataSourceType.FILE);
     AlignViewport av = alignFrame.getViewport();
index 8eb3796..6ea3883 100644 (file)
@@ -68,9 +68,9 @@ public class AnnotatedPDBFileInputTest
   @BeforeMethod(alwaysRun = true)
   public void setup() throws Exception
   {
-    Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
+    Cache.setPropertyNoSave("STRUCT_FROM_PDB",
             Boolean.TRUE.toString());
-    Cache.applicationProperties.setProperty("ADD_SS_ANN",
+    Cache.setPropertyNoSave("ADD_SS_ANN",
             Boolean.TRUE.toString());
     FileLoader loader = new FileLoader(false);
     AlignFrame af = loader.LoadFileWaitTillLoaded("examples/1gaq.txt",
index 64cf902..c84285a 100644 (file)
@@ -213,23 +213,23 @@ public class BackupFilesTest
     BackupFilesPresetEntry bfpe = new BackupFilesPresetEntry(suffix, digits,
             reverse, noMax, rollMax, false);
 
-    Cache.applicationProperties.setProperty(BackupFiles.ENABLED,
+    Cache.setPropertyNoSave(BackupFiles.ENABLED,
             Boolean.toString(enabled));
-    Cache.applicationProperties.setProperty(
+    Cache.setPropertyNoSave(
             BackupFilesPresetEntry.SAVEDCONFIG, bfpe.toString());
     /*
-    Cache.applicationProperties.setProperty(BackupFiles.ENABLED,
+    Cache.setPropertyNoSave(BackupFiles.ENABLED,
             Boolean.toString(enabled));
-    Cache.applicationProperties.setProperty(BackupFiles.SUFFIX, suffix);
-    Cache.applicationProperties.setProperty(BackupFiles.SUFFIX_DIGITS,
+    Cache.setPropertyNoSave(BackupFiles.SUFFIX, suffix);
+    Cache.setPropertyNoSave(BackupFiles.SUFFIX_DIGITS,
             Integer.toString(digits));
-    Cache.applicationProperties.setProperty(BackupFiles.REVERSE_ORDER,
+    Cache.setPropertyNoSave(BackupFiles.REVERSE_ORDER,
             Boolean.toString(reverse));
-    Cache.applicationProperties.setProperty(BackupFiles.NO_MAX,
+    Cache.setPropertyNoSave(BackupFiles.NO_MAX,
             Boolean.toString(noMax));
-    Cache.applicationProperties.setProperty(BackupFiles.ROLL_MAX,
+    Cache.setPropertyNoSave(BackupFiles.ROLL_MAX,
             Integer.toString(rollMax));
-    Cache.applicationProperties.setProperty(BackupFiles.CONFIRM_DELETE_OLD,
+    Cache.setPropertyNoSave(BackupFiles.CONFIRM_DELETE_OLD,
             "false");
             */
   }
index d1e32b9..9992137 100644 (file)
@@ -57,9 +57,9 @@ public class PDBSequenceFetcherTest
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
     // ensure 'add annotation from structure' is selected
-    Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
+    Cache.setPropertyNoSave("STRUCT_FROM_PDB",
             Boolean.TRUE.toString());
-    Cache.applicationProperties.setProperty("ADD_SS_ANN",
+    Cache.setPropertyNoSave("ADD_SS_ANN",
             Boolean.TRUE.toString());
 
     sf = new SequenceFetcher();
@@ -76,7 +76,7 @@ public class PDBSequenceFetcherTest
   @Test(groups = { "Network" }, enabled = true)
   public void testRnaSeqRetrieve() throws Exception
   {
-    Cache.applicationProperties.setProperty("PDB_DOWNLOAD_FORMAT", "PDB");
+    Cache.setPropertyNoSave("PDB_DOWNLOAD_FORMAT", "PDB");
     List<DbSourceProxy> sps = sf.getSourceProxy("PDB");
     AlignmentI response = sps.get(0).getSequenceRecords("2GIS");
     assertTrue(response != null);
index 629bd8a..9d40624 100644 (file)
@@ -46,9 +46,9 @@ public class RemoteFormatTest
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
     // ensure 'add annotation from structure' is selected
-    Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
+    Cache.setPropertyNoSave("STRUCT_FROM_PDB",
             Boolean.TRUE.toString());
-    Cache.applicationProperties.setProperty("ADD_SS_ANN",
+    Cache.setPropertyNoSave("ADD_SS_ANN",
             Boolean.TRUE.toString());
 
     sf = new SequenceFetcher();
index c99d185..0e34a24 100644 (file)
@@ -325,11 +325,11 @@ public class PDBfileTest
   public void setUp()
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
-    Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
+    Cache.setPropertyNoSave("STRUCT_FROM_PDB",
             Boolean.TRUE.toString());
-    Cache.applicationProperties.setProperty("ADD_TEMPFACT_ANN",
+    Cache.setPropertyNoSave("ADD_TEMPFACT_ANN",
             Boolean.TRUE.toString());
-    Cache.applicationProperties.setProperty("ADD_SS_ANN",
+    Cache.setPropertyNoSave("ADD_SS_ANN",
             Boolean.TRUE.toString());
     StructureImportSettings.setDefaultStructureFileFormat("PDB");
   }