From: kiramt Date: Thu, 16 Mar 2017 13:32:40 +0000 (+0000) Subject: JAL-2388 Renamed viewport position props to viewport ranges X-Git-Tag: Release_2_10_2~3^2~92^2~34 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9201765247470c08d366abef2713c1c736adf2cb;p=jalview.git JAL-2388 Renamed viewport position props to viewport ranges --- diff --git a/src/jalview/api/AlignViewportI.java b/src/jalview/api/AlignViewportI.java index 6cdc998..c6312ab 100644 --- a/src/jalview/api/AlignViewportI.java +++ b/src/jalview/api/AlignViewportI.java @@ -33,7 +33,7 @@ import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.renderer.ResidueShaderI; import jalview.schemes.ColourSchemeI; -import jalview.viewmodel.ViewportPositionProps; +import jalview.viewmodel.ViewportRanges; import java.awt.Color; import java.util.Hashtable; @@ -47,7 +47,7 @@ import java.util.Map; public interface AlignViewportI extends ViewStyleI { - ViewportPositionProps getPosProps(); + ViewportRanges getRanges(); int getEndRes(); diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index f5d6ce7..30817d5 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -39,7 +39,7 @@ import jalview.structure.SelectionSource; import jalview.structure.StructureSelectionManager; import jalview.structure.VamsasSource; import jalview.viewmodel.AlignmentViewport; -import jalview.viewmodel.ViewportPositionProps; +import jalview.viewmodel.ViewportRanges; import java.awt.Font; @@ -75,13 +75,10 @@ public class AlignViewport extends AlignmentViewport implements calculator = new jalview.workers.AlignCalcManager(); this.applet = applet; alignment = al; - posProps = new ViewportPositionProps(this.alignment); + ranges = new ViewportRanges(this.alignment); // we always pad gaps this.setPadGaps(true); - 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 diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java index dd7c8fa..e864337 100644 --- a/src/jalview/appletgui/AlignmentPanel.java +++ b/src/jalview/appletgui/AlignmentPanel.java @@ -724,7 +724,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, { x = 0; } - ; + hextent = seqPanel.seqCanvas.getSize().width / av.getCharWidth(); vextent = seqPanel.seqCanvas.getSize().height / av.getCharHeight(); @@ -763,14 +763,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, } av.setStartSeq(y); - - int endSeq = y + vextent; - if (endSeq > av.getAlignment().getHeight()) - { - endSeq = av.getAlignment().getHeight(); - } - - av.setEndSeq(endSeq); + av.setEndSeq(y + vextent); av.setStartRes(x); av.setEndRes((x + (seqPanel.seqCanvas.getSize().width / av .getCharWidth())) - 1); diff --git a/src/jalview/appletgui/OverviewPanel.java b/src/jalview/appletgui/OverviewPanel.java index 1d11b67..e2d986e 100755 --- a/src/jalview/appletgui/OverviewPanel.java +++ b/src/jalview/appletgui/OverviewPanel.java @@ -76,7 +76,7 @@ public class OverviewPanel extends Panel implements Runnable, sr.forOverview = true; fr = new FeatureRenderer(av); - od = new OverviewDimensions(av.getPosProps(), av.isShowAnnotation()); + od = new OverviewDimensions(av.getRanges(), av.isShowAnnotation()); setSize(new Dimension(od.getWidth(), od.getHeight())); addComponentListener(new ComponentAdapter() @@ -143,7 +143,7 @@ public class OverviewPanel extends Panel implements Runnable, { od.updateViewportFromMouse(evt.getX(), evt.getY(), av.getAlignment() .getHiddenSequences(), av.getColumnSelection(), av - .getPosProps()); + .getRanges()); ap.setScrollValues(od.getScrollCol(), od.getScrollRow()); ap.paintAlignment(false); } @@ -339,7 +339,7 @@ public class OverviewPanel extends Panel implements Runnable, public void setBoxPosition() { od.setBoxPosition(av.getAlignment() - .getHiddenSequences(), av.getColumnSelection(), av.getPosProps()); + .getHiddenSequences(), av.getColumnSelection(), av.getRanges()); repaint(); } diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 598bd69..11321eb 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -51,7 +51,7 @@ import jalview.structure.StructureSelectionManager; import jalview.structure.VamsasSource; import jalview.util.MessageManager; import jalview.viewmodel.AlignmentViewport; -import jalview.viewmodel.ViewportPositionProps; +import jalview.viewmodel.ViewportRanges; import jalview.ws.params.AutoCalcSetting; import java.awt.Container; @@ -238,7 +238,7 @@ public class AlignViewport extends AlignmentViewport implements void init() { - posProps = new ViewportPositionProps(this.alignment); + ranges = new ViewportRanges(this.alignment); applyViewProperties(); String fontName = Cache.getDefault("FONT_NAME", "SansSerif"); diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 2c77942..1c49b8a 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -89,7 +89,7 @@ public class OverviewPanel extends JPanel implements Runnable sr.forOverview = true; fr = new FeatureRenderer(alPanel); - od = new OverviewDimensions(av.getPosProps(), av.isShowAnnotation()); + od = new OverviewDimensions(av.getRanges(), av.isShowAnnotation()); addComponentListener(new ComponentAdapter() { @@ -113,7 +113,7 @@ public class OverviewPanel extends JPanel implements Runnable { od.updateViewportFromMouse(evt.getX(), evt.getY(), av .getAlignment().getHiddenSequences(), av - .getColumnSelection(), av.getPosProps()); + .getColumnSelection(), av.getRanges()); ap.setScrollValues(od.getScrollCol(), od.getScrollRow()); } } @@ -128,7 +128,7 @@ public class OverviewPanel extends JPanel implements Runnable { od.updateViewportFromMouse(evt.getX(), evt.getY(), av .getAlignment().getHiddenSequences(), av - .getColumnSelection(), av.getPosProps()); + .getColumnSelection(), av.getRanges()); ap.setScrollValues(od.getScrollCol(), od.getScrollRow()); } } @@ -327,7 +327,7 @@ public class OverviewPanel extends JPanel implements Runnable public void setBoxPosition() { od.setBoxPosition(av.getAlignment() - .getHiddenSequences(), av.getColumnSelection(), av.getPosProps()); + .getHiddenSequences(), av.getColumnSelection(), av.getRanges()); repaint(); } diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 47f7d9d..1f91935 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -78,7 +78,7 @@ import java.util.Map; public abstract class AlignmentViewport implements AlignViewportI, CommandListener, VamsasSource { - protected ViewportPositionProps posProps; + protected ViewportRanges ranges; protected ViewStyleI viewStyle = new ViewStyle(); @@ -2647,54 +2647,53 @@ public abstract class AlignmentViewport implements AlignViewportI, } @Override - public ViewportPositionProps getPosProps() + public ViewportRanges getRanges() { - return posProps; + return ranges; } @Override public int getStartRes() { - return posProps.getStartRes(); + return ranges.getStartRes(); } @Override public int getEndRes() { - return posProps.getEndRes(); + return ranges.getEndRes(); } @Override public int getStartSeq() { - return posProps.getStartSeq(); + return ranges.getStartSeq(); } public void setStartRes(int res) { - posProps.setStartRes(res); - // this.startRes = res; + ranges.setStartRes(res); } public void setStartSeq(int seq) { - posProps.setStartSeq(seq); + ranges.setStartSeq(seq); } public void setEndRes(int res) { - posProps.setEndRes(res); + ranges.setEndRes(res); } public void setEndSeq(int seq) { - posProps.setEndSeq(seq); + ranges.setEndSeq(seq); } @Override public int getEndSeq() { - return posProps.getEndSeq(); + return ranges.getEndSeq(); } /** diff --git a/src/jalview/viewmodel/OverviewDimensions.java b/src/jalview/viewmodel/OverviewDimensions.java index b34c85d..1e9eaf7 100644 --- a/src/jalview/viewmodel/OverviewDimensions.java +++ b/src/jalview/viewmodel/OverviewDimensions.java @@ -69,24 +69,24 @@ public class OverviewDimensions /** * Create an OverviewDimensions object * - * @param props + * @param ranges * positional properties of the viewport * @param showAnnotationPanel * true if the annotation panel is to be shown, false otherwise */ - public OverviewDimensions(ViewportPositionProps props, + public OverviewDimensions(ViewportRanges ranges, boolean showAnnotationPanel) { // scale the initial size of overviewpanel to shape of alignment - float initialScale = (float) props.getAbsoluteAlignmentWidth() - / (float) props.getAbsoluteAlignmentHeight(); + float initialScale = (float) ranges.getAbsoluteAlignmentWidth() + / (float) ranges.getAbsoluteAlignmentHeight(); if (!showAnnotationPanel) { graphHeight = 0; } - if (props.getAbsoluteAlignmentWidth() > props + if (ranges.getAbsoluteAlignmentWidth() > ranges .getAbsoluteAlignmentHeight()) { // wider @@ -121,18 +121,18 @@ public class OverviewDimensions * hidden sequences * @param hiddenCols * hidden columns - * @param props + * @param ranges * viewport position properties */ public void updateViewportFromMouse(int mousex, int mousey, HiddenSequences hiddenSeqs, ColumnSelection hiddenCols, - ViewportPositionProps props) + ViewportRanges ranges) { int x = mousex; int y = mousey; - int alwidth = props.getAbsoluteAlignmentWidth(); - int alheight = props.getAbsoluteAlignmentHeight(); + int alwidth = ranges.getAbsoluteAlignmentWidth(); + int alheight = ranges.getAbsoluteAlignmentHeight(); if (x < 0) { @@ -156,7 +156,7 @@ public class OverviewDimensions int xAsRes = Math.round((float) x * alwidth / width); // get viewport width in residues - int vpwidth = props.getEndRes() - props.getStartRes() + 1; + int vpwidth = ranges.getEndRes() - ranges.getStartRes() + 1; // get where x should be when accounting for hidden cols // if x is in a hidden col region, shift to left - but we still need @@ -191,7 +191,7 @@ public class OverviewDimensions // get viewport height in sequences // add 1 because height includes both endSeq and startSeq - int vpheight = props.getEndSeq() - props.getStartSeq() + 1; + int vpheight = ranges.getEndSeq() - ranges.getStartSeq() + 1; // get where y should be when accounting for hidden rows // if y is in a hidden row region, shift up - but we still need absolute @@ -231,22 +231,22 @@ public class OverviewDimensions * hidden sequences * @param hiddenCols * hidden columns - * @param props + * @param ranges * viewport position properties */ public void setBoxPosition(HiddenSequences hiddenSeqs, - ColumnSelection hiddenCols, ViewportPositionProps props) + ColumnSelection hiddenCols, ViewportRanges ranges) { - int alwidth = props.getAbsoluteAlignmentWidth(); - int alheight = props.getAbsoluteAlignmentHeight(); + int alwidth = ranges.getAbsoluteAlignmentWidth(); + int alheight = ranges.getAbsoluteAlignmentHeight(); // work with absolute values of startRes and endRes - int startRes = hiddenCols.adjustForHiddenColumns(props.getStartRes()); - int endRes = hiddenCols.adjustForHiddenColumns(props.getEndRes()); + int startRes = hiddenCols.adjustForHiddenColumns(ranges.getStartRes()); + int endRes = hiddenCols.adjustForHiddenColumns(ranges.getEndRes()); // work with absolute values of startSeq and endSeq - int startSeq = hiddenSeqs.adjustForHiddenSeqs(props.getStartSeq()); - int endSeq = hiddenSeqs.adjustForHiddenSeqs(props.getEndSeq()); + int startSeq = hiddenSeqs.adjustForHiddenSeqs(ranges.getStartSeq()); + int endSeq = hiddenSeqs.adjustForHiddenSeqs(ranges.getEndSeq()); // boxX, boxY is the x,y location equivalent to startRes, startSeq boxX = Math.round((float) startRes * width / alwidth); diff --git a/src/jalview/viewmodel/ViewportPositionProps.java b/src/jalview/viewmodel/ViewportRanges.java similarity index 89% rename from src/jalview/viewmodel/ViewportPositionProps.java rename to src/jalview/viewmodel/ViewportRanges.java index 61dd18c..5c8cdb6 100644 --- a/src/jalview/viewmodel/ViewportPositionProps.java +++ b/src/jalview/viewmodel/ViewportRanges.java @@ -23,10 +23,11 @@ package jalview.viewmodel; import jalview.datamodel.AlignmentI; /** - * Supplies and updates viewport properties relating to position such as: start - * and end residues and sequences + * Embryonic class which: Supplies and updates viewport properties relating to + * position such as: start and end residues and sequences; ideally will serve + * hidden columns/rows too */ -public class ViewportPositionProps extends ViewportProperties +public class ViewportRanges extends ViewportProperties { // start residue of viewport private int startRes; @@ -49,7 +50,7 @@ public class ViewportPositionProps extends ViewportProperties * @param alignment * the viewport's alignment */ - public ViewportPositionProps(AlignmentI alignment) + public ViewportRanges(AlignmentI alignment) { // initial values of viewport settings this.startRes = 0; @@ -59,12 +60,6 @@ public class ViewportPositionProps extends ViewportProperties this.al = alignment; } - // ways to update values - - // ways to notify of changes - - // ways to supply positional information - /** * Get alignment width in cols, including hidden cols */ @@ -112,9 +107,9 @@ public class ViewportPositionProps extends ViewportProperties { res = al.getWidth() - 1; } - else if (res < 1) + else if (res < 0) { - res = 1; + res = 0; } this.endRes = res; } @@ -150,9 +145,9 @@ public class ViewportPositionProps extends ViewportProperties { seq = al.getHeight() - 1; } - else if (seq < 1) + else if (seq < 0) { - seq = 1; + seq = 0; } this.endSeq = seq; } diff --git a/test/jalview/viewmodel/OverviewDimensionsTest.java b/test/jalview/viewmodel/OverviewDimensionsTest.java index a1d9f31..398fec3 100644 --- a/test/jalview/viewmodel/OverviewDimensionsTest.java +++ b/test/jalview/viewmodel/OverviewDimensionsTest.java @@ -52,7 +52,7 @@ public class OverviewDimensionsTest int alheight; int alwidth; - ViewportPositionProps posProps; + ViewportRanges vpranges; Hashtable hiddenRepSequences = new Hashtable(); @@ -75,33 +75,33 @@ public class OverviewDimensionsTest } hiddenCols.revealAllHiddenColumns(); - posProps = new ViewportPositionProps(al); - posProps.setStartRes(0); - posProps.setEndRes(62); - posProps.setStartSeq(0); - posProps.setEndSeq(17); + vpranges = new ViewportRanges(al); + vpranges.setStartRes(0); + vpranges.setEndRes(62); + vpranges.setStartSeq(0); + vpranges.setEndSeq(17); - viewHeight = posProps.getEndSeq() - posProps.getStartSeq() + 1; - viewWidth = posProps.getEndRes() - posProps.getStartRes() + 1; + viewHeight = vpranges.getEndSeq() - vpranges.getStartSeq() + 1; + viewWidth = vpranges.getEndRes() - vpranges.getStartRes() + 1; ColumnSelection hiddenCols = new ColumnSelection(); - od = new OverviewDimensions(posProps, true); + od = new OverviewDimensions(vpranges, true); // Initial box sizing - default path through code - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); mouseClick(od, 0, 0); moveViewport(0, 0); // calculate before hidden columns so we get absolute values - alheight = posProps.getAbsoluteAlignmentHeight(); - alwidth = posProps.getAbsoluteAlignmentWidth(); + alheight = vpranges.getAbsoluteAlignmentHeight(); + alwidth = vpranges.getAbsoluteAlignmentWidth(); - boxWidth = Math.round((float) (posProps.getEndRes() - - posProps.getStartRes() + 1) + boxWidth = Math.round((float) (vpranges.getEndRes() + - vpranges.getStartRes() + 1) * od.getWidth() / alwidth); - boxHeight = Math.round((float) (posProps.getEndSeq() - - posProps.getStartSeq() + 1) + boxHeight = Math.round((float) (vpranges.getEndSeq() + - vpranges.getStartSeq() + 1) * od.getSequencesHeight() / alheight); } @@ -134,7 +134,7 @@ public class OverviewDimensionsTest // test for alignment with width > height SequenceI[] seqs1 = new SequenceI[] { seqa, seqb }; Alignment al1 = new Alignment(seqs1); - ViewportPositionProps props = new ViewportPositionProps(al1); + ViewportRanges props = new ViewportRanges(al1); OverviewDimensions od = new OverviewDimensions(props, true); int scaledHeight = 267; @@ -146,7 +146,7 @@ public class OverviewDimensionsTest // test for alignment with width < height SequenceI[] seqs2 = new SequenceI[] { seqa, seqb, seqc, seqd }; Alignment al2 = new Alignment(seqs2); - props = new ViewportPositionProps(al2); + props = new ViewportRanges(al2); od = new OverviewDimensions(props, true); int scaledWidth = 300; @@ -159,7 +159,7 @@ public class OverviewDimensionsTest // min value SequenceI[] seqs3 = new SequenceI[] { seqe }; Alignment al3 = new Alignment(seqs3); - props = new ViewportPositionProps(al3); + props = new ViewportRanges(al3); od = new OverviewDimensions(props, true); assertEquals(od.getGraphHeight(), defaultGraphHeight); @@ -171,7 +171,7 @@ public class OverviewDimensionsTest SequenceI[] seqs4 = new SequenceI[] { seqa, seqb, seqc, seqd, seqa, seqb, seqc, seqd, seqa, seqb, seqc, seqd, seqa, seqb, seqc, seqd }; Alignment al4 = new Alignment(seqs4); - props = new ViewportPositionProps(al4); + props = new ViewportRanges(al4); od = new OverviewDimensions(props, true); assertEquals(od.getGraphHeight(), defaultGraphHeight); @@ -180,7 +180,7 @@ public class OverviewDimensionsTest assertEquals(od.getHeight(), maxSeqHeight + defaultGraphHeight); Alignment al5 = new Alignment(seqs4); - props = new ViewportPositionProps(al5); + props = new ViewportRanges(al5); od = new OverviewDimensions(props, false); assertEquals(od.getGraphHeight(), 0); @@ -198,7 +198,7 @@ public class OverviewDimensionsTest public void testSetBoxFromMouseClick() { od.updateViewportFromMouse(0, 0, al.getHiddenSequences(), hiddenCols, - posProps); + vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); assertEquals(od.getBoxWidth(), boxWidth); @@ -297,7 +297,7 @@ public class OverviewDimensionsTest public void testFromMouseWithHiddenColsAtStart() { od.updateViewportFromMouse(0, 0, al.getHiddenSequences(), hiddenCols, - posProps); + vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); assertEquals(od.getBoxWidth(), boxWidth); @@ -309,7 +309,7 @@ public class OverviewDimensionsTest int lastHiddenCol = 30; hiddenCols.hideColumns(0, lastHiddenCol); - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); assertEquals(od.getBoxX(), Math.round((float) (lastHiddenCol + 1) * od.getWidth() / alwidth)); @@ -362,7 +362,7 @@ public class OverviewDimensionsTest public void testFromMouseWithHiddenColsInMiddle() { od.updateViewportFromMouse(0, 0, al.getHiddenSequences(), hiddenCols, - posProps); + vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); assertEquals(od.getBoxWidth(), boxWidth); @@ -374,7 +374,7 @@ public class OverviewDimensionsTest int lastHidden = 73; hiddenCols.hideColumns(firstHidden, lastHidden); - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); assertEquals(od.getBoxWidth(), boxWidth); @@ -464,7 +464,7 @@ public class OverviewDimensionsTest public void testFromMouseWithHiddenColsAtEnd() { od.updateViewportFromMouse(0, 0, al.getHiddenSequences(), hiddenCols, - posProps); + vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); assertEquals(od.getBoxWidth(), boxWidth); @@ -475,7 +475,7 @@ public class OverviewDimensionsTest int firstHidden = 140; int lastHidden = 164; hiddenCols.hideColumns(firstHidden, lastHidden); - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); assertEquals(od.getBoxWidth(), boxWidth); @@ -791,7 +791,7 @@ public class OverviewDimensionsTest public void testFromMouseWithHiddenRowsAtStart() { od.updateViewportFromMouse(0, 0, al.getHiddenSequences(), hiddenCols, - posProps); + vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); assertEquals(od.getBoxHeight(), boxHeight); @@ -804,7 +804,7 @@ public class OverviewDimensionsTest int lastHiddenRow = 30; hideSequences(0, lastHiddenRow); - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), Math.round((float) (lastHiddenRow + 1) @@ -838,7 +838,7 @@ public class OverviewDimensionsTest public void testFromMouseWithHiddenRowsInMiddle() { od.updateViewportFromMouse(0, 0, al.getHiddenSequences(), hiddenCols, - posProps); + vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); @@ -853,7 +853,7 @@ public class OverviewDimensionsTest int lastHiddenRow = 54; hideSequences(firstHiddenRow, lastHiddenRow); - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); @@ -897,7 +897,7 @@ public class OverviewDimensionsTest public void testFromMouseWithHiddenRowsAtEnd() { od.updateViewportFromMouse(0, 0, al.getHiddenSequences(), hiddenCols, - posProps); + vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); assertEquals(od.getBoxWidth(), boxWidth); @@ -911,7 +911,7 @@ public class OverviewDimensionsTest int lastHidden = 524; hideSequences(firstHidden, lastHidden); - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); assertEquals(od.getBoxX(), 0); assertEquals(od.getBoxY(), 0); assertEquals(od.getBoxWidth(), boxWidth); @@ -958,9 +958,9 @@ public class OverviewDimensionsTest */ private void moveViewportH(int startRes) { - posProps.setStartRes(startRes); - posProps.setEndRes(startRes + viewWidth - 1); - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + vpranges.setStartRes(startRes); + vpranges.setEndRes(startRes + viewWidth - 1); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); } /* @@ -968,9 +968,9 @@ public class OverviewDimensionsTest */ private void moveViewportV(int startSeq) { - posProps.setStartSeq(startSeq); - posProps.setEndSeq(startSeq + viewHeight - 1); - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + vpranges.setStartSeq(startSeq); + vpranges.setEndSeq(startSeq + viewHeight - 1); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); } /* @@ -978,11 +978,11 @@ public class OverviewDimensionsTest */ private void moveViewport(int startRes, int startSeq) { - posProps.setStartRes(startRes); - posProps.setEndRes(startRes + viewWidth - 1); - posProps.setStartSeq(startSeq); - posProps.setEndSeq(startSeq + viewHeight - 1); - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + vpranges.setStartRes(startRes); + vpranges.setEndRes(startRes + viewWidth - 1); + vpranges.setStartSeq(startSeq); + vpranges.setEndSeq(startSeq + viewHeight - 1); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); } /* @@ -991,17 +991,17 @@ public class OverviewDimensionsTest private void mouseClick(OverviewDimensions od, int x, int y) { od.updateViewportFromMouse(x, y, al.getHiddenSequences(), hiddenCols, - posProps); + vpranges); // updates require an OverviewPanel to exist which it doesn't here // so call setBoxPosition() as it would be called by the AlignmentPanel // normally - posProps.setStartRes(od.getScrollCol()); - posProps.setEndRes(od.getScrollCol() + viewWidth - 1); - posProps.setStartSeq(od.getScrollRow()); - posProps.setEndSeq(od.getScrollRow() + viewHeight - 1); - od.setBoxPosition(al.getHiddenSequences(), hiddenCols, posProps); + vpranges.setStartRes(od.getScrollCol()); + vpranges.setEndRes(od.getScrollCol() + viewWidth - 1); + vpranges.setStartSeq(od.getScrollRow()); + vpranges.setEndSeq(od.getScrollRow() + viewHeight - 1); + od.setBoxPosition(al.getHiddenSequences(), hiddenCols, vpranges); } /*