From: amwaterhouse Date: Tue, 29 Aug 2006 15:22:15 +0000 (+0000) Subject: jnetfile can be loaded onto alignment X-Git-Tag: Release_2_1_1~31 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=174a67aba96e55fdfbd4f33dfe4e658d790fc5c2;p=jalview.git jnetfile can be loaded onto alignment --- 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