*/
package jalview.viewmodel;
-import jalview.api.AlignViewportI;
import jalview.datamodel.AlignmentI;
/**
// 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;
this.startSeq = 0;
this.endSeq = alignment.getHeight() - 1;
this.al = alignment;
- this.av = viewport;
}
// ways to update values
{
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;
- }
-
}