+ /**
+ * bean holding colours for shading
+ *
+ * @author jprocter
+ *
+ */
+ public class Shading
+ {
+ /**
+ * shown when no data available from map
+ */
+ Color no_data;
+
+ /**
+ * shown for region not currently visible - should normally not see this
+ */
+ Color hidden;
+
+ /**
+ * linear shading scheme min/max
+ */
+ Color maxColor, minColor;
+
+ /**
+ * linear shading scheme min/max for selected region
+ */
+ Color selMinColor, selMaxColor;
+
+ /**
+ *
+ * @param no_data
+ * - colour when no data available
+ * @param hidden
+ * - colour if this row is hidden
+ * @param maxColor
+ * - colour for maximum value of contact
+ * @param minColor
+ * - colour for minimum value of contact
+ * @param selMinColor
+ * - min colour if the contact has been selected
+ * @param selMaxColor
+ * - max colour if contact is selected
+ */
+ public Shading(Color no_data, Color hidden, Color maxColor,
+ Color minColor, Color selMinColor, Color selMaxColor)
+ {
+ super();
+ this.no_data = no_data;
+ this.hidden = hidden;
+ this.maxColor = maxColor;
+ this.minColor = minColor;
+ this.selMinColor = selMinColor;
+ this.selMaxColor = selMaxColor;
+ }
+
+ }
+
+ final Shading shade;
+
+ /**
+ * build an EBI-AlphaFold style renderer of PAE matrices
+ *
+ * @return
+ */
+ public static ContactMapRenderer newPAERenderer()
+ {
+ return new ContactMapRenderer()
+ {
+ @Override
+ public Shading getShade()
+ {
+ return new Shading(Color.pink, Color.red,
+
+ new Color(247, 252, 245), new Color(0, 68, 28),
+ new Color(28, 0, 68), new Color(245, 247, 252));
+ }
+ };
+ }
+
+ /**
+ *
+ * @return instance of Shading used to initialise the renderer
+ */
+ public abstract Shading getShade();
+
+ public ContactMapRenderer()
+ {
+ this.shade = getShade();
+ }