2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.viewmodel;
23 import jalview.datamodel.AlignmentI;
26 * Supplies and updates viewport properties relating to position such as: start
27 * and end residues and sequences, hidden column/row adjustments, etc
29 public class ViewportPositionProps extends ViewportProperties
31 // start residue of viewport
34 // end residue of viewport
37 // start sequence of viewport
40 // end sequence of viewport
44 private AlignmentI al;
48 * @param alignment TODO
50 public ViewportPositionProps(AlignmentI alignment)
52 // initial values of viewport settings
54 this.endRes = alignment.getWidth() - 1;
56 this.endSeq = alignment.getHeight() - 1;
60 // ways to update values
62 // ways to notify of changes
64 // ways to supply positional information
67 * Get alignment width in cols, including hidden cols
69 public int getAbsoluteAlignmentWidth()
75 * Get alignment height in rows, including hidden rows
77 public int getAbsoluteAlignmentHeight()
79 return al.getHeight() + al.getHiddenSequences().getSize();
82 public void setStartRes(int res)
84 if (res > al.getWidth() - 1)
86 res = al.getWidth() - 1;
95 public void setEndRes(int res)
97 if (res > al.getWidth())
108 public void setStartSeq(int seq)
110 if (seq > al.getHeight() - 1)
112 seq = al.getHeight() - 1;
121 public void setEndSeq(int seq)
123 if (seq > al.getHeight())
125 seq = al.getHeight();
135 * Get start residue of viewport
137 public int getStartRes()
143 * Get end residue of viewport
145 public int getEndRes()
151 * Get start sequence of viewport
153 public int getStartSeq()
159 * Get end sequence of viewport
161 public int getEndSeq()