JAL-2422 pull-up refactoring of structure commands (continued)
[jalview.git] / src / jalview / structure / StructureCommandsI.java
1 package jalview.structure;
2
3 import jalview.api.AlignmentViewPanel;
4 import jalview.api.SequenceRenderer;
5 import jalview.datamodel.SequenceI;
6
7 import java.awt.Color;
8 import java.util.List;
9 import java.util.Map;
10
11 /**
12  * Methods that generate commands that can be sent to a molecular structure
13  * viewer program (e.g. Jmol, Chimera, ChimeraX)
14  * 
15  * @author gmcarstairs
16  *
17  */
18 public interface StructureCommandsI
19 {
20
21   /**
22    * Returns the command to colour by chain
23    * 
24    * @return
25    */
26   String colourByChain();
27
28   /**
29    * Returns the command to colour residues using a charge-based scheme:
30    * <ul>
31    * <li>Aspartic acid and Glutamic acid (negative charge) red</li>
32    * <li>Lysine and Arginine (positive charge) blue</li>
33    * <li>Cysteine - yellow</li>
34    * <li>all others - white</li>
35    * </ul>
36    * 
37    * @return
38    */
39   String colourByCharge();
40
41   /**
42    * Returns the command to colour residues with the colours provided in the
43    * map, one per three letter residue code
44    * 
45    * @param colours
46    * @return
47    */
48   String colourByResidues(Map<String, Color> colours);
49
50   /**
51    * Returns the command to set the background colour of the structure viewer
52    * 
53    * @param col
54    * @return
55    */
56   String setBackgroundColour(Color col);
57
58   /**
59    * Returns commands to colour mapped residues of structures according to
60    * Jalview's colouring (including feature colouring if applied)
61    * 
62    * @param structureSelectionManager
63    * @param files
64    * @param seqs
65    * @param sr
66    * @param alignmentv
67    * @return
68    */
69   String[] colourBySequence(
70           StructureSelectionManager structureSelectionManager,
71           String[] files, SequenceI[][] seqs, SequenceRenderer sr,
72           AlignmentViewPanel alignmentv);
73
74   /**
75    * Returns a command to centre the display in the structure viewer
76    * 
77    * @return
78    */
79   String focusView();
80
81   /**
82    * Returns a command to show only the selected chains. The items in the input
83    * list should be formatted as "modelno:chainid".
84    * 
85    * @param toShow
86    * @return
87    */
88   String showChains(List<String> toShow);
89
90 }