85d22c9e14833325d6fec5b22aa360f90d092cf9
[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 AnnotationRendererFactoryI
11 {
12
13   private static AnnotationRendererFactoryI factory = null;
14
15   public static AnnotationRendererFactoryI getRendererFactory()
16   {
17     if (factory == null)
18     {
19       factory = new AnnotationRendererFactory();
20     }
21     return factory;
22   }
23
24   IdentityHashMap<Object, AnnotationRowRendererI> renderers = new IdentityHashMap<Object, AnnotationRowRendererI>();
25
26   public AnnotationRendererFactory()
27   {
28     // renderers.put)
29   }
30
31   @Override
32   public AnnotationRowRendererI getRendererFor(AlignmentAnnotation row)
33   {
34     if (row.graph == AlignmentAnnotation.CONTACT_MAP)
35     {
36       // TODO consider configuring renderer/etc according to the type of matrix
37       // bound to the annotation row - needs to be looked up in that case
38       if (PAEContactMatrix.PAEMATRIX.equals(row.getCalcId()))
39       {
40         return ContactMapRenderer.newPAERenderer();
41       }
42       // TODO add potential for configuring renderer directly from the
43       // annotation row and/or viewmodel
44
45     }
46     return null;
47   }
48
49 }