jog pixels for OSX
[jalview.git] / src / jalview / gui / Preferences.java
index b96fb71..ac2c59c 100755 (executable)
@@ -29,6 +29,7 @@ import jalview.bin.*;
 import jalview.io.*;
 import jalview.jbgui.*;
 import jalview.schemes.*;
+import jalview.ws.EnfinEnvision2OneWay;
 
 /**
  * DOCUMENT ME!
@@ -44,6 +45,14 @@ public class Preferences extends GPreferences
    * $SEQUENCE_ID$ or $SEQUENCE_ID=/.possible | chars ./=$
    */
   public static Vector sequenceURLLinks;
+  /**
+   * Holds name and link separated with | character. Sequence IDS and Sequences must be
+   * $SEQUENCEIDS$ or $SEQUENCEIDS=/.possible | chars ./=$ and $SEQUENCES$ or $SEQUENCES=/.possible | chars ./=$
+   * and separation character for first and second token specified after a pipe character at end |,|.
+   * (TODO: proper escape for using | to separate ids or sequences
+   */
+
+  public static Vector groupURLLinks;
   static
   {
     String string = Cache
@@ -51,7 +60,7 @@ public class Preferences extends GPreferences
                     "SEQUENCE_LINKS",
                     "SRS|http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-newId+(([uniprot-all:$SEQUENCE_ID$]))+-view+SwissEntry");
     sequenceURLLinks = new Vector();
-
+    
     try
     {
       StringTokenizer st = new StringTokenizer(string, "|");
@@ -71,6 +80,14 @@ public class Preferences extends GPreferences
     {
       System.out.println(ex + "\nError parsing sequence links");
     }
+    /**
+     * TODO: reformulate groupURL encoding so two or more can be stored in the .properties file as '|' separated strings 
+     */
+    
+    groupURLLinks = new Vector();
+    //groupURLLinks.addElement("UNIPROT|EnVision2|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?tool=Jalview&workflow=Default&datasetName=JalviewIDs$DATASETID$&input=$SEQUENCEIDS$&inputType=0|,");
+    //groupURLLinks.addElement("Seqs|EnVision2|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?tool=Jalview&workflow=Default&datasetName=JalviewSeqs$DATASETID$&input=$SEQUENCES=/([A-Za-z]+)+/=$&inputType=1|,");
+    
   }
 
   Vector nameLinks, urlLinks;
@@ -105,15 +122,13 @@ public class Preferences extends GPreferences
     fullScreen.setSelected(Cache.getDefault("SHOW_FULLSCREEN", false));
     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));
-
     conservation.setSelected(Cache.getDefault("SHOW_CONSERVATION", true));
     quality.setSelected(Cache.getDefault("SHOW_QUALITY", true));
     identity.setSelected(Cache.getDefault("SHOW_IDENTITY", true));
     openoverv.setSelected(Cache.getDefault("SHOW_OVERVIEW", false));
     showUnconserved.setSelected(Cache.getDefault("SHOW_UNCONSERVED", false));
+    showNpTooltip.setSelected(Cache.getDefault("SHOW_NPFEATS_TOOLTIP", true));
+    showDbRefTooltip.setSelected(Cache.getDefault("SHOW_DBREFS_TOOLTIP", true));
 
     for (int i = 0; i < 13; i++)
     {
@@ -185,6 +200,11 @@ public class Preferences extends GPreferences
 
     autoCalculateConsCheck.setSelected(Cache.getDefault(
             "AUTO_CALC_CONSENSUS", true));
+    showGroupConsensus.setSelected(Cache.getDefault("SHOW_GROUP_CONSENSUS",false));
+    showGroupConservation.setSelected(Cache.getDefault("SHOW_GROUP_CONSERVATION", false));
+    showConsensHistogram.setSelected(Cache.getDefault("SHOW_CONSENSUS_HISTOGRAM",true));
+    showConsensLogo.setSelected(Cache.getDefault("SHOW_CONSENSUS_LOGO",false));
+    
     padGaps.setSelected(Cache.getDefault("PAD_GAPS", false));
 
     /***************************************************************************
@@ -212,7 +232,7 @@ public class Preferences extends GPreferences
     usagestats.setSelected(Cache.getDefault("USAGESTATS", false));
     questionnaire.setSelected(Cache.getProperty("NOQUESTIONNAIRES")==null); // note antisense here
     versioncheck.setSelected(Cache.getDefault("VERSION_CHECK", true)); // default is true
-
+    annotations_actionPerformed(null); // update the display of the annotation settings
     try
     {
       jbInit();
@@ -264,8 +284,14 @@ public class Preferences extends GPreferences
     Cache.applicationProperties.setProperty("ID_ITALICS", Boolean
             .toString(idItalics.isSelected()));
     Cache.applicationProperties.setProperty("SHOW_UNCONSERVED",Boolean.toString(showUnconserved.isSelected()));
+    Cache.applicationProperties.setProperty("SHOW_GROUP_CONSENSUS",Boolean.toString(showGroupConsensus.isSelected()));
+    Cache.applicationProperties.setProperty("SHOW_GROUP_CONSERVATION",Boolean.toString(showGroupConservation.isSelected()));
+    Cache.applicationProperties.setProperty("SHOW_CONSENSUS_HISTOGRAM",Boolean.toString(showConsensHistogram.isSelected()));
+    Cache.applicationProperties.setProperty("SHOW_CONSENSUS_LOGO",Boolean.toString(showConsensLogo.isSelected()));
     Cache.applicationProperties.setProperty("ANTI_ALIAS", Boolean
             .toString(smoothFont.isSelected()));
+    Cache.applicationProperties.setProperty("SHOW_NPFEATS_TOOLTIP", Boolean.toString(showNpTooltip.isSelected()));
+    Cache.applicationProperties.setProperty("SHOW_DBREFS_TOOLTIP", Boolean.toString(showDbRefTooltip.isSelected()));
 
     Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", Boolean
             .toString(wrap.isSelected()));
@@ -454,6 +480,10 @@ public class Preferences extends GPreferences
     conservation.setEnabled(annotations.isSelected());
     quality.setEnabled(annotations.isSelected());
     identity.setEnabled(annotations.isSelected());
+    showGroupConsensus.setEnabled(annotations.isSelected());
+    showGroupConservation.setEnabled(annotations.isSelected());
+    showConsensHistogram.setEnabled(annotations.isSelected() && (identity.isSelected() || showGroupConsensus.isSelected()));
+    showConsensLogo.setEnabled(annotations.isSelected() && (identity.isSelected() || showGroupConsensus.isSelected()));
   }
 
   public void newLink_actionPerformed(ActionEvent e)
@@ -568,4 +598,9 @@ public class Preferences extends GPreferences
   private void jbInit() throws Exception
   {
   }
+
+  public static Collection getGroupURLLinks()
+  {
+    return groupURLLinks;
+  }
 }