package jalview.gui;
import jalview.api.AlignViewportI;
+import jalview.bin.Cache;
import jalview.commands.EditCommand;
import jalview.commands.EditCommand.Action;
import jalview.commands.EditCommand.Edit;
int wrappedBlock = -1;
+ /**
+ * Returns the aligned sequence position (base 0) at the mouse position, or
+ * the closest visible one
+ *
+ * @param evt
+ * @return
+ */
int findRes(MouseEvent evt)
{
int res = 0;
}
else
{
- if (x > seqCanvas.getWidth() + seqCanvas.getWidth())
+ if (x > seqCanvas.getX() + seqCanvas.getWidth())
{
// make sure we calculate relative to visible alignment, rather than
// right-hand gutter
x = seqCanvas.getX() + seqCanvas.getWidth();
}
res = (x / av.getCharWidth()) + av.getStartRes();
+ if (res > av.getEndRes())
+ {
+ // moused off right
+ res = av.getEndRes();
+ }
}
if (av.hasHiddenColumns())
@Override
public void highlightSequence(SearchResults results)
{
- if (av.followHighlight)
+ if (av.isFollowHighlight())
{
+ /*
+ * if scrollToPosition requires a scroll adjustment, this flag prevents
+ * another scroll event being propagated back to the originator
+ *
+ * @see AlignmentPanel#adjustmentValueChanged
+ */
+ ap.setFollowingComplementScroll(true);
if (ap.scrollToPosition(results, false))
{
seqCanvas.revalidate();
{
for (int j = 0; j < startres - lastres; j++)
{
- if (!jalview.util.Comparison.isGap(groupSeqs[g]
+ if (!Comparison.isGap(groupSeqs[g]
.getCharAt(fixedRight - j)))
{
blank = false;
continue;
}
- if (!jalview.util.Comparison.isGap(groupSeqs[g].getCharAt(j)))
+ if (!Comparison.isGap(groupSeqs[g].getCharAt(j)))
{
// Not a gap, block edit not valid
endEditing();
for (blankColumn = fixedColumn; blankColumn > j; blankColumn--)
{
- if (jalview.util.Comparison.isGap(seq[s].getCharAt(blankColumn)))
+ if (Comparison.isGap(seq[s].getCharAt(blankColumn)))
{
// Theres a space, so break and insert the gap
break;
}
}
- jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu(ap, null, links);
+ PopupMenu pop = new PopupMenu(ap, null, links);
pop.show(this, evt.getX(), evt.getY());
return;
}
{
if (av.getAlignment() == null)
{
- jalview.bin.Cache.log.warn("alignviewport av SeqSetId="
+ Cache.log.warn("alignviewport av SeqSetId="
+ av.getSequenceSetId() + " ViewId=" + av.getViewId()
+ " 's alignment is NULL! returning immediately.");
return;