From: hansonr Date: Thu, 16 May 2019 05:17:03 +0000 (-0500) Subject: Jalview-JS/JAL-3253 applet params jpredfile, jnetfile X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b01da42ba5fdeacaa224dc4cbbaed5f3a09be912;p=jalview.git Jalview-JS/JAL-3253 applet params jpredfile, jnetfile debug comments out, fixes for missing annotation file post-load tasks --- diff --git a/src/jalview/api/FeatureRenderer.java b/src/jalview/api/FeatureRenderer.java index 404c497..6caa1c7 100644 --- a/src/jalview/api/FeatureRenderer.java +++ b/src/jalview/api/FeatureRenderer.java @@ -125,7 +125,7 @@ public interface FeatureRenderer List getFeatureGroups(); /** - * get groups that are visible/invisible + * get groups that are visible/invisible -- JalviewLite only? * * @param visible * @return @@ -133,7 +133,7 @@ public interface FeatureRenderer List getGroups(boolean visible); /** - * Set visibility for a list of groups + * Set visibility for a list of groups -- JalviewLite only? * * @param toset * @param visible diff --git a/src/jalview/api/JalviewApp.java b/src/jalview/api/JalviewApp.java index 1d67bc2..7215227 100644 --- a/src/jalview/api/JalviewApp.java +++ b/src/jalview/api/JalviewApp.java @@ -26,7 +26,7 @@ public interface JalviewApp public void alignedStructureView(PDBEntry[] pdb, SequenceI[][] seqs, String[][] chains, String[] protocols); - public void updateForLoader(); + public void updateForAnnotations(); public AlignViewportI getViewport(); diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 402f9bf..7bf0c72 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -1177,13 +1177,18 @@ public class Jalview implements ApplicationSingletonI return id + (frameType == null ? "" : "-" + frameType); } + /** + * Handle all JalviewLite applet parameters + * + * @param aparser + * @param af + */ private void loadAppletParams(ArgsParser aparser, AlignFrame af) { Jalview me = this; JalviewApp app = new JalviewApp() { - @Override public String getParameter(String name) { @@ -1198,12 +1203,18 @@ public class Jalview implements ApplicationSingletonI : "true".equalsIgnoreCase(stn)); } + /** + * Get the applet-like document base even though this is an application. + */ @Override public URL getDocumentBase() { return Platform.getDocumentBase(); } + /** + * Get the applet-like code base even though this is an application. + */ @Override public URL getCodeBase() { @@ -1216,6 +1227,21 @@ public class Jalview implements ApplicationSingletonI return Jalview.getCurrentAlignFrame().getViewport(); } + /** + * features + * + */ + @Override + public boolean parseFeaturesFile(String filename, + DataSourceType protocol) + { + return af.parseFeaturesFile(filename, protocol); + } + + /** + * scorefile + * + */ @Override public boolean loadScoreFile(String sScoreFile) throws IOException { @@ -1224,18 +1250,21 @@ public class Jalview implements ApplicationSingletonI return true; } + /** + * annotations, jpredfile, jnetfile + * + */ @Override - public boolean parseFeaturesFile(String filename, - DataSourceType protocol) + public void updateForAnnotations() { - return af.parseFeaturesFile(filename, protocol); + Jalview.getCurrentAlignFrame().updateForAnnotations(); } @Override public void loadTree(NewickFile fin, String treeFile) throws IOException { - // n/a -- already done + // n/a -- already done by standard Jalview command line processing } @Override @@ -1262,13 +1291,6 @@ public class Jalview implements ApplicationSingletonI } @Override - public void updateForLoader() - { - // TODO Auto-generated method stub - - } - - @Override public void setFeatureGroupState(String[] groups, boolean state) { // TODO Auto-generated method stub diff --git a/src/jalview/bin/JalviewAppLoader.java b/src/jalview/bin/JalviewAppLoader.java index 194d619..4ac4ffd 100644 --- a/src/jalview/bin/JalviewAppLoader.java +++ b/src/jalview/bin/JalviewAppLoader.java @@ -260,7 +260,7 @@ public class JalviewAppLoader app.getViewport().getAlignment(), 0, false); // false == do not add sequence profile from concise output app.getViewport().getAlignment().setupJPredAlignment(); - app.updateForLoader(); + app.updateForAnnotations(); result = true; } catch (Exception ex) { @@ -290,7 +290,7 @@ public class JalviewAppLoader if (new AnnotationFile().annotateAlignmentView(app.getViewport(), param, protocol)) { - app.updateForLoader(); + app.updateForAnnotations(); result = true; } else diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 5cb599f..8c251cc 100644 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -2484,7 +2484,7 @@ public class JalviewLite extends Applet } @Override - public void updateForLoader() + public void updateForAnnotations() { loaderFrame.alignPanel.fontChanged(); loaderFrame.alignPanel.setScrollValues(0, 0); diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 343dfbe..f2b790d 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -4805,11 +4805,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } if (isAnnotation) { - - alignPanel.adjustAnnotationHeight(); - viewport.updateSequenceIdColours(); - buildSortByAnnotationScoresMenu(); - alignPanel.paintAlignment(true, true); + updateForAnnotations(); } } catch (Exception ex) { @@ -4838,6 +4834,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } /** + * Do all updates necessary after an annotation file such as jnet. Also called + * from Jalview.loadAppletParams for "annotations", "jnetFile" + */ + public void updateForAnnotations() + { + alignPanel.adjustAnnotationHeight(); + viewport.updateSequenceIdColours(); + buildSortByAnnotationScoresMenu(); + alignPanel.paintAlignment(true, true); + } + + /** * Method invoked by the ChangeListener on the tabbed pane, in other words * when a different tabbed pane is selected by the user or programmatically. */