git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-1805 test envirionment separation
[jalview.git]
/
src
/
jalview
/
gui
/
AlignmentPanel.java
diff --git
a/src/jalview/gui/AlignmentPanel.java
b/src/jalview/gui/AlignmentPanel.java
index
588411e
..
ad7e75c
100644
(file)
--- a/
src/jalview/gui/AlignmentPanel.java
+++ b/
src/jalview/gui/AlignmentPanel.java
@@
-34,6
+34,7
@@
import jalview.math.AlignmentDimension;
import jalview.schemes.ResidueProperties;
import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
import jalview.schemes.ResidueProperties;
import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.BorderLayout;
import java.awt.Color;
@@
-305,7
+306,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
*/
public boolean scrollToPosition(SearchResults results)
{
*/
public boolean scrollToPosition(SearchResults results)
{
- return scrollToPosition(results, true, false);
+ return scrollToPosition(results, 0, true, false);
}
/**
}
/**
@@
-318,7
+319,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
*/
public boolean scrollToPosition(SearchResults searchResults, boolean redrawOverview)
{
*/
public boolean scrollToPosition(SearchResults searchResults, boolean redrawOverview)
{
- return scrollToPosition(searchResults, redrawOverview, false);
+ return scrollToPosition(searchResults, 0, redrawOverview, false);
}
/**
}
/**
@@
-326,6
+327,9
@@
public class AlignmentPanel extends GAlignmentPanel implements
* (if any)
*
* @param results
* (if any)
*
* @param results
+ * @param verticalOffset
+ * if greater than zero, allows scrolling to a position below the
+ * first displayed sequence
* @param redrawOverview
* - when set, the overview will be recalculated (takes longer)
* @param centre
* @param redrawOverview
* - when set, the overview will be recalculated (takes longer)
* @param centre
@@
-333,6
+337,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
* @return false if results were not found
*/
public boolean scrollToPosition(SearchResults results,
* @return false if results were not found
*/
public boolean scrollToPosition(SearchResults results,
+ int verticalOffset,
boolean redrawOverview, boolean centre)
{
int startv, endv, starts, ends;
boolean redrawOverview, boolean centre)
{
int startv, endv, starts, ends;
@@
-391,6
+396,12
@@
public class AlignmentPanel extends GAlignmentPanel implements
}
}
}
}
}
}
+
+ /*
+ * allow for offset of target sequence (actually scroll to one above it)
+ */
+ seqIndex = Math.max(0, seqIndex - verticalOffset);
+
if (!av.getWrapAlignment())
{
if ((startv = av.getStartRes()) >= start)
if (!av.getWrapAlignment())
{
if ((startv = av.getStartRes()) >= start)
@@
-521,12
+532,13
@@
public class AlignmentPanel extends GAlignmentPanel implements
/*
* Estimate available height in the AlignFrame for alignment +
/*
* Estimate available height in the AlignFrame for alignment +
- * annotations. Deduct an estimate of 75 for menu bar, scale panel,
+ * annotations. Deduct an estimate for title bar, menu bar, scale panel,
* hscroll, status bar (as these are not laid out we can't inspect their
* hscroll, status bar (as these are not laid out we can't inspect their
- * actual heights). Insets gives borders including title bar.
+ * actual heights). Insets gives frame borders.
*/
*/
+ int stuff = Platform.isAMac() ? 80 : 100;
Insets insets = alignFrame.getInsets();
Insets insets = alignFrame.getInsets();
- int availableHeight = alignFrame.getHeight() - 75 - insets.top
+ int availableHeight = alignFrame.getHeight() - stuff - insets.top
- insets.bottom;
/*
- insets.bottom;
/*
@@
-1727,10
+1739,10
@@
public class AlignmentPanel extends GAlignmentPanel implements
* @param sr
* holds mapped region(s) of this alignment that we are scrolling
* 'to'; may be modified for sequence offset by this method
* @param sr
* holds mapped region(s) of this alignment that we are scrolling
* 'to'; may be modified for sequence offset by this method
- * @param seqOffset
+ * @param verticalOffset
* the number of visible sequences to show above the mapped region
*/
* the number of visible sequences to show above the mapped region
*/
- public void scrollToCentre(SearchResults sr, int seqOffset)
+ public void scrollToCentre(SearchResults sr, int verticalOffset)
{
/*
* To avoid jumpy vertical scrolling (if some sequences are gapped or not
{
/*
* To avoid jumpy vertical scrolling (if some sequences are gapped or not
@@
-1744,7
+1756,6
@@
public class AlignmentPanel extends GAlignmentPanel implements
* This is like AlignmentI.findIndex(seq) but here we are matching the
* dataset sequence not the aligned sequence
*/
* This is like AlignmentI.findIndex(seq) but here we are matching the
* dataset sequence not the aligned sequence
*/
- int sequenceIndex = 0;
boolean matched = false;
for (SequenceI seq : seqs)
{
boolean matched = false;
for (SequenceI seq : seqs)
{
@@
-1753,20
+1764,16
@@
public class AlignmentPanel extends GAlignmentPanel implements
matched = true;
break;
}
matched = true;
break;
}
- sequenceIndex++;
}
if (!matched)
{
return; // failsafe, shouldn't happen
}
}
if (!matched)
{
return; // failsafe, shouldn't happen
}
- sequenceIndex = Math.max(0, sequenceIndex - seqOffset);
- sr.getResults().get(0)
- .setSequence(av.getAlignment().getSequenceAt(sequenceIndex));
/*
* Scroll to position but centring the target residue.
*/
/*
* Scroll to position but centring the target residue.
*/
- scrollToPosition(sr, true, true);
+ scrollToPosition(sr, verticalOffset, true, true);
}
/**
}
/**