{
return;
}
-
- SequenceI [] seqs = viewport.getSelectionAsNewSequence();
+ // TODO: preserve the ordering of displayed alignment annotation in any internal paste (particularly sequence associated annotation)
+ SequenceI [] seqs = viewport.getSelectionAsNewSequence();
String[] omitHidden = null;
if (viewport.hasHiddenColumns)
sequences = alignment.getSequencesArray();
}
+ int alwidth=0;
if (newAlignment)
{
-
+
if (Desktop.jalviewClipboard != null)
{
// dataset is inherited
// new dataset is constructed
alignment.setDataset(null);
}
+ alwidth = alignment.getWidth()+1;
}
else
{
AlignmentI pastedal = alignment; // preserve pasted alignment object
// Add pasted sequences and dataset into existing alignment.
alignment = viewport.getAlignment();
+ alwidth = alignment.getWidth()+1;
// decide if we need to import sequences from an existing dataset
boolean importDs = Desktop.jalviewClipboard != null
&& Desktop.jalviewClipboard[1] != alignment.getDataset();
// an existing alignment
Vector newDs = (importDs) ? new Vector() : null; // used to create
// minimum dataset set
-
+
for (int i = 0; i < sequences.length; i++)
{
- if (importDs)
+ if (importDs)
{
newDs.addElement(null);
}
{
if (!newDs.contains(ds))
{
- newDs.setElementAt(ds, i);
+ newDs.setElementAt(ds, i);
ds = new Sequence(ds);
// update with new dataset sequence
sequences[i].setDatasetSequence(ds);
{
annotationAdded=true;
if (alann[i].sequenceRef==null && !alann[i].autoCalculated) {
- alignment.addAnnotation(new AlignmentAnnotation(alann[i]));
+ AlignmentAnnotation newann = new AlignmentAnnotation(alann[i]);
+ newann.padAnnotation(alwidth);
+ alignment.addAnnotation(newann);
}
}
}
{
annotationAdded=true;
sequences[i].getAnnotation()[a].adjustForAlignment();
+ sequences[i].getAnnotation()[a].padAnnotation(alwidth);
alignment.addAnnotation(sequences[i].getAnnotation()[a]); // annotation was duplicated earlier
alignment.setAnnotationIndex(sequences[i].getAnnotation()[a], a);
}
-
+
}
}
if (!newAlignment) {
//>>>This is a fix for the moment, until a better solution is found!!<<<
af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().transferSettings(
alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
-
+
// TODO: maintain provenance of an alignment, rather than just make the title a concatenation of operations.
if (!externalPaste) {
if (title.startsWith("Copied sequences"))