1 package jalview.renderer;
3 import jalview.datamodel.AlignmentAnnotation;
4 import jalview.renderer.api.AnnotationRendererFactoryI;
5 import jalview.renderer.api.AnnotationRowRendererI;
6 import jalview.ws.datamodel.alphafold.PAEContactMatrix;
8 import java.util.IdentityHashMap;
10 public class AnnotationRendererFactory implements
11 AnnotationRendererFactoryI
14 private static AnnotationRendererFactoryI factory = null;
16 public static AnnotationRendererFactoryI getRendererFactory()
20 factory = new AnnotationRendererFactory();
25 IdentityHashMap<Object, AnnotationRowRendererI> renderers = new IdentityHashMap<Object, AnnotationRowRendererI>();
27 public AnnotationRendererFactory()
33 public AnnotationRowRendererI getRendererFor(AlignmentAnnotation row)
35 if (row.graph == AlignmentAnnotation.CONTACT_MAP)
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()))
41 return ContactMapRenderer.newPAERenderer();
43 // TODO add potential for configuring renderer directly from the annotation row and/or viewmodel