import jalview.datamodel.SequenceI;
import jalview.io.AnnotationFile;
import jalview.io.AppletFormatAdapter;
+import jalview.io.FileParse;
+import jalview.io.HtmlFile;
import jalview.io.IdentifyFile;
+import jalview.io.JSONFile;
import jalview.io.NewickFile;
import jalview.io.TCoffeeScoreFile;
import jalview.schemes.TCoffeeColourScheme;
AlignFrame alignFrame;
+ FileParse source = null;
+
public CutAndPasteTransfer(boolean forImport, AlignFrame alignFrame)
{
try
}
else if (alignFrame != null)
{
- loadAlignment(text, newWindow);
+ loadAlignment(text, newWindow, alignFrame.getAlignViewport());
}
// TODO: dialog should indicate if data was parsed correctly or not - see
* @param text
* @param newWindow
*/
- protected void loadAlignment(String text, boolean newWindow)
+ protected void loadAlignment(String text, boolean newWindow,
+ AlignViewport viewport)
{
Alignment al = null;
String format = new IdentifyFile().Identify(text,
AppletFormatAdapter.PASTE);
+ AppletFormatAdapter afa = new AppletFormatAdapter(viewport);
try
{
- al = new AppletFormatAdapter().readFile(text,
- AppletFormatAdapter.PASTE, format);
+ al = afa.readFile(text, AppletFormatAdapter.PASTE, format);
+ source = afa.getAlignFile();
} catch (java.io.IOException ex)
{
ex.printStackTrace();
af.statusBar
.setText(MessageManager
.getString("label.successfully_pasted_annotation_to_alignment"));
+
+ if (source instanceof HtmlFile)
+ {
+ ((HtmlFile) source).applySettingsToAlignmentView(af);
+ }
+ else if (source instanceof JSONFile)
+ {
+ ((JSONFile) source).applySettingsToAlignmentView(af);
+ }
}
else
{