git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2835 support filter/colour by nested attribute names
[jalview.git]
/
src
/
jalview
/
schemes
/
FeatureColour.java
diff --git
a/src/jalview/schemes/FeatureColour.java
b/src/jalview/schemes/FeatureColour.java
index
df4ea39
..
71a89b0
100644
(file)
--- a/
src/jalview/schemes/FeatureColour.java
+++ b/
src/jalview/schemes/FeatureColour.java
@@
-78,10
+78,10
@@
public class FeatureColour implements FeatureColourI
private boolean colourByLabel;
/*
private boolean colourByLabel;
/*
- * if not null, the value of this named attribute is used for
- * colourByLabel or graduatedColour
+ * if not null, the value of [attribute, [sub-attribute] ...]
+ * is used for colourByLabel or graduatedColour
*/
*/
- private String byAttributeName;
+ private String[] attributeName;
private float threshold;
private float threshold;
@@
-371,7
+371,7
@@
public class FeatureColour implements FeatureColourI
base = fc.base;
range = fc.range;
isHighToLow = fc.isHighToLow;
base = fc.base;
range = fc.range;
isHighToLow = fc.isHighToLow;
- byAttributeName = fc.byAttributeName;
+ attributeName = fc.attributeName;
setAboveThreshold(fc.isAboveThreshold());
setBelowThreshold(fc.isBelowThreshold());
setThreshold(fc.getThreshold());
setAboveThreshold(fc.isAboveThreshold());
setBelowThreshold(fc.isBelowThreshold());
setThreshold(fc.getThreshold());
@@
-389,7
+389,6
@@
public class FeatureColour implements FeatureColourI
public FeatureColour(FeatureColour fc, float min, float max)
{
this(fc);
public FeatureColour(FeatureColour fc, float min, float max)
{
this(fc);
- setGraduatedColour(true);
updateBounds(min, max);
}
updateBounds(min, max);
}
@@
-594,8
+593,8
@@
public class FeatureColour implements FeatureColourI
{
if (isColourByLabel())
{
{
if (isColourByLabel())
{
- String label = byAttributeName == null ? feature.getDescription()
- : feature.getValueAsString(byAttributeName);
+ String label = attributeName == null ? feature.getDescription()
+ : feature.getValueAsString(attributeName);
return label == null ? noColour : ColorUtils
.createColourFromName(label);
}
return label == null ? noColour : ColorUtils
.createColourFromName(label);
}
@@
-612,11
+611,11
@@
public class FeatureColour implements FeatureColourI
* no such attribute is assigned the 'no value' colour
*/
float scr = feature.getScore();
* no such attribute is assigned the 'no value' colour
*/
float scr = feature.getScore();
- if (byAttributeName != null)
+ if (attributeName != null)
{
try
{
{
try
{
- String attVal = feature.getValueAsString(byAttributeName);
+ String attVal = feature.getValueAsString(attributeName);
scr = Float.valueOf(attVal);
} catch (Throwable e)
{
scr = Float.valueOf(attVal);
} catch (Throwable e)
{
@@
-747,19
+746,19
@@
public class FeatureColour implements FeatureColourI
@Override
public boolean isColourByAttribute()
{
@Override
public boolean isColourByAttribute()
{
- return byAttributeName != null;
+ return attributeName != null;
}
@Override
}
@Override
- public String getAttributeName()
+ public String[] getAttributeName()
{
{
- return byAttributeName;
+ return attributeName;
}
@Override
}
@Override
- public void setAttributeName(String name)
+ public void setAttributeName(String... name)
{
{
- byAttributeName = name;
+ attributeName = name;
}
}
}
}