From: BobHanson Date: Tue, 2 Jun 2020 03:10:58 +0000 (-0500) Subject: JAL-3626 from JAL-3253-applet Cache applicationProperties made private X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b93f8af382bb2fbdb0c974558bcef57750d1bdd6;p=jalview.git JAL-3626 from JAL-3253-applet Cache applicationProperties made private -- adds remove/setPropertyNoSave --- diff --git a/build-libjs.xml b/build-libjs.xml new file mode 100644 index 0000000..3fb3cd3 --- /dev/null +++ b/build-libjs.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + Zipping up ${varna.zip} + + + + + + + Zipping up ${mig.zip} + + + + + + + Zipping up ${intervalstore.zip} + + + + + + + diff --git a/test/jalview/analysis/FinderTest.java b/test/jalview/analysis/FinderTest.java index 5f64b28..bd18abd 100644 --- a/test/jalview/analysis/FinderTest.java +++ b/test/jalview/analysis/FinderTest.java @@ -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" diff --git a/test/jalview/ext/jmol/JmolParserTest.java b/test/jalview/ext/jmol/JmolParserTest.java index 2832135..0977669 100644 --- a/test/jalview/ext/jmol/JmolParserTest.java +++ b/test/jalview/ext/jmol/JmolParserTest.java @@ -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 diff --git a/test/jalview/gui/AlignFrameTest.java b/test/jalview/gui/AlignFrameTest.java index d362d35..00af72d 100644 --- a/test/jalview/gui/AlignFrameTest.java +++ b/test/jalview/gui/AlignFrameTest.java @@ -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); diff --git a/test/jalview/gui/AlignViewportTest.java b/test/jalview/gui/AlignViewportTest.java index 00267b3..76021ce 100644 --- a/test/jalview/gui/AlignViewportTest.java +++ b/test/jalview/gui/AlignViewportTest.java @@ -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); diff --git a/test/jalview/gui/AlignmentPanelTest.java b/test/jalview/gui/AlignmentPanelTest.java index 8871249..24b658f 100644 --- a/test/jalview/gui/AlignmentPanelTest.java +++ b/test/jalview/gui/AlignmentPanelTest.java @@ -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); diff --git a/test/jalview/gui/AnnotationChooserTest.java b/test/jalview/gui/AnnotationChooserTest.java index fbdda09..f0c4632 100644 --- a/test/jalview/gui/AnnotationChooserTest.java +++ b/test/jalview/gui/AnnotationChooserTest.java @@ -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); diff --git a/test/jalview/gui/AnnotationColumnChooserTest.java b/test/jalview/gui/AnnotationColumnChooserTest.java index 912cd27..36d49dc 100644 --- a/test/jalview/gui/AnnotationColumnChooserTest.java +++ b/test/jalview/gui/AnnotationColumnChooserTest.java @@ -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); diff --git a/test/jalview/gui/AnnotationRowFilterTest.java b/test/jalview/gui/AnnotationRowFilterTest.java index 69a41c5..47bd924 100644 --- a/test/jalview/gui/AnnotationRowFilterTest.java +++ b/test/jalview/gui/AnnotationRowFilterTest.java @@ -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); diff --git a/test/jalview/gui/CalculationChooserTest.java b/test/jalview/gui/CalculationChooserTest.java index 6c2e777..595baef 100644 --- a/test/jalview/gui/CalculationChooserTest.java +++ b/test/jalview/gui/CalculationChooserTest.java @@ -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()); /* diff --git a/test/jalview/gui/FreeUpMemoryTest.java b/test/jalview/gui/FreeUpMemoryTest.java index 24697c0..43064a3 100644 --- a/test/jalview/gui/FreeUpMemoryTest.java +++ b/test/jalview/gui/FreeUpMemoryTest.java @@ -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); } /** diff --git a/test/jalview/gui/SeqCanvasTest.java b/test/jalview/gui/SeqCanvasTest.java index aaacce0..e3b1191 100644 --- a/test/jalview/gui/SeqCanvasTest.java +++ b/test/jalview/gui/SeqCanvasTest.java @@ -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); diff --git a/test/jalview/gui/SeqPanelTest.java b/test/jalview/gui/SeqPanelTest.java index a03819d..2fdbe7e 100644 --- a/test/jalview/gui/SeqPanelTest.java +++ b/test/jalview/gui/SeqPanelTest.java @@ -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(); diff --git a/test/jalview/io/AnnotatedPDBFileInputTest.java b/test/jalview/io/AnnotatedPDBFileInputTest.java index 8eb3796..6ea3883 100644 --- a/test/jalview/io/AnnotatedPDBFileInputTest.java +++ b/test/jalview/io/AnnotatedPDBFileInputTest.java @@ -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", diff --git a/test/jalview/io/BackupFilesTest.java b/test/jalview/io/BackupFilesTest.java index 64cf902..c84285a 100644 --- a/test/jalview/io/BackupFilesTest.java +++ b/test/jalview/io/BackupFilesTest.java @@ -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"); */ } diff --git a/test/jalview/ws/PDBSequenceFetcherTest.java b/test/jalview/ws/PDBSequenceFetcherTest.java index d1e32b9..9992137 100644 --- a/test/jalview/ws/PDBSequenceFetcherTest.java +++ b/test/jalview/ws/PDBSequenceFetcherTest.java @@ -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 sps = sf.getSourceProxy("PDB"); AlignmentI response = sps.get(0).getSequenceRecords("2GIS"); assertTrue(response != null); diff --git a/test/jalview/ws/dbsources/RemoteFormatTest.java b/test/jalview/ws/dbsources/RemoteFormatTest.java index 629bd8a..9d40624 100644 --- a/test/jalview/ws/dbsources/RemoteFormatTest.java +++ b/test/jalview/ws/dbsources/RemoteFormatTest.java @@ -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(); diff --git a/test/mc_view/PDBfileTest.java b/test/mc_view/PDBfileTest.java index c99d185..0e34a24 100644 --- a/test/mc_view/PDBfileTest.java +++ b/test/mc_view/PDBfileTest.java @@ -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"); }