JAL-4375 Add an AnnotationColouringI interface, and generic AnnotationColouringRanges...
[jalview.git] / src / jalview / datamodel / annotations / AnnotationColouringI.java
diff --git a/src/jalview/datamodel/annotations/AnnotationColouringI.java b/src/jalview/datamodel/annotations/AnnotationColouringI.java
new file mode 100644 (file)
index 0000000..83ea2eb
--- /dev/null
@@ -0,0 +1,27 @@
+package jalview.datamodel.annotations;
+
+import java.awt.Color;
+import java.util.List;
+import java.util.Map;
+
+public interface AnnotationColouringI
+{
+  /**
+   * Return the colour associated with this value
+   * 
+   * @param val
+   * @return
+   */
+  public Color valueToColour(float val);
+
+  /**
+   * Given two values, val1 and val2, returns a list of (float,Color) pairs (as
+   * Map.Entry objects). The float is a proportional distance (should start with
+   * 0 and end with 1) and the Color is the color change from that point.
+   * 
+   * @param val1
+   * @param val2
+   * @return
+   */
+  public List<Map.Entry<Float, Color>> rangeColours(float val1, float val2);
+}