showAnnotation = Cache.getDefault("SHOW_ANNOTATIONS", true);
rightAlignIds = Cache.getDefault("RIGHT_ALIGN_IDS", false);
-
+ centreColumnLabels = Cache.getDefault("CENTRE_COLUMN_LABELS", false);
autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true);
padGaps = Cache.getDefault("PAD_GAPS", true);
boolean updatingConsensus = false;
boolean updatingConservation = false;
+ /**
+ * centre columnar annotation labels in displayed alignment annotation
+ * TODO: add to jalviewXML and annotation display settings
+ */
+ boolean centreColumnLabels=false;
/**
- * DOCUMENT ME!
+ * trigger update of conservation annotation
*/
public void updateConservation(final AlignmentPanel ap)
{
}
/**
- * DOCUMENT ME!
+ * trigger update of consensus annotation
*/
public void updateConsensus(final AlignmentPanel ap)
{
try
{
- int aWidth = alignment.getWidth();
+ int aWidth = (alignment!=null) ? alignment.getWidth() : 0; // null pointer possibility here.
if(aWidth<0)
{
return;
public void invertColumnSelection()
{
- for(int i=0; i<alignment.getWidth(); i++)
- {
- if(colSel.contains(i))
- {
- colSel.removeElement(i);
- }
- else
- {
- if (!hasHiddenColumns || colSel.isVisible(i))
- {
- colSel.addElement(i);
- }
- }
- }
+ colSel.invertColumnSelection(0,alignment.getWidth());
}
public int adjustForHiddenSeqs(int alignmentIndex)
* derived from the whole alignment or just the current
* selection with start and end points adjusted
* @note if you need references to the actual SequenceI objects in the alignment or currently selected then use getSequenceSelection()
- * @return String[]
+ * @return selection as new sequenceI objects
*/
public SequenceI[] getSelectionAsNewSequence()
{
return sequences;
}
+
/**
* get the currently selected sequence objects or all the sequences in the alignment.
* @return array of references to sequence objects
}
return false;
}
+
+ public boolean getCentreColumnLabels()
+ {
+ return centreColumnLabels;
+ }
+ public void setCentreColumnLabels(boolean centrecolumnlabels)
+ {
+ centreColumnLabels = centrecolumnlabels;
+ }
+ public void updateSequenceIdColours()
+ {
+ Vector groups = alignment.getGroups();
+ if (sequenceColours==null)
+ {
+ sequenceColours = new Hashtable();
+ }
+ for (int ig=0,igSize=groups.size(); ig<igSize; ig++)
+ {
+ SequenceGroup sg = (SequenceGroup) groups.elementAt(ig);
+ if (sg.idColour!=null)
+ {
+ Vector sqs = sg.getSequences(hiddenRepSequences);
+ for (int s=0,sSize=sqs.size();s<sSize;s++)
+ {
+ sequenceColours.put(sqs.elementAt(s), sg.idColour);
+ }
+ }
+ }
+ }
}