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-1889 temporary debug in findColumn()
[jalview.git]
/
src
/
jalview
/
gui
/
SeqPanel.java
diff --git
a/src/jalview/gui/SeqPanel.java
b/src/jalview/gui/SeqPanel.java
index
1176df5
..
08c74e8
100644
(file)
--- a/
src/jalview/gui/SeqPanel.java
+++ b/
src/jalview/gui/SeqPanel.java
@@
-255,6
+255,11
@@
public class SeqPanel extends JPanel
int wrappedBlock = -1;
int wrappedBlock = -1;
+ MousePos findMousePosition(MouseEvent evt)
+ {
+ return findMousePosition(evt, false);
+ }
+
/**
* Computes the column and sequence row (and possibly annotation row when in
* wrapped mode) for the given mouse position
/**
* Computes the column and sequence row (and possibly annotation row when in
* wrapped mode) for the given mouse position
@@
-262,15
+267,22
@@
public class SeqPanel extends JPanel
* @param evt
* @return
*/
* @param evt
* @return
*/
- MousePos findMousePosition(MouseEvent evt)
+ MousePos findMousePosition(MouseEvent evt, boolean debug)
{
{
- int col = findColumn(evt);
+ int col = findColumn(evt, debug);
int seqIndex = -1;
int annIndex = -1;
int y = evt.getY();
int charHeight = av.getCharHeight();
int alignmentHeight = av.getAlignment().getHeight();
int seqIndex = -1;
int annIndex = -1;
int y = evt.getY();
int charHeight = av.getCharHeight();
int alignmentHeight = av.getAlignment().getHeight();
+ if (debug)
+ {
+ System.out.println(String.format(
+ "charHeight %d alHeight %d canvasWidth %d canvasHeight %d",
+ charHeight, alignmentHeight, seqCanvas.getWidth(),
+ seqCanvas.getHeight()));
+ }
if (av.getWrapAlignment())
{
seqCanvas.calculateWrappedGeometry(seqCanvas.getWidth(),
if (av.getWrapAlignment())
{
seqCanvas.calculateWrappedGeometry(seqCanvas.getWidth(),
@@
-331,6
+343,11
@@
public class SeqPanel extends JPanel
*/
int findColumn(MouseEvent evt)
{
*/
int findColumn(MouseEvent evt)
{
+ return findColumn(evt, true);
+ }
+
+ int findColumn(MouseEvent evt, boolean debug)
+ {
int res = 0;
int x = evt.getX();
int res = 0;
int x = evt.getX();
@@
-351,6
+368,12
@@
public class SeqPanel extends JPanel
int y = evt.getY();
y = Math.max(0, y - hgap);
x -= seqCanvas.getLabelWidthWest();
int y = evt.getY();
y = Math.max(0, y - hgap);
x -= seqCanvas.getLabelWidthWest();
+ if (debug)
+ {
+ System.out.println(
+ String.format("findColumn: x %d labelWest %d charWidth %d ",
+ x, seqCanvas.getLabelWidthWest(), charWidth));
+ }
if (x < 0)
{
// mouse is over left scale
if (x < 0)
{
// mouse is over left scale
@@
-364,6
+387,10
@@
public class SeqPanel extends JPanel
}
if (x >= cwidth * charWidth)
{
}
if (x >= cwidth * charWidth)
{
+ if (debug)
+ {
+ System.out.println("findColumn: cwidth = " + cwidth);
+ }
// mouse is over right scale
return -1;
}
// mouse is over right scale
return -1;
}