X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FPreferences.java;h=32aad84a7a2aad655b385849eb38ed3245f1b6b2;hb=f24dacb1da56fccf05d684e2f4899facec2aecf7;hp=8a2650b5d6d1a99f41adb4872094052abb1a6d0e;hpb=97c00be1121a6758439b73ded035c4edbacfa2bc;p=jalview.git diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index 8a2650b..32aad84 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -18,8 +18,6 @@ */ package jalview.gui; -import jalview.bin.*; - import jalview.io.*; import jalview.jbgui.*; @@ -45,7 +43,26 @@ import jalview.bin.Cache; public class Preferences extends GPreferences { /** Holds name and link separated with | character. Sequence ID must be $SEQUENCE_ID$ */ - public static Vector sequenceURLLinks = new Vector(); + public static Vector sequenceURLLinks; + static + { + String string = Cache.getDefault("SEQUENCE_LINKS", + "SRS|http://srs.ebi.ac.uk/srs7bin/cgi-bin/wgetz?-e+[uniprot-all:$SEQUENCE_ID$]+-vn+2"); + sequenceURLLinks = new Vector(); + + try + { + StringTokenizer st = new StringTokenizer(string, "|"); + while (st.hasMoreElements()) + { + sequenceURLLinks.addElement(st.nextToken() + "|" + st.nextToken()); + } + } + catch (Exception ex) + { + System.out.println(ex + "\nError parsing sequence links"); + } + } Vector nameLinks, urlLinks; JInternalFrame frame; @@ -64,9 +81,9 @@ public class Preferences extends GPreferences fullID.setSelected( Cache.getDefault("SHOW_FULL_ID", true)); fullScreen.setSelected( Cache.getDefault("SHOW_FULLSCREEN", false)); - annotations.setSelected( Cache.getDefault("SHOW_FULL_ID", true)); - conservation.setEnabled( Cache.getDefault("SHOW_ANNOTATIONS", true)); + annotations.setSelected( Cache.getDefault("SHOW_ANNOTATIONS", true)); + conservation.setEnabled( Cache.getDefault("SHOW_ANNOTATIONS", true)); quality.setEnabled(Cache.getDefault("SHOW_ANNOTATIONS", true)); identity.setEnabled(Cache.getDefault("SHOW_ANNOTATIONS", true)); @@ -74,21 +91,14 @@ public class Preferences extends GPreferences quality.setSelected(Cache.getDefault("SHOW_QUALITY", true)); identity.setSelected(Cache.getDefault("SHOW_IDENTITY", true)); - for (int i = 0; i < 12; i++) + for (int i = 0; i < 13; i++) { colour.addItem(ColourSchemeProperty.getColourName(i)); } - String string = Cache.getProperty("DEFAULT_COLOUR"); + String string = Cache.getDefault("DEFAULT_COLOUR", "None"); - if (string != null) - { - colour.setSelectedItem(string); - } - else - { - colour.setSelectedIndex(11); - } + colour.setSelectedItem(string); String[] fonts = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment() .getAvailableFontFamilyNames(); @@ -120,23 +130,19 @@ public class Preferences extends GPreferences startupFileTextfield.setText(Cache.getDefault("STARTUP_FILE", "http://www.jalview.org/examples/exampleFile.jar")); + sortby.addItem("No sort"); + sortby.addItem("Id"); + sortby.addItem("Pairwise Identity"); + sortby.setSelectedItem( Cache.getDefault("SORT_ALIGNMENT", "No sort") ); + + epsRendering.addItem("Prompt each time"); + epsRendering.addItem("Lineart"); + epsRendering.addItem("Text"); + epsRendering.setSelectedItem( Cache.getDefault("EPS_RENDERING", "Prompt each time")); + /**************************************************** * Set up Connections */ - - string = Cache.getDefault("SEQUENCE_LINKS", - "SRS|http://srs.ebi.ac.uk/srs7bin/cgi-bin/wgetz?-e+[uniprot-all:$SEQUENCE_ID$]+-vn+2"); - sequenceURLLinks = new Vector(); - - try{ - StringTokenizer st = new StringTokenizer(string, "|"); - while (st.hasMoreElements()) - { - sequenceURLLinks.addElement(st.nextToken() + "|" + st.nextToken()); - } - }catch(Exception ex) - {System.out.println(ex+"\nError parsing sequence links");} - nameLinks = new Vector(); urlLinks = new Vector(); for(int i=0; i0) { @@ -209,16 +228,33 @@ public class Preferences extends GPreferences links.setLength( links.length()-1 ); Cache.applicationProperties.setProperty("SEQUENCE_LINKS", links.toString()); } + else + Cache.applicationProperties.remove("SEQUENCE_LINKS"); + Cache.applicationProperties.setProperty("USE_PROXY", Boolean.toString(useProxy.isSelected())); - Cache.applicationProperties.setProperty("PROXY_SERVER",proxyServerTB.getText()); - Cache.applicationProperties.setProperty("PROXY_PORT", proxyPortTB.getText()); + + if (proxyServerTB.getText().trim().length() < 1) + Cache.applicationProperties.remove("PROXY_SERVER"); + else + Cache.applicationProperties.setProperty("PROXY_SERVER", + proxyServerTB.getText()); + + if (proxyPortTB.getText().trim().length() < 1) + Cache.applicationProperties.remove("PROXY_PORT"); + else + Cache.applicationProperties.setProperty("PROXY_PORT", proxyPortTB.getText()); if(useProxy.isSelected()) { System.setProperty("http.proxyHost", proxyServerTB.getText()); System.setProperty("http.proxyPort", proxyPortTB.getText()); } + else + { + System.setProperty("http.proxyHost",""); + System.setProperty("http.proxyPort",""); + }