X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FPreferences.java;h=1e157cd37708105a33d7ea71a4cf45d481d8547c;hb=eacce9627f059fc2f9e880c81d8d1bdfbe7fe5b3;hp=8a2650b5d6d1a99f41adb4872094052abb1a6d0e;hpb=97c00be1121a6758439b73ded035c4edbacfa2bc;p=jalview.git diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index 8a2650b..1e157cd 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; @@ -62,11 +79,12 @@ public class Preferences extends GPreferences Desktop.addInternalFrame(frame, "Preferences", 480, 390); frame.setMinimumSize(new Dimension(480,390)); - fullID.setSelected( Cache.getDefault("SHOW_FULL_ID", true)); + dbRef.setSelected( Cache.getDefault("SHOW_DBREF", true)); + seqLimit.setSelected( Cache.getDefault("SHOW_JVSUFFIX", 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 +92,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 +131,27 @@ public class Preferences extends GPreferences startupFileTextfield.setText(Cache.getDefault("STARTUP_FILE", "http://www.jalview.org/examples/exampleFile.jar")); - /**************************************************** - * Set up Connections - */ + sortby.addItem("No sort"); + sortby.addItem("Id"); + sortby.addItem("Pairwise Identity"); + sortby.setSelectedItem( Cache.getDefault("SORT_ALIGNMENT", "No sort") ); - 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(); + epsRendering.addItem("Prompt each time"); + epsRendering.addItem("Lineart"); + epsRendering.addItem("Text"); + epsRendering.setSelectedItem( Cache.getDefault("EPS_RENDERING", "Prompt each time")); - 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");} + blcjv.setSelected( Cache.getDefault("BLC_JVSUFFIX", true) ); + clustaljv.setSelected( Cache.getDefault("CLUSTAL_JVSUFFIX", true) ); + fastajv.setSelected( Cache.getDefault("FASTA_JVSUFFIX", true) ); + msfjv.setSelected( Cache.getDefault("MSF_JVSUFFIX", true) ); + pfamjv.setSelected( Cache.getDefault("PFAM_JVSUFFIX", true) ); + pileupjv.setSelected( Cache.getDefault("PILEUP_JVSUFFIX", true) ); + pirjv.setSelected( Cache.getDefault("PIR_JVSUFFIX", true) ); + /**************************************************** + * Set up Connections + */ nameLinks = new Vector(); urlLinks = new Vector(); for(int i=0; i0) { @@ -209,17 +238,42 @@ 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",""); + } + + Cache.applicationProperties.setProperty("BLC_JVSUFFIX", Boolean.toString(blcjv.isSelected()) ); + Cache.applicationProperties.setProperty("CLUSTAL_JVSUFFIX", Boolean.toString(clustaljv.isSelected()) ); + Cache.applicationProperties.setProperty("FASTA_JVSUFFIX", Boolean.toString(fastajv.isSelected()) ); + Cache.applicationProperties.setProperty("MSF_JVSUFFIX", Boolean.toString(msfjv.isSelected()) ); + Cache.applicationProperties.setProperty("PFAM_JVSUFFIX", Boolean.toString(pfamjv.isSelected()) ); + Cache.applicationProperties.setProperty("PILEUP_JVSUFFIX", Boolean.toString(pileupjv.isSelected()) ); + Cache.applicationProperties.setProperty("PIR_JVSUFFIX", Boolean.toString(pirjv.isSelected()) ); Cache.saveProperties();