int seqOffset = findComplementScrollTarget(sr);
if (!sr.isEmpty())
{
- complementPanel.setFollowingComplementScroll(false);
+ complementPanel.setToScrollComplementPanel(false);
complementPanel.scrollToCentre(sr, seqOffset);
- complementPanel.setFollowingComplementScroll(true);
+ complementPanel.setToScrollComplementPanel(true);
}
}
}
vpRanges.setViewportStartAndWidth(x, width);
- if (av.getWrapAlignment() || !fastPaint || av.MAC)
+ if (av.getWrapAlignment() || !fastPaint)
{
repaint();
}
}
vpRanges.setViewportStartAndHeight(offy, height);
}
- if (av.getWrapAlignment() || !fastPaint || av.MAC)
+ if (av.getWrapAlignment() || !fastPaint)
{
repaint();
}
/*
* Flag set while scrolling to follow complementary cDNA/protein scroll. When
- * true, suppresses invoking the same method recursively.
+ * false, suppresses invoking the same method recursively.
*/
- private boolean followingComplementScroll = true;
+ private boolean scrollComplementaryPanel = true;
private void jbInit() throws Exception
{
*
* @param b
*/
- protected void setFollowingComplementScroll(boolean b)
+ protected void setToScrollComplementPanel(boolean b)
{
- this.followingComplementScroll = b;
+ this.scrollComplementaryPanel = b;
}
- protected boolean isFollowingComplementScroll()
+ protected boolean isSetToScrollComplementPanel()
{
- return this.followingComplementScroll;
+ return this.scrollComplementaryPanel;
}
@Override
// now update any complementary alignment (its viewport ranges object
// is different so does not get automatically updated)
- if (isFollowingComplementScroll())
+ if (isSetToScrollComplementPanel())
{
- setFollowingComplementScroll(false);
+ setToScrollComplementPanel(false);
av.scrollComplementaryAlignment(getComplementPanel());
- setFollowingComplementScroll(true);
+ setToScrollComplementPanel(true);
}
}
od.updateViewportFromMouse(evt.getX(), evt.getY(), av.getAlignment()
.getHiddenSequences(), av.getColumnSelection(), av
.getRanges());
- ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
+ // ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
ap.paintAlignment(false);
}
// panel,as this sets up a feedback loop (scrolling panel 1 causes moused
// over residue to change abruptly, causing highlighted residue in panel 2
// to change, causing a scroll in panel 1 etc)
- ap.setFollowingComplementScroll(false);
+ ap.setToScrollComplementPanel(false);
if (ap.scrollToPosition(results, true))
{
ap.alignFrame.repaint();
}
- ap.setFollowingComplementScroll(true);
+ ap.setToScrollComplementPanel(true);
}
setStatusMessage(results);
seqCanvas.highlightSearchResults(results);
// TODO would like next line without cast but needs more refactoring...
final AlignmentPanel complementPanel = ((AlignViewport) getCodingComplement())
.getAlignPanel();
- complementPanel.setDontScrollComplement(true);
+ complementPanel.setToScrollComplementPanel(false);
complementPanel.scrollToCentre(sr, verticalOffset);
- complementPanel.setDontScrollComplement(false);
+ complementPanel.setToScrollComplementPanel(true);
}
}
/*
* Flag set while scrolling to follow complementary cDNA/protein scroll. When
- * true, suppresses invoking the same method recursively.
+ * false, suppresses invoking the same method recursively.
*/
- private boolean dontScrollComplement = false;
+ private boolean scrollComplementaryPanel = true;
private PropertyChangeListener propertyChangeListener;
@Override
public void run()
{
- setScrollValues(vpRanges.getStartRes(), vpRanges.getStartSeq());
+ // When updating scrolling to use ViewportChange events, this code
+ // could not be validated and it is not clear if it is now being
+ // called. Log warning here in case it is called and unforeseen
+ // problems occur
+ Cache.log
+ .warn("Unexpected path through code: Wrapped jar file opened with wrap alignment set in preferences");
+
+ // scroll to start of panel
+ vpRanges.setStartRes(0);
+ vpRanges.setStartSeq(0);
}
});
}
*
* @param b
*/
- protected void setDontScrollComplement(boolean b)
+ protected void setToScrollComplementPanel(boolean b)
{
- this.dontScrollComplement = b;
+ this.scrollComplementaryPanel = b;
}
- protected boolean isDontScrollComplement()
+ protected boolean isSetToScrollComplementPanel()
{
- return this.dontScrollComplement;
+ return this.scrollComplementaryPanel;
}
/**
// now update any complementary alignment (its viewport ranges object
// is different so does not get automatically updated)
- if (!isDontScrollComplement())
+ if (isSetToScrollComplementPanel())
{
- setDontScrollComplement(true);
+ setToScrollComplementPanel(false);
av.scrollComplementaryAlignment();
- setDontScrollComplement(false);
+ setToScrollComplementPanel(true);
}
}
}
.getColumnSelection(), av.getRanges());
// TODO set via ViewportRanges in overview dimensions once JAL-2388 is
// merged
- ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
+ // ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
}
}
});
.getColumnSelection(), av.getRanges());
// TODO set via ViewportRanges in overview dimensions once JAL-2388 is
// merged
- ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
+
+ // ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
}
}
});
@Override
public void propertyChange(PropertyChangeEvent evt)
{
- if (av.getWrapAlignment())
+ if (!av.getWrapAlignment())
{
if (evt.getPropertyName().equals("startres")
|| evt.getPropertyName().equals("endres"))
// panel,as this sets up a feedback loop (scrolling panel 1 causes moused
// over residue to change abruptly, causing highlighted residue in panel 2
// to change, causing a scroll in panel 1 etc)
- ap.setDontScrollComplement(true);
+ ap.setToScrollComplementPanel(false);
if (ap.scrollToPosition(results, false))
{
seqCanvas.revalidate();
}
- ap.setDontScrollComplement(false);
+ ap.setToScrollComplementPanel(true);
}
setStatusMessage(results);
seqCanvas.highlightSearchResults(results);
}
// update scroll values
- scrollCol = visXAsRes;
- scrollRow = visYAsRes;
+ // scrollCol = visXAsRes;
+ // scrollRow = visYAsRes;
+ ranges.setStartRes(visXAsRes);
+ ranges.setStartSeq(visYAsRes);
}
/**
g.drawRect(boxX + 1, boxY + 1, boxWidth - 2, boxHeight - 2);
}
- public int getScrollCol()
+ /*public int getScrollCol()
{
return scrollCol;
}
public int getScrollRow()
{
return scrollRow;
- }
+ }*/
// TODO should be removed, when unit test has mock Graphics object available
// to check boxX/boxY