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 AnnotationRendererFactoryI
13 private static AnnotationRendererFactoryI factory = null;
15 public static AnnotationRendererFactoryI getRendererFactory()
19 factory = new AnnotationRendererFactory();
24 IdentityHashMap<Object, AnnotationRowRendererI> renderers = new IdentityHashMap<Object, AnnotationRowRendererI>();
26 public AnnotationRendererFactory()
32 public AnnotationRowRendererI getRendererFor(AlignmentAnnotation row)
34 if (row.graph == AlignmentAnnotation.CONTACT_MAP)
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()))
40 return ContactMapRenderer.newPAERenderer();
42 // TODO add potential for configuring renderer directly from the
43 // annotation row and/or viewmodel