*/
package jalview.schemes;
+import jalview.api.AlignViewportI;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AnnotatedCollectionI;
* Maps sequence positions to the RNA helix they belong to. Key: position,
* Value: helix TODO: Revise or drop in favour of annotation position numbers
*/
- public Hashtable<Integer, String> positionsToHelix = new Hashtable<Integer, String>();
+ public Hashtable<Integer, String> positionsToHelix = new Hashtable<>();
/**
* Number of helices in the RNA secondary structure
{
super(ResidueProperties.nucleotideIndex);
this.annotation = annotation;
- ColourSchemeProperty.resetRnaHelicesShading();
+ ColourSchemes.resetRnaHelicesShading();
refresh();
}
public RNAHelicesColour(AnnotatedCollectionI alignment)
{
super(ResidueProperties.nucleotideIndex);
- ColourSchemeProperty.resetRnaHelicesShading();
+ ColourSchemes.resetRnaHelicesShading();
alignmentChanged(alignment, null);
}
public void refresh()
{
- if (annotation != null
- && ((annotation._rnasecstr == null || lastrefresh != annotation._rnasecstr
- .hashCode()) && annotation.isValidStruc()))
+ if (annotation != null && ((annotation._rnasecstr == null
+ || lastrefresh != annotation._rnasecstr.hashCode())
+ && annotation.isValidStruc()))
{
annotation.getRNAStruc();
lastrefresh = annotation._rnasecstr.hashCode();
numHelix = 0;
- positionsToHelix = new Hashtable<Integer, String>();
+ positionsToHelix = new Hashtable<>();
// Figure out number of helices
// Length of rnasecstr is the number of pairs of positions that base pair
positionsToHelix.put(this.annotation._rnasecstr[x].getEnd(),
this.annotation._rnasecstr[x].getFeatureGroup());
- if (Integer.parseInt(this.annotation._rnasecstr[x]
- .getFeatureGroup()) > numHelix)
+ if (Integer.parseInt(
+ this.annotation._rnasecstr[x].getFeatureGroup()) > numHelix)
{
- numHelix = Integer.parseInt(this.annotation._rnasecstr[x]
- .getFeatureGroup());
+ numHelix = Integer.parseInt(
+ this.annotation._rnasecstr[x].getFeatureGroup());
}
}
- ColourSchemeProperty.initRnaHelicesShading(numHelix);
+ ColourSchemes.initRnaHelicesShading(numHelix);
}
}
currentHelix = positionsToHelix.get(j);
if (currentHelix != null)
{
- currentColour = ColourSchemeProperty.rnaHelices[Integer
+ currentColour = ColourSchemes.getInstance().rnaHelices[Integer
.parseInt(currentHelix)];
}
return currentColour;
}
@Override
- public ColourSchemeI getInstance(AnnotatedCollectionI sg,
- Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ public ColourSchemeI getInstance(AlignViewportI view,
+ AnnotatedCollectionI sg)
{
return new RNAHelicesColour(sg);
}
}
/*
- * check dataset
+ * not currently supporting this option for group annotation / colouring
*/
- AnnotatedCollectionI context = ac.getContext();
- if (context == null)
- {
- context = ac;
- }
- if (context instanceof AlignmentI)
- {
- return ((AlignmentI) context).hasRNAStructure();
- }
return false;
}
{
return JalviewColourScheme.RNAHelices.toString();
}
+
+ @Override
+ public boolean isSimple()
+ {
+ return false;
+ }
}