From 8146bb79670cfec703d7a7e04f1ae2e0318bd938 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 10 Jul 2015 06:15:19 +0100 Subject: [PATCH] JAL-1807 explicit imports (jalview.javascript) --- src/jalview/javascript/JalviewLiteJsApi.java | 2 +- src/jalview/javascript/JsCallBack.java | 4 +++- src/jalview/javascript/JsSelectionSender.java | 12 +++++----- src/jalview/javascript/MouseOverListener.java | 7 +++--- .../javascript/MouseOverStructureListener.java | 23 ++++++++++---------- 5 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/jalview/javascript/JalviewLiteJsApi.java b/src/jalview/javascript/JalviewLiteJsApi.java index 51f6741..77908fd 100644 --- a/src/jalview/javascript/JalviewLiteJsApi.java +++ b/src/jalview/javascript/JalviewLiteJsApi.java @@ -250,7 +250,7 @@ public interface JalviewLiteJsApi /** * get alignment as format (format names FASTA, BLC, CLUSTAL, MSF, PILEUP, - * PFAM - see jalview.io.AppletFormatAdapter for full list) + * PFAM - see AppletFormatAdapter for full list) * * @param format * @return diff --git a/src/jalview/javascript/JsCallBack.java b/src/jalview/javascript/JsCallBack.java index 76d6e8d..7c05be8 100644 --- a/src/jalview/javascript/JsCallBack.java +++ b/src/jalview/javascript/JsCallBack.java @@ -20,9 +20,11 @@ */ package jalview.javascript; +import jalview.appletgui.AlignFrame; + public interface JsCallBack { - public jalview.appletgui.AlignFrame getAlignFrame(); + public AlignFrame getAlignFrame(); public String getListenerFunction(); diff --git a/src/jalview/javascript/JsSelectionSender.java b/src/jalview/javascript/JsSelectionSender.java index e4a0916..a028f61 100644 --- a/src/jalview/javascript/JsSelectionSender.java +++ b/src/jalview/javascript/JsSelectionSender.java @@ -21,13 +21,15 @@ package jalview.javascript; import jalview.appletgui.AlignFrame; +import jalview.appletgui.AlignViewport; import jalview.bin.JalviewLite; import jalview.datamodel.ColumnSelection; import jalview.datamodel.SequenceGroup; +import jalview.structure.SelectionListener; import jalview.structure.SelectionSource; public class JsSelectionSender extends JSFunctionExec implements - jalview.structure.SelectionListener, JsCallBack + SelectionListener, JsCallBack { AlignFrame _af; @@ -54,11 +56,11 @@ public class JsSelectionSender extends JSFunctionExec implements AlignFrame src = _af; if (source != null) { - if (source instanceof jalview.appletgui.AlignViewport - && ((jalview.appletgui.AlignViewport) source).applet.currentAlignFrame.viewport == source) + if (source instanceof AlignViewport + && ((AlignViewport) source).applet.currentAlignFrame.viewport == source) { // should be valid if it just generated an event! - src = ((jalview.appletgui.AlignViewport) source).applet.currentAlignFrame; + src = ((AlignViewport) source).applet.currentAlignFrame; } } @@ -95,7 +97,7 @@ public class JsSelectionSender extends JSFunctionExec implements for (int i = 0; i < cols.length; i++) { cols[i] = "" - + (1 + ((Integer) colsel.getSelected().elementAt(i)) + + (1 + colsel.getSelected().elementAt(i) .intValue()); } } diff --git a/src/jalview/javascript/MouseOverListener.java b/src/jalview/javascript/MouseOverListener.java index 9d0279b..8fd48d6 100644 --- a/src/jalview/javascript/MouseOverListener.java +++ b/src/jalview/javascript/MouseOverListener.java @@ -21,6 +21,7 @@ package jalview.javascript; import jalview.appletgui.AlignFrame; +import jalview.appletgui.AlignViewport; import jalview.bin.JalviewLite; import jalview.datamodel.SequenceI; import jalview.structure.VamsasListener; @@ -53,11 +54,11 @@ public class MouseOverListener extends JSFunctionExec implements { if (source != null) { - if (source instanceof jalview.appletgui.AlignViewport - && ((jalview.appletgui.AlignViewport) source).applet.currentAlignFrame.viewport == source) + if (source instanceof AlignViewport + && ((AlignViewport) source).applet.currentAlignFrame.viewport == source) { // should be valid if it just generated an event! - src = ((jalview.appletgui.AlignViewport) source).applet.currentAlignFrame; + src = ((AlignViewport) source).applet.currentAlignFrame; } // TODO: ensure that if '_af' is specified along with a handler diff --git a/src/jalview/javascript/MouseOverStructureListener.java b/src/jalview/javascript/MouseOverStructureListener.java index 4b1c9ce..dfe5c4f 100644 --- a/src/jalview/javascript/MouseOverStructureListener.java +++ b/src/jalview/javascript/MouseOverStructureListener.java @@ -20,13 +20,11 @@ */ package jalview.javascript; -import java.util.ArrayList; -import java.util.List; - import jalview.api.AlignmentViewPanel; import jalview.api.FeatureRenderer; import jalview.api.SequenceRenderer; import jalview.appletgui.AlignFrame; +import jalview.appletgui.AlignmentPanel; import jalview.bin.JalviewLite; import jalview.datamodel.SequenceI; import jalview.ext.jmol.JmolCommands; @@ -36,6 +34,9 @@ import jalview.structure.StructureMapping; import jalview.structure.StructureMappingcommandSet; import jalview.structure.StructureSelectionManager; +import java.util.ArrayList; +import java.util.List; + /** * Propagate events involving PDB structures associated with sequences to a * javascript function. Generally, the javascript handler is called with a @@ -177,7 +178,7 @@ public class MouseOverStructureListener extends JSFunctionExec implements // { // ssm.reportMapping(); // } - if (source instanceof jalview.api.AlignmentViewPanel) + if (source instanceof AlignmentViewPanel) { SequenceI[][] sequence = new SequenceI[modelSet.length][]; for (int m = 0; m < modelSet.length; m++) @@ -202,15 +203,15 @@ public class MouseOverStructureListener extends JSFunctionExec implements // } } - SequenceRenderer sr = ((jalview.appletgui.AlignmentPanel) source) + SequenceRenderer sr = ((AlignmentPanel) source) .getSequenceRenderer(); - FeatureRenderer fr = ((jalview.appletgui.AlignmentPanel) source).av + FeatureRenderer fr = ((AlignmentPanel) source).av .isShowSequenceFeatures() ? new jalview.appletgui.FeatureRenderer( - ((jalview.appletgui.AlignmentPanel) source).av) : null; + ((AlignmentPanel) source).av) : null; if (fr != null) { ((jalview.appletgui.FeatureRenderer) fr) - .transferSettings(((jalview.appletgui.AlignmentPanel) source) + .transferSettings(((AlignmentPanel) source) .getFeatureRenderer()); } ; @@ -227,7 +228,7 @@ public class MouseOverStructureListener extends JSFunctionExec implements return; } int sz = 0; - for (jalview.structure.StructureMappingcommandSet ccset : colcommands) + for (StructureMappingcommandSet ccset : colcommands) { sz += ccset.commands.length; ccomands.add(ccset.commands); @@ -244,7 +245,7 @@ public class MouseOverStructureListener extends JSFunctionExec implements } if (jvlite.isJsMessageSetChanged( mclass = "colourstruct", - mhandle = ((jalview.appletgui.AlignmentPanel) source).av + mhandle = ((AlignmentPanel) source).av .getViewId(), ccomandset)) { jvlite.setJsMessageSet(mclass, mhandle, ccomandset); @@ -252,7 +253,7 @@ public class MouseOverStructureListener extends JSFunctionExec implements String st[] = new String[] { "colourstruct", - "" + ((jalview.appletgui.AlignmentPanel) source).av.getViewId(), + "" + ((AlignmentPanel) source).av.getViewId(), "" + ccomandset.length, jvlite.arrayToSeparatorList(pdbfn.toArray(new String[pdbfn .size()])) }; -- 1.7.10.2