- ColumnSelection colSel = ((ComplexAlignFile) source)
- .getColumnSelection();
- SequenceI[] hiddenSeqs = ((ComplexAlignFile) source)
- .getHiddenSequences();
- boolean showSeqFeatures = ((ComplexAlignFile) source)
- .isShowSeqFeatures();
- ColourSchemeI cs = ((ComplexAlignFile) source).getColourScheme();
- af = new AlignFrame(al, hiddenSeqs, colSel,
- alignFrame.viewport.applet, "Cut & Paste input - "
- + format, false);
- af.getAlignViewport().setShowSequenceFeatures(showSeqFeatures);
- af.changeColour(cs);
+ return;
+ }
+ if (newWindow)
+ {
+ AlignFrame af;
+
+ if (source instanceof ComplexAlignFile)
+ {
+ HiddenColumns colSel = ((ComplexAlignFile) source)
+ .getHiddenColumns();
+ SequenceI[] hiddenSeqs = ((ComplexAlignFile) source)
+ .getHiddenSequences();
+ boolean showSeqFeatures = ((ComplexAlignFile) source)
+ .isShowSeqFeatures();
+ String colourSchemeName = ((ComplexAlignFile) source)
+ .getGlobalColourScheme();
+ af = new AlignFrame(al, hiddenSeqs, colSel,
+ alignFrame.viewport.applet,
+ "Cut & Paste input - " + format, false);
+ af.getAlignViewport().setShowSequenceFeatures(showSeqFeatures);
+ ColourSchemeI cs = ColourSchemeMapper
+ .getJalviewColourScheme(colourSchemeName, al);
+ if (cs != null)
+ {
+ af.changeColour(cs);
+ }
+ }
+ else
+ {
+ af = new AlignFrame(al, alignFrame.viewport.applet,
+ "Cut & Paste input - " + format, false);
+ if (source instanceof FeaturesSourceI)
+ {
+ af.getAlignViewport().setShowSequenceFeatures(true);
+ }
+ }
+
+ af.statusBar.setText(MessageManager.getString(
+ "label.successfully_pasted_annotation_to_alignment"));