X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAlignViewport.java;h=0dcd5435597d10490726874fdff848d8710912b8;hb=567c2595554096f10feab130153f97286f3f7d80;hp=2e76e1aece976095f614ed165759c257d98c1240;hpb=8e1be43e250107a4d86898bd554cf03098fa5957;p=jalview.git diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index 2e76e1a..0dcd543 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -20,7 +20,7 @@ */ package jalview.appletgui; -import jalview.analysis.NJTree; +import jalview.analysis.TreeModel; import jalview.api.AlignViewportI; import jalview.api.FeatureSettingsModelI; import jalview.bin.JalviewLite; @@ -32,19 +32,19 @@ import jalview.datamodel.SearchResultsI; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; -import jalview.schemes.CollectionColourScheme; +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; import jalview.viewmodel.AlignmentViewport; +import jalview.viewmodel.ViewportRanges; import java.awt.Font; public class AlignViewport extends AlignmentViewport implements - SelectionSource, VamsasSource, CommandListener + SelectionSource { boolean cursorMode = false; @@ -52,7 +52,7 @@ public class AlignViewport extends AlignmentViewport implements boolean validCharWidth = true; - NJTree currentTree = null; + TreeModel currentTree = null; public jalview.bin.JalviewLite applet; @@ -75,12 +75,10 @@ public class AlignViewport extends AlignmentViewport implements calculator = new jalview.workers.AlignCalcManager(); this.applet = applet; alignment = al; + ranges = new ViewportRanges(this.alignment); // we always pad gaps this.setPadGaps(true); - this.startRes = 0; - this.endRes = al.getWidth() - 1; - this.startSeq = 0; - this.endSeq = al.getHeight() - 1; + if (applet != null) { // get the width and height scaling factors if they were specified @@ -209,17 +207,17 @@ public class AlignViewport extends AlignmentViewport implements if (colour != null) { - globalColourScheme = new CollectionColourScheme( + residueShading = new ResidueShader( ColourSchemeProperty.getColourScheme(alignment, colour)); - if (globalColourScheme != null) + if (residueShading != null) { - globalColourScheme.setConsensus(hconsensus); + residueShading.setConsensus(hconsensus); } } if (applet.getParameter("userDefinedColour") != null) { - globalColourScheme = new CollectionColourScheme( + residueShading = new ResidueShader( new UserColourScheme( applet.getParameter("userDefinedColour"))); } @@ -299,15 +297,15 @@ public class AlignViewport extends AlignmentViewport implements public void resetSeqLimits(int height) { - setEndSeq(height / getCharHeight()); + ranges.setEndSeq(height / getCharHeight()); } - public void setCurrentTree(NJTree tree) + public void setCurrentTree(TreeModel tree) { currentTree = tree; } - public NJTree getCurrentTree() + public TreeModel getCurrentTree() { return currentTree; }