- /*
- * by RGB triplet
- */
- String rgb = String.format("%d,%d,%d", Color.red.getRed(),
- Color.red.getGreen(), Color.red.getBlue());
- assertEquals(Color.RED, UserColourScheme.getColourFromString(rgb));
+ @Test(groups = "Functional")
+ public void testToAppletParameter()
+ {
+ UserColourScheme cs = new UserColourScheme(
+ "E,D=red; K,R,H=0022FF; c=10 , 20,30");
+ String param = cs.toAppletParameter();
+ assertEquals("D,E=ff0000;H,K,R=0022ff;c=0a141e", param);
+ }
+
+ /**
+ * Test for user colour scheme constructed with a colour per residue,
+ * including gap. Note this can currently be done from the User Defined
+ * Colours dialog, but not by parsing a colours parameter, as
+ * parseAppletParameter only recognises amino acid codes.
+ */
+ @Test(groups = "Functional")
+ public void testConstructor_coloursArray()
+ {
+ Color g = Color.green;
+ Color y = Color.yellow;
+ Color b = Color.blue;
+ Color r = Color.red;
+ // colours for ARNDCQEGHILKMFPSTWYVBZ and gap
+ Color[] colours = new Color[] { g, y, b, r, g, y, r, b, g, y, r, b, g,
+ y, r, b, g, y, r, b, g, y, r, g };
+ UserColourScheme cs = new UserColourScheme(colours);