Merge branch 'releases/Release_2_11_4_Branch'
[jalview.git] / gui / JalviewChimeraBindingModel.java
1 package jalview.gui;
2
3 import jalview.api.AlignmentViewPanel;
4 import jalview.datamodel.PDBEntry;
5 import jalview.datamodel.SequenceI;
6 import jalview.ext.rbvi.chimera.JalviewChimeraBinding;
7 import jalview.structure.StructureSelectionManager;
8
9 public class JalviewChimeraBindingModel extends JalviewChimeraBinding
10 {
11   private ChimeraViewFrame cvf;
12
13   public JalviewChimeraBindingModel(ChimeraViewFrame chimeraViewFrame,
14           StructureSelectionManager ssm, PDBEntry[] pdbentry,
15           SequenceI[][] sequenceIs, String[][] chains, String protocol)
16   {
17     super(ssm, pdbentry, sequenceIs, chains, protocol);
18     cvf = chimeraViewFrame;
19   }
20
21   FeatureRenderer fr = null;
22
23   @Override
24   public jalview.api.FeatureRenderer getFeatureRenderer(
25           AlignmentViewPanel alignment)
26   {
27     AlignmentPanel ap = (alignment == null) ? cvf.ap
28             : (AlignmentPanel) alignment;
29     if (ap.av.showSequenceFeatures)
30     {
31       if (fr == null)
32       {
33         fr = ap.cloneFeatureRenderer();
34       }
35       else
36       {
37         ap.updateFeatureRenderer(fr);
38       }
39     }
40
41     return fr;
42   }
43
44   @Override
45   public jalview.api.SequenceRenderer getSequenceRenderer(
46           AlignmentViewPanel alignment)
47   {
48     return new SequenceRenderer(((AlignmentPanel) alignment).av);
49   }
50   @Override
51   public void refreshGUI()
52   {
53     // appJmolWindow.repaint();
54     javax.swing.SwingUtilities.invokeLater(new Runnable()
55     {
56       public void run()
57       {
58         cvf.updateTitleAndMenus();
59         cvf.revalidate();
60       }
61     });
62   }
63
64   public void updateColours(Object source)
65   {
66     AlignmentPanel ap = (AlignmentPanel) source, topap;
67     // ignore events from panels not used to colour this view
68     if (!cvf.isUsedforcolourby(ap))
69       return;
70     if (!isLoadingFromArchive())
71     {
72       colourBySequence(ap.av.getShowSequenceFeatures(), ap);
73     }
74   }
75   @Override
76   public void releaseReferences(Object svl)
77   {
78     // TODO Auto-generated method stub
79
80   }
81
82   @Override
83   protected void releaseUIResources()
84   {
85     // TODO Auto-generated method stub
86
87   }
88
89   @Override
90   public void refreshPdbEntries()
91   {
92     // TODO Auto-generated method stub
93
94   }
95
96   @Override
97   public void showUrl(String url, String target)
98   {
99     // TODO Auto-generated method stub
100
101   }
102 }