From: tcofoegbu Date: Tue, 17 Nov 2015 11:10:13 +0000 (+0000) Subject: JAL-1479 Refactored Sifts configuration preference in order to rectify applet build X-Git-Tag: Release_2_10_0~337 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e57ac4e703658ff81d7e172222e718ff7611e96e;p=jalview.git JAL-1479 Refactored Sifts configuration preference in order to rectify applet build --- diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index 885a62f..33068a8 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -30,6 +30,7 @@ import jalview.jbgui.GPreferences; import jalview.jbgui.GSequenceLink; import jalview.schemes.ColourSchemeProperty; import jalview.util.MessageManager; +import jalview.ws.sifts.SiftsSettings; import java.awt.BorderLayout; import java.awt.Color; @@ -316,10 +317,12 @@ public class Preferences extends GPreferences if (Cache.getDefault("MAP_WITH_SIFTS", false)) { siftsMapping.setSelected(true); + SiftsSettings.setMapWithSifts(true); } else { nwMapping.setSelected(true); + SiftsSettings.setMapWithSifts(false); } /* @@ -504,6 +507,7 @@ public class Preferences extends GPreferences Cache.setOrRemove(CHIMERA_PATH, chimeraPath.getText()); Cache.applicationProperties.setProperty("MAP_WITH_SIFTS", Boolean.toString(siftsMapping.isSelected())); + SiftsSettings.setMapWithSifts(siftsMapping.isSelected()); /* * Save Output settings diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index e9053ed..678bf3b 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -37,6 +37,7 @@ import jalview.util.MappingUtils; import jalview.util.MessageManager; import jalview.ws.sifts.SiftsClient; import jalview.ws.sifts.SiftsException; +import jalview.ws.sifts.SiftsSettings; import java.io.PrintStream; import java.util.ArrayList; @@ -373,8 +374,7 @@ public class StructureSelectionManager } } PDBfile pdb = null; - boolean isMapUsingSIFTs = Boolean.valueOf(jalview.bin.Cache.getDefault( - "MAP_WITH_SIFTS", "false")); + boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts(); SiftsClient siftsClient = null; try { diff --git a/src/jalview/ws/sifts/SiftsSettings.java b/src/jalview/ws/sifts/SiftsSettings.java new file mode 100644 index 0000000..c666e2c --- /dev/null +++ b/src/jalview/ws/sifts/SiftsSettings.java @@ -0,0 +1,16 @@ +package jalview.ws.sifts; + +public class SiftsSettings +{ + private static boolean mapWithSifts = false; + + public static boolean isMapWithSifts() + { + return mapWithSifts; + } + + public static void setMapWithSifts(boolean mapWithSifts) + { + SiftsSettings.mapWithSifts = mapWithSifts; + } +}