X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fappletgui%2FAlignViewport.java;h=f927e638c2d175394f06716bdfd85be15627e36a;hb=571d15a897c11bdc2dda76ce03686604596f220d;hp=7ef2d59c3fd8c0eb6a7d041578400a2ad05eb0c7;hpb=ce2fafc54fbec56f100776d81e26fa146ee7d7a1;p=jalview.git diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index 7ef2d59..f927e63 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -22,17 +22,19 @@ package jalview.appletgui; import jalview.analysis.NJTree; import jalview.api.AlignViewportI; +import jalview.api.FeatureSettingsModelI; import jalview.bin.JalviewLite; import jalview.commands.CommandI; import jalview.datamodel.AlignmentI; import jalview.datamodel.ColumnSelection; import jalview.datamodel.SearchResults; +import jalview.datamodel.SearchResultsI; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; +import jalview.renderer.ResidueShader; import jalview.schemes.ColourSchemeProperty; import jalview.schemes.UserColourScheme; -import jalview.structure.CommandListener; import jalview.structure.SelectionSource; import jalview.structure.StructureSelectionManager; import jalview.structure.VamsasSource; @@ -41,7 +43,7 @@ import jalview.viewmodel.AlignmentViewport; import java.awt.Font; public class AlignViewport extends AlignmentViewport implements - SelectionSource, VamsasSource, CommandListener + SelectionSource { boolean cursorMode = false; @@ -57,6 +59,7 @@ public class AlignViewport extends AlignmentViewport implements private AnnotationColumnChooser annotationColumnSelectionState; + @Override public void finalize() { applet = null; @@ -73,10 +76,10 @@ public class AlignViewport extends AlignmentViewport implements alignment = al; // we always pad gaps this.setPadGaps(true); - this.startRes = 0; - this.endRes = al.getWidth() - 1; - this.startSeq = 0; - this.endSeq = al.getHeight() - 1; + this.setStartRes(0); + this.setEndRes(al.getWidth() - 1); + this.setStartSeq(0); + this.setEndSeq(al.getHeight() - 1); if (applet != null) { // get the width and height scaling factors if they were specified @@ -205,18 +208,19 @@ public class AlignViewport extends AlignmentViewport implements if (colour != null) { - globalColourScheme = ColourSchemeProperty.getColour(alignment, - colour); - if (globalColourScheme != null) + residueShading = new ResidueShader( + ColourSchemeProperty.getColourScheme(alignment, colour)); + if (residueShading != null) { - globalColourScheme.setConsensus(hconsensus); + residueShading.setConsensus(hconsensus); } } if (applet.getParameter("userDefinedColour") != null) { - ((UserColourScheme) globalColourScheme).parseAppletParameter(applet - .getParameter("userDefinedColour")); + residueShading = new ResidueShader( + new UserColourScheme( + applet.getParameter("userDefinedColour"))); } } initAutoAnnotation(); @@ -325,6 +329,7 @@ public class AlignViewport extends AlignmentViewport implements return followSelection; } + @Override public void sendSelection() { getStructureSelectionManager().sendSelection( @@ -345,39 +350,7 @@ public class AlignViewport extends AlignmentViewport implements .getStructureSelectionManager(applet); } - /** - * synthesize a column selection if none exists so it covers the given - * selection group. if wholewidth is false, no column selection is made if the - * selection group covers the whole alignment width. - * - * @param sg - * @param wholewidth - */ - public void expandColSelection(SequenceGroup sg, boolean wholewidth) - { - int sgs, sge; - if (sg != null - && (sgs = sg.getStartRes()) >= 0 - && sg.getStartRes() <= (sge = sg.getEndRes()) - && (colSel == null || colSel.getSelected() == null || colSel - .getSelected().size() == 0)) - { - if (!wholewidth && alignment.getWidth() == (1 + sge - sgs)) - { - // do nothing - return; - } - if (colSel == null) - { - colSel = new ColumnSelection(); - } - for (int cspos = sg.getStartRes(); cspos <= sg.getEndRes(); cspos++) - { - colSel.addElement(cspos); - } - } - } - + @Override public boolean isNormaliseSequenceLogo() { return normaliseSequenceLogo; @@ -392,6 +365,7 @@ public class AlignViewport extends AlignmentViewport implements * * @return true if alignment characters should be displayed */ + @Override public boolean isValidCharWidth() { return validCharWidth; @@ -461,7 +435,7 @@ public class AlignViewport extends AlignmentViewport implements * there is no complement, or it is not following highlights, or no mapping * is found, the result will be empty. */ - SearchResults sr = new SearchResults(); + SearchResultsI sr = new SearchResults(); int seqOffset = findComplementScrollTarget(sr); if (!sr.isEmpty()) { @@ -470,4 +444,18 @@ public class AlignViewport extends AlignmentViewport implements } } + /** + * Applies the supplied feature settings descriptor to currently known + * features. This supports an 'initial configuration' of feature colouring + * based on a preset or user favourite. This may then be modified in the usual + * way using the Feature Settings dialogue. + * + * @param featureSettings + */ + @Override + public void applyFeaturesStyle(FeatureSettingsModelI featureSettings) + { + // TODO implement for applet + } + }