}
else
{
- int width = av.getAlignment().getWidth();
+ int width = av.getAlignment().getVisibleWidth();
int height = av.getAlignment().getHeight();
- if (av.hasHiddenColumns())
- {
- width = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(width);
- }
if (x < 0)
{
x = 0;
protected void drawIdsWrapped(int starty, final boolean doHiddenCheck,
boolean hiddenRows)
{
- int maxwidth = av.getAlignment().getWidth();
+ int maxwidth = av.getAlignment().getVisibleWidth();
int alheight = av.getAlignment().getHeight();
- if (av.hasHiddenColumns())
- {
- maxwidth = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(maxwidth) - 1;
- }
-
int annotationHeight = 0;
AnnotationLabels labels = null;
.visibleToAbsoluteColumn(endx);
}
- int maxwidth = av.getAlignment().getWidth();
- if (av.hasHiddenColumns())
- {
- maxwidth = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(maxwidth) - 1;
- }
-
// WEST SCALE
for (int i = 0; i < av.getAlignment().getHeight(); i++)
{
int endx;
int ypos = hgap;
- int maxwidth = av.getAlignment().getWidth();
-
- if (av.hasHiddenColumns())
- {
- maxwidth = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(maxwidth);
- }
+ int maxwidth = av.getAlignment().getVisibleWidth();
while ((ypos <= canvasHeight) && (startRes < maxwidth))
{
int blockEnd;
HiddenColumns hidden = av.getAlignment().getHiddenColumns();
- VisibleContigsIterator regions = (VisibleContigsIterator) hidden
+ VisibleContigsIterator regions = hidden
.getVisContigsIterator(startRes, endRes + 1, true);
while (regions.hasNext())
}
else
{
- int width = av.getAlignment().getWidth();
+ int width = av.getAlignment().getVisibleWidth();
int height = av.getAlignment().getHeight();
- if (av.hasHiddenColumns())
- {
- // reset the width to exclude hidden columns
- width = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(width);
- }
-
hextent = getSeqPanel().seqCanvas.getWidth() / av.getCharWidth();
vextent = getSeqPanel().seqCanvas.getHeight() / av.getCharHeight();
int totalSeq = (pageHeight - scaleHeight) / charHeight - 1;
- int alignmentWidth = av.getAlignment().getWidth();
+ int alignmentWidth = av.getAlignment().getVisibleWidth();
int pagesWide = (alignmentWidth / totalRes) + 1;
final int startRes = (pi % pagesWide) * totalRes;
int idWidth = getVisibleIdWidth(false);
- int maxwidth = av.getAlignment().getWidth();
- if (av.hasHiddenColumns())
- {
- maxwidth = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(maxwidth) - 1;
- }
+ int maxwidth = av.getAlignment().getVisibleWidth();
int resWidth = getSeqPanel().seqCanvas
.getWrappedCanvasWidth(pwidth - idWidth);
public AlignmentDimension getAlignmentDimension()
{
- int maxwidth = av.getAlignment().getWidth();
- if (av.hasHiddenColumns())
- {
- maxwidth = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(maxwidth);
- }
+ int maxwidth = av.getAlignment().getVisibleWidth();
int height = ((av.getAlignment().getHeight() + 1) * av.getCharHeight())
+ getScalePanel().getHeight();
*/
protected void drawIdsWrapped(int starty, boolean hasHiddenRows)
{
- int maxwidth = av.getAlignment().getWidth();
+ int maxwidth = av.getAlignment().getVisibleWidth();
int alheight = av.getAlignment().getHeight();
- if (av.hasHiddenColumns())
- {
- maxwidth = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(maxwidth) - 1;
- }
-
int annotationHeight = 0;
if (av.isShowAnnotation())
int startx = startRes;
int endx;
int ypos = hgap; // vertical offset
- int maxwidth = av.getAlignment().getWidth();
-
- if (av.hasHiddenColumns())
- {
- maxwidth = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(maxwidth);
- }
+ int maxwidth = av.getAlignment().getVisibleWidth();
// chop the wrapped alignment extent up into panel-sized blocks and treat
// each block as if it were a block from an unwrapped alignment
*/
public int getVisibleAlignmentWidth()
{
- return al.getWidth() - al.getHiddenColumns().getSize();
+ return al.getVisibleWidth();
}
/**
assertEquals(".JKLMNO", seq2.getSequenceAsString());
assertEquals(".PQR...", seq3.getSequenceAsString());
}
+
+ @Test(groups = { "Functional" })
+ public void testGetWidth()
+ {
+ SequenceI seq1 = new Sequence("seq1", "ABCDEF--");
+ SequenceI seq2 = new Sequence("seq2", "-JKLMNO--");
+ SequenceI seq3 = new Sequence("seq2", "-PQR");
+ AlignmentI a = new Alignment(new SequenceI[] { seq1, seq2, seq3 });
+
+ assertEquals(9, a.getWidth());
+
+ // width includes hidden columns
+ a.getHiddenColumns().hideColumns(2, 5);
+ assertEquals(9, a.getWidth());
+ }
+
+ @Test(groups = { "Functional" })
+ public void testGetVisibleWidth()
+ {
+ SequenceI seq1 = new Sequence("seq1", "ABCDEF--");
+ SequenceI seq2 = new Sequence("seq2", "-JKLMNO--");
+ SequenceI seq3 = new Sequence("seq2", "-PQR");
+ AlignmentI a = new Alignment(new SequenceI[] { seq1, seq2, seq3 });
+
+ assertEquals(9, a.getVisibleWidth());
+
+ // width excludes hidden columns
+ a.getHiddenColumns().hideColumns(2, 5);
+ assertEquals(5, a.getVisibleWidth());
+ }
}