protected AlignmentViewport av;
+ /*
+ * map holds per feature type, {{min, max}, {min, max}} feature score
+ * values for positional and non-positional features respectively
+ */
+ private Map<String, float[][]> minmax = new Hashtable<String, float[][]>();
+
@Override
public AlignViewportI getViewport()
{
renderOrder = neworder;
}
- protected Hashtable minmax = new Hashtable();
-
- public Hashtable getMinMax()
+ public Map<String, float[][]> getMinMax()
{
return minmax;
}
*/
protected final byte[] normaliseScore(SequenceFeature sequenceFeature)
{
- float[] mm = ((float[][]) minmax.get(sequenceFeature.type))[0];
+ float[] mm = minmax.get(sequenceFeature.type)[0];
final byte[] r = new byte[] { 0, (byte) 255 };
if (mm != null)
{
}
if (minmax == null)
{
- minmax = new Hashtable();
+ minmax = new Hashtable<String, float[][]>();
}
AlignmentI alignment = av.getAlignment();
for (int i = 0; i < alignment.getHeight(); i++)
if (!Float.isNaN(features[index].score))
{
int nonpos = features[index].getBegin() >= 1 ? 0 : 1;
- float[][] mm = (float[][]) minmax.get(features[index].getType());
+ float[][] mm = minmax.get(features[index].getType());
if (mm == null)
{
mm = new float[][] { null, null };
}
/**
- * return a nominal colour for this feature
- *
- * @param featureType
- * @return standard color, or maximum colour for graduated colourscheme
- */
- public Color getColour(String featureType)
- {
- Object fc = getFeatureStyle(featureType);
-
- if (fc instanceof Color)
- {
- return (Color) fc;
- }
- else
- {
- if (fc instanceof GraduatedColor)
- {
- return ((GraduatedColor) fc).getMaxColor();
- }
- }
- throw new Error("Implementation Error: Unrecognised render object "
- + fc.getClass() + " for features of type " + featureType);
- }
-
- /**
* calculate the render colour for a specific feature using current feature
* settings.
*
changeSupport.removePropertyChangeListener(listener);
}
- public Set getAllFeatureColours()
+ public Set<String> getAllFeatureColours()
{
return featureColours.keySet();
}
return renderOrder != null;
}
+ /**
+ * Returns feature types in ordering of rendering, where last means on top
+ */
public List<String> getRenderOrder()
{
if (renderOrder == null)
while (en.hasNext())
{
String col = en.next();
- fcols.put(col, getColour(col));
+ fcols.put(col, featureColours.get(col));
}
return fcols;
}