From 174a67aba96e55fdfbd4f33dfe4e658d790fc5c2 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 29 Aug 2006 15:22:15 +0000 Subject: [PATCH] jnetfile can be loaded onto alignment --- src/jalview/gui/AlignFrame.java | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index cd26b17..807b6e3 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -2818,17 +2818,35 @@ public void drop(DropTargetDropEvent evt) public void loadJalviewDataFile(String file) { try{ + String protocol = "File"; + + if (file.indexOf("http:") > -1 || file.indexOf("file:") > -1) + { + protocol = "URL"; + } + boolean isAnnotation = new AnnotationFile().readAnnotationFile(viewport. alignment, file); if (!isAnnotation) { - boolean isGroupsFile = parseFeaturesFile(file, - AppletFormatAdapter.FILE); + boolean isGroupsFile = parseFeaturesFile(file,protocol); if (!isGroupsFile) { - String format = new IdentifyFile().Identify(file, FormatAdapter.FILE); - new FileLoader().LoadFile(viewport, file, FormatAdapter.FILE, format); + String format = new IdentifyFile().Identify(file, protocol); + + if(format.equalsIgnoreCase("JnetFile")) + { + jalview.io.JPredFile predictions = new jalview.io.JPredFile( + file, protocol); + new JnetAnnotationMaker().add_annotation(predictions, + viewport.getAlignment(), + 0, false); + alignPanel.adjustAnnotationHeight(); + alignPanel.repaint(); + } + else + new FileLoader().LoadFile(viewport, file, protocol, format); } } else -- 1.7.10.2