import jalview.schemes.FeatureColour;
import jalview.schemes.FeatureColourTest;
import jalview.util.matcher.Condition;
+import jalview.viewmodel.seqfeatures.FeatureRendererModel;
import java.awt.Color;
import java.io.File;
/*
* set colour schemes for features
*/
- FeatureRenderer fr = af.getFeatureRenderer();
+ FeatureRendererModel fr = af.getFeatureRenderer();
// type1: red
fr.setColour("type1", new FeatureColour(Color.red));
fr.setColour("type2", byLabel);
// type3: by score above threshold
- FeatureColourI byScore = new FeatureColour(Color.BLACK, Color.BLUE, 1,
- 10);
+ FeatureColourI byScore = new FeatureColour(null, Color.BLACK,
+ Color.BLUE, null, 1, 10);
byScore.setAboveThreshold(true);
byScore.setThreshold(2f);
fr.setColour("type3", byScore);
fr.setColour("type4", byAF);
// type5: by attribute CSQ:PolyPhen below threshold
- FeatureColourI byPolyPhen = new FeatureColour(Color.BLACK, Color.BLUE,
- 1, 10);
+ FeatureColourI byPolyPhen = new FeatureColour(null, Color.BLACK,
+ Color.BLUE, null, 1, 10);
byPolyPhen.setBelowThreshold(true);
byPolyPhen.setThreshold(3f);
byPolyPhen.setAttributeName("CSQ", "PolyPhen");
@Test(groups = "Functional")
public void testGetColorTooltip() throws IOException
{
- assertNull(FeatureSettings.getColorTooltip(null));
+ assertNull(FeatureSettings.getColorTooltip(null, false));
/*
* simple colour
*/
FeatureColourI fc = new FeatureColour(Color.black);
String simpleTooltip = "Click to edit, right-click for menu";
- assertEquals(FeatureSettings.getColorTooltip(fc), simpleTooltip);
+ assertEquals(FeatureSettings.getColorTooltip(fc, true), simpleTooltip);
+ assertNull(FeatureSettings.getColorTooltip(fc, false));
/*
* graduated colour tooltip includes description of colour
*/
fc.setColourByLabel(true);
- assertEquals(FeatureSettings.getColorTooltip(fc),
+ assertEquals(FeatureSettings.getColorTooltip(fc, false),
+ "<html>By Label</html>");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"<html>By Label<br>" + simpleTooltip + "</br></html>");
/*
* graduated colour with threshold is html-encoded
*/
- fc = new FeatureColour(Color.red, Color.blue, 2f, 10f);
+ fc = new FeatureColour(null, Color.red, Color.blue, null, 2f, 10f);
fc.setBelowThreshold(true);
fc.setThreshold(4f);
- assertEquals(FeatureSettings.getColorTooltip(fc),
+ assertEquals(FeatureSettings.getColorTooltip(fc, false),
+ "<html>By Score (< 4.0)</html>");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"<html>By Score (< 4.0)<br>" + simpleTooltip
+ "</br></html>");
+
fc.setAboveThreshold(true);
- assertEquals(FeatureSettings.getColorTooltip(fc),
+ assertEquals(FeatureSettings.getColorTooltip(fc, false),
+ "<html>By Score (> 4.0)</html>");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"<html>By Score (> 4.0)<br>" + simpleTooltip
+ "</br></html>");
}