JAL-1153 new runtime property set to first non-null annotation element colour
[jalview.git] / src / jalview / gui / AlignViewport.java
index 8bb40a1..c5d9438 100644 (file)
@@ -58,6 +58,8 @@ import jalview.workers.AlignCalcManager;
 import jalview.workers.ConsensusThread;
 import jalview.workers.ConservationThread;
 import jalview.workers.StrucConsensusThread;
+import jalview.ws.jws2.dm.AAConsSettings;
+import jalview.ws.params.AutoCalcSetting;
 
 /**
  * DOCUMENT ME!
@@ -67,8 +69,6 @@ import jalview.workers.StrucConsensusThread;
  */
 public class AlignViewport extends AlignmentViewport implements SelectionSource, VamsasSource, AlignViewportI
 {
-  private static final int RIGHT_JUSTIFY = 1;
-
   int startRes;
 
   int endRes;
@@ -93,12 +93,6 @@ public class AlignViewport extends AlignmentViewport implements SelectionSource,
 
   boolean showAnnotation = true;
 
-  boolean colourAppliesToAllGroups = true;
-
-  boolean conservationColourSelected = false;
-
-  boolean abovePIDThreshold = false;
-
   int charHeight;
 
   int charWidth;
@@ -111,9 +105,6 @@ public class AlignViewport extends AlignmentViewport implements SelectionSource,
 
   boolean seqNameItalics;
 
-  int threshold;
-
-  int increment;
 
   NJTree currentTree = null;
 
@@ -437,50 +428,6 @@ public class AlignViewport extends AlignmentViewport implements SelectionSource,
     return sq;
   }
 
-
-  /**
-   * GUI state
-   * 
-   * @return true if conservation based shading is enabled
-   */
-  public boolean getConservationSelected()
-  {
-    return conservationColourSelected;
-  }
-
-  /**
-   * GUI state
-   * 
-   * @param b
-   *          enable conservation based shading
-   */
-  public void setConservationSelected(boolean b)
-  {
-    conservationColourSelected = b;
-  }
-
-  /**
-   * GUI state
-   * 
-   * @return true if percent identity threshold is applied to shading
-   */
-  public boolean getAbovePIDThreshold()
-  {
-    return abovePIDThreshold;
-  }
-
-  /**
-   * GUI state
-   * 
-   * 
-   * @param b
-   *          indicate if percent identity threshold is applied to shading
-   */
-  public void setAbovePIDThreshold(boolean b)
-  {
-    abovePIDThreshold = b;
-  }
-
   /**
    * DOCUMENT ME!
    * 
@@ -831,48 +778,6 @@ public class AlignViewport extends AlignmentViewport implements SelectionSource,
   /**
    * DOCUMENT ME!
    * 
-   * @param thresh
-   *          DOCUMENT ME!
-   */
-  public void setThreshold(int thresh)
-  {
-    threshold = thresh;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @return DOCUMENT ME!
-   */
-  public int getThreshold()
-  {
-    return threshold;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param inc
-   *          DOCUMENT ME!
-   */
-  public void setIncrement(int inc)
-  {
-    increment = inc;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @return DOCUMENT ME!
-   */
-  public int getIncrement()
-  {
-    return increment;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
    * @return DOCUMENT ME!
    */
   public ColumnSelection getColumnSelection()
@@ -904,27 +809,6 @@ public class AlignViewport extends AlignmentViewport implements SelectionSource,
   /**
    * DOCUMENT ME!
    * 
-   * @param b
-   *          DOCUMENT ME!
-   */
-  public void setColourAppliesToAllGroups(boolean b)
-  {
-    colourAppliesToAllGroups = b;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @return DOCUMENT ME!
-   */
-  public boolean getColourAppliesToAllGroups()
-  {
-    return colourAppliesToAllGroups;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
    * @return DOCUMENT ME!
    */
   public boolean getShowJVSuffix()
@@ -1111,6 +995,7 @@ public class AlignViewport extends AlignmentViewport implements SelectionSource,
    */
   public long[] getUndoRedoHash()
   {
+    // TODO: JAL-1126
     if (historyList == null || redoList == null)
       return new long[]
       { -1, -1 };
@@ -1407,4 +1292,21 @@ public class AlignViewport extends AlignmentViewport implements SelectionSource,
   {
     return validCharWidth;
   }
+  private Hashtable<String, AutoCalcSetting> calcIdParams=new Hashtable<String, AutoCalcSetting>();
+  public AutoCalcSetting getCalcIdSettingsFor(String calcId)
+  {
+    return calcIdParams.get(calcId);
+  }
+
+  public void setCalcIdSettingsFor(String calcId, AutoCalcSetting settings, boolean needsUpdate)
+  {
+    calcIdParams.put(calcId, settings);
+    // TODO: create a restart list to trigger any calculations that need to be restarted after load
+    // calculator.getRegisteredWorkersOfClass(settings.getWorkerClass())
+    if (needsUpdate)
+    {
+      Cache.log.debug("trigger update for "+calcId);
+    }
+  }
+  
 }