JAL-629 hacked in --tempfac-shading - hardcoded to use existing colours in per-sequen...
authorJames Procter <j.procter@dundee.ac.uk>
Tue, 24 Jan 2023 08:18:39 +0000 (08:18 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Tue, 24 Jan 2023 08:18:39 +0000 (08:18 +0000)
src/jalview/bin/Commands.java
src/jalview/gui/AnnotationColourChooser.java

index 0c34a16..5f40ba6 100644 (file)
@@ -30,6 +30,7 @@ import jalview.io.FileFormatI;
 import jalview.io.FileLoader;
 import jalview.io.HtmlSvgOutput;
 import jalview.io.IdentifyFile;
+import jalview.schemes.AnnotationColourGradient;
 import jalview.structure.StructureImportSettings;
 import jalview.structure.StructureImportSettings.TFType;
 import jalview.structure.StructureSelectionManager;
@@ -37,6 +38,7 @@ import jalview.util.HttpUtils;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
 import jalview.ws.dbsources.EBIAlfaFold;
+import mc_view.PDBChain;
 
 public class Commands
 {
@@ -456,6 +458,23 @@ public class Commands
         }
       }
     }
+    String shading = ArgParser.getValue(m, Arg.TEMPFAC_SHADING);
+    if (shading != null)
+    {
+      Console.debug(
+              "Annotation colour scheme : " + shading + " (ignored value)");
+      AlignFrame af = afMap.get(id);
+      for (AlignmentAnnotation aa : af.alignPanel.getAlignment()
+              .findAnnotation(PDBChain.class.getName().toString()))
+      {
+        AnnotationColourGradient acg = new AnnotationColourGradient(aa,
+                af.alignPanel.av.getGlobalColourScheme(), 0);
+        acg.setSeqAssociated(true);
+        af.changeColour(acg);
+        Console.info("Changed colour " + acg.toString());
+      }
+
+    }
   }
 
   protected void processImages(String id)
index 4e9a26d..f1e8402 100644 (file)
  */
 package jalview.gui;
 
-import jalview.bin.Cache;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.GraphLine;
-import jalview.datamodel.SequenceGroup;
-import jalview.gui.JalviewColourChooser.ColourChooserListener;
-import jalview.schemes.AnnotationColourGradient;
-import jalview.schemes.ColourSchemeI;
-import jalview.util.MessageManager;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Dimension;
@@ -48,6 +39,14 @@ import javax.swing.JInternalFrame;
 import javax.swing.JLayeredPane;
 import javax.swing.JPanel;
 
+import jalview.bin.Cache;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.GraphLine;
+import jalview.datamodel.SequenceGroup;
+import jalview.gui.JalviewColourChooser.ColourChooserListener;
+import jalview.schemes.AnnotationColourGradient;
+import jalview.schemes.ColourSchemeI;
+import jalview.util.MessageManager;
 import net.miginfocom.swing.MigLayout;
 
 @SuppressWarnings("serial")