bb2299bdc9c9c99e6bcd0791c1f6d42459a6751e
[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   @Override
30   public ContactListI getContactList(final int column)
31   {
32     if (column < 0 || column >= width)
33     {
34       return null;
35     }
36     return new ContactListImpl(new ContactListProviderI()
37     {
38
39       int p = column;
40
41       // @Override
42       // public Color getColorForScore(int column)
43       // {
44       // return jalview.util.ColorUtils.getGraduatedColour(Math.abs(column-p),
45       // 0, Color.white, width, Color.magenta);
46       // }
47       // @Override
48       // public Color getColorForRange(int from_column, int to_column)
49       // {
50       // return jalview.util.ColorUtils.getGraduatedColour(
51       // Math.abs(to_column + from_column - 2 * p) / 2, 0, Color.white, width,
52       // Color.magenta);
53       // }
54
55       @Override
56       public int getContactHeight()
57       {
58         return width;
59
60       }
61
62       @Override
63       public double getContactAt(int column)
64       {
65         return Math.abs(column - p);
66       }
67     });
68   }
69
70   @Override
71   public boolean hasReferenceSeq()
72   {
73     // TODO Auto-generated method stub
74     return false;
75   }
76
77   @Override
78   public SequenceI getReferenceSeq()
79   {
80     // TODO Auto-generated method stub
81     return null;
82   }
83
84 }