From 3ac211a6636821af226745459dcd3d5128ef0eaa Mon Sep 17 00:00:00 2001 From: kiramt Date: Mon, 6 Mar 2017 16:23:53 +0000 Subject: [PATCH] JAL-2388 Dependency tidy --- src/jalview/gui/AlignViewport.java | 2 +- src/jalview/viewmodel/ViewportPositionProps.java | 66 +--------------------- 2 files changed, 2 insertions(+), 66 deletions(-) diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 5c264c0..b64d98e 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -310,7 +310,7 @@ public class AlignViewport extends AlignmentViewport implements residueShading.setConsensus(hconsensus); } - posProps = new ViewportPositionProps(this.alignment, this); + posProps = new ViewportPositionProps(this.alignment); } /** diff --git a/src/jalview/viewmodel/ViewportPositionProps.java b/src/jalview/viewmodel/ViewportPositionProps.java index 176da8a..69a60f5 100644 --- a/src/jalview/viewmodel/ViewportPositionProps.java +++ b/src/jalview/viewmodel/ViewportPositionProps.java @@ -20,7 +20,6 @@ */ package jalview.viewmodel; -import jalview.api.AlignViewportI; import jalview.datamodel.AlignmentI; /** @@ -44,15 +43,11 @@ public class ViewportPositionProps extends ViewportProperties // alignment private AlignmentI al; - // viewport - private AlignViewportI av; // this is a bad dependency, viewmodel should not - // depend on api - /** * Constructor * @param alignment TODO */ - public ViewportPositionProps(AlignmentI alignment, AlignViewportI viewport) + public ViewportPositionProps(AlignmentI alignment) { // initial values of viewport settings this.startRes = 0; @@ -60,7 +55,6 @@ public class ViewportPositionProps extends ViewportProperties this.startSeq = 0; this.endSeq = alignment.getHeight() - 1; this.al = alignment; - this.av = viewport; } // ways to update values @@ -168,62 +162,4 @@ public class ViewportPositionProps extends ViewportProperties { return endSeq; } - - /** - * Get absolute start residue of viewport - */ - public int getAbsoluteStartRes() - { - int start = startRes; - - if (av.hasHiddenColumns()) - { - start = av.getColumnSelection().adjustForHiddenColumns(start); - } - return start; - } - - /** - * Get absolute start residue of viewport - */ - public int getAbsoluteEndRes() - { - int end = endRes; - - if (av.hasHiddenColumns()) - { - end = av.getColumnSelection().adjustForHiddenColumns(end); - } - return end; - } - - /** - * Get absolute start sequence of viewport - */ - public int getAbsoluteStartSeq() - { - int start = startSeq; - - if (av.hasHiddenRows()) - { - start = av.getAlignment().getHiddenSequences() - .adjustForHiddenSeqs(start); - } - return start; - } - - /** - * Get absolute end sequence of viewport - */ - public int getAbsoluteEndSeq() - { - int end = endSeq; - - if (av.hasHiddenRows()) - { - end = av.getAlignment().getHiddenSequences().adjustForHiddenSeqs(end); - } - return end; - } - } -- 1.7.10.2