4b23f045b5a057e53a99164289da64f6df727712
[jalview.git] / src / jalview / datamodel / SeqDistanceContactMatrix.java
1 package jalview.datamodel;
2
3 /**
4  * Dummy contact matrix based on sequence distance
5  * 
6  * @author jprocter
7  *
8  */
9 public class SeqDistanceContactMatrix implements ContactMatrixI
10 {
11   private int width = 0;
12
13   public SeqDistanceContactMatrix(int width)
14   {
15     this.width = width;
16   }
17
18   @Override
19   public float getMin()
20   {
21     return 0f;
22   }
23
24   @Override
25   public float getMax()
26   {
27     return width;
28   }
29
30   @Override
31   public ContactListI getContactList(final int column)
32   {
33     if (column < 0 || column >= width)
34     {
35       return null;
36     }
37     return new ContactListImpl(new ContactListProviderI()
38     {
39
40       int p = column;
41
42       // @Override
43       // public Color getColorForScore(int column)
44       // {
45       // return jalview.util.ColorUtils.getGraduatedColour(Math.abs(column-p),
46       // 0, Color.white, width, Color.magenta);
47       // }
48       // @Override
49       // public Color getColorForRange(int from_column, int to_column)
50       // {
51       // return jalview.util.ColorUtils.getGraduatedColour(
52       // Math.abs(to_column + from_column - 2 * p) / 2, 0, Color.white, width,
53       // Color.magenta);
54       // }
55
56       @Override
57       public int getContactHeight()
58       {
59         return width;
60
61       }
62
63       @Override
64       public int getPosition()
65       {
66         return p;
67       }
68
69       @Override
70       public double getContactAt(int column)
71       {
72         return Math.abs(column - p);
73       }
74     });
75   }
76
77   @Override
78   public boolean hasReferenceSeq()
79   {
80     // TODO Auto-generated method stub
81     return false;
82   }
83
84   @Override
85   public SequenceI getReferenceSeq()
86   {
87     // TODO Auto-generated method stub
88     return null;
89   }
90
91 }