Merge branch 'features/JAL-4061_and_JAL-4062_findselectfeatures' into features/r2_11_...
[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
7 import java.util.IdentityHashMap;
8
9 public class AnnotationRendererFactory implements
10         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.CUSTOMRENDERER)
35     {
36       return new ContactMapRenderer();
37     }
38     return null;
39   }
40
41 }