/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
* Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
if (av.hasHiddenColumns)
{
- res = av.getColumnSelection().adjustForHiddenColumns(x);
+ x = av.getColumnSelection().adjustForHiddenColumns(x);
+ }
+
+ if (x >= av.alignment.getWidth())
+ {
+ res = av.alignment.getWidth() - 1;
}
else
{
iVec = null;
sg.setStartRes(res);
sg.setEndRes(res);
- av.setSelectionGroup(sg);
if (evt.isShiftDown())
{
sg.setStartRes(min);
sg.setEndRes(max);
}
-
+ av.setSelectionGroup(sg);
}
ap.paintAlignment(false);
int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();
- if (res > av.alignment.getWidth())
+ if (av.hasHiddenColumns)
{
- res = av.alignment.getWidth() - 1;
+ res = av.getColumnSelection().adjustForHiddenColumns(res);
}
- if (av.hasHiddenColumns)
+ if (res >= av.alignment.getWidth())
{
- res = av.getColumnSelection().adjustForHiddenColumns(res);
+ res = av.alignment.getWidth() - 1;
}
if (!stretchingGroup)
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
- if (res > av.alignment.getWidth())
+ if (res >= av.alignment.getWidth())
{
res = av.alignment.getWidth() - 1;
}
int col;
for (int i = min; i <= max; i++)
{
- col = av.getColumnSelection().adjustForHiddenColumns(i);
+ col = i; // av.getColumnSelection().adjustForHiddenColumns(i);
if ((col < sg.getStartRes()) || (col > sg.getEndRes()))
{
{
reveal = region;
ToolTipManager.sharedInstance().registerComponent(this);
- this
- .setToolTipText("Reveal Hidden Columns with Right Mouse Button");
+ this.setToolTipText("Reveal Hidden Columns with Right Mouse Button");
break;
}
else
// Fill the selected columns
ColumnSelection cs = av.getColumnSelection();
+ int s;
if (cs != null)
{
gg.setColor(new Color(220, 0, 0));
int sel = cs.columnAt(i);
if (av.hasHiddenColumns)
{
- sel = cs.findColumnPosition(sel);
+ if (cs.isVisible(sel))
+ {
+ sel = cs.findColumnPosition(sel);
+ }
+ else
+ {
+ continue;
+ }
}
if ((sel >= startx) && (sel <= endx))
maxX = (i - startx + 1) * av.charWidth + fm.stringWidth(string);
}
- gg
- .drawLine(
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + 2,
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + (fm.getDescent() * 2));
+ gg.drawLine(
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + 2,
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + (fm.getDescent() * 2));
}
else
{
- gg
- .drawLine(
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + fm.getDescent(),
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + (fm.getDescent() * 2));
+ gg.drawLine(
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + fm.getDescent(),
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + (fm.getDescent() * 2));
}
}