db2eb7a295e5a0ef309b025e696a15b46be858c1
[jalview.git] / src / jalview / renderer / AnnotationRendererFactory.java
1 package jalview.renderer;
2
3 import jalview.datamodel.AlignmentAnnotation;
4 import jalview.renderer.api.AnnotationRendererFactoryI;
5 import jalview.renderer.api.AnnotationRowRendererI;
6 import jalview.ws.datamodel.alphafold.PAEContactMatrix;
7
8 import java.util.IdentityHashMap;
9
10 public class AnnotationRendererFactory implements
11         AnnotationRendererFactoryI
12 {
13
14   private static AnnotationRendererFactoryI factory = null;
15
16   public static AnnotationRendererFactoryI getRendererFactory()
17   {
18     if (factory == null)
19     {
20       factory = new AnnotationRendererFactory();
21     }
22     return factory;
23   }
24
25   IdentityHashMap<Object, AnnotationRowRendererI> renderers = new IdentityHashMap<Object, AnnotationRowRendererI>();
26
27   public AnnotationRendererFactory()
28   {
29     // renderers.put)
30   }
31
32   @Override
33   public AnnotationRowRendererI getRendererFor(AlignmentAnnotation row)
34   {
35     if (row.graph == AlignmentAnnotation.CONTACT_MAP)
36     {
37       // TODO consider configuring renderer/etc according to the type of matrix
38       // bound to the annotation row - needs to be looked up in that case
39       if (PAEContactMatrix.PAEMATRIX.equals(row.getCalcId()))
40       {
41         return ContactMapRenderer.newPAERenderer();
42       }
43       // TODO add potential for configuring renderer directly from the annotation row and/or viewmodel
44       
45     }
46     return null;
47   }
48
49 }