renderer = new AnnotationRenderer();
}
+ /**
+ * Responds to a mouse wheel movement by scrolling the annotations up or down.
+ * Annotation labels are scrolled via method adjustmentValueChanged when the
+ * vertical scrollbar is adjusted.
+ * <p>
+ * If shift is pressed, then scrolling is left or right instead, and is
+ * delegated to AlignmentPanel, so that both sequences and annotations are
+ * scrolled together.
+ * <p>
+ * This object is a MouseWheelListener to AnnotationLabels, so mouse wheel
+ * events over the labels are delegated to this method.
+ * <p>
+ * Note that this method may also be fired by scrolling with a gesture on a
+ * trackpad.
+ */
@Override
public void mouseWheelMoved(MouseWheelEvent e)
{
if (e.isShiftDown())
{
- e.consume();
- double wheelRotation = e.getPreciseWheelRotation();
- if (wheelRotation > 0)
- {
- av.getRanges().scrollRight(true);
- }
- else if (wheelRotation < 0)
- {
- av.getRanges().scrollRight(false);
- }
+ ap.getSeqPanel().mouseWheelMoved(e);
}
else
{
int yOffset = rowIndex[1];
AlignmentAnnotation[] allAnnotation = av.getAlignment()
.getAlignmentAnnotation();
- if (allAnnotation==null || rowIndex[0]<0 || rowIndex[0]>=allAnnotation.length)
+ if (allAnnotation == null || rowIndex[0] < 0
+ || rowIndex[0] >= allAnnotation.length)
{
return false;
}
{
SequenceI rseq = clicked.sequenceRef;
BitSet grp = new BitSet();
- grp.or(matrix.getGroupsFor(currentX));
+ grp.or(matrix.getGroupsFor(forCurrentX.getPosition()));
// TODO: cXci needs to be mapped to real groups
for (int c = fr; c <= to; c++)
{
if (forFromX != null && forToX != null)
{
- // FIXME will need two ContactGeometry objects when handling contact matrices with differing numbers of rows at each
+ // FIXME will need two ContactGeometry objects when handling contact
+ // matrices with differing numbers of rows at each
// column
ContactGeometry xcgeom = new ContactGeometry(forFromX,
cma.graphHeight);
- ContactGeometry.contactInterval lastXci = xcgeom
- .mapFor(rowIndex[1]);
- ContactGeometry.contactInterval cXci = xcgeom.mapFor(rowIndex[1] + deltaY);
+ ContactGeometry.contactInterval lastXci = xcgeom.mapFor(rowIndex[1]);
+ ContactGeometry.contactInterval cXci = xcgeom
+ .mapFor(rowIndex[1] + deltaY);
// mark rectangular region formed by drag
jalview.bin.Console.trace("Matrix Selection from last(" + fromXc
// }
// else
{
- av.getColumnSelection().addElement(c-1);
+ av.getColumnSelection().addElement(c - 1);
}
}
}
{
row = i;
res[0] = row;
- res[1] = yPos-lheight;
+ res[1] = yPos - lheight;
break;
}
}
// TODO abstract tooltip generator so different implementations can be built
if (ann.graph == AlignmentAnnotation.CONTACT_MAP)
{
- if (rowAndOffset>=ann.graphHeight)
+ if (rowAndOffset >= ann.graphHeight)
{
return null;
}
ContactGeometry.contactInterval ci = cgeom.mapFor(rowAndOffset);
ContactRange cr = clist.getRangeFor(ci.cStart, ci.cEnd);
StringBuilder tooltipb = new StringBuilder();
- tooltipb.append("Contact from ")
- .append(clist.getPosition()).append(", [").append(ci.cStart).append(" - ").append(ci.cEnd).append("]").append("<br/>Mean:");
- Format.appendPercentage(tooltipb, (float)cr.getMean(),2);
+ tooltipb.append("Contact from ").append(clist.getPosition())
+ .append(", [").append(ci.cStart).append(" - ")
+ .append(ci.cEnd).append("]").append("<br/>Mean:");
+ Format.appendPercentage(tooltipb, (float) cr.getMean(), 2);
tooltip = tooltipb.toString();
int col = ann.sequenceRef.findPosition(column);
int[][] highlightPos;
&& (fadedImage == null || fadedImage.getWidth() != imgWidth
|| fadedImage.getHeight() != image.getHeight()))
{
- // jalview.bin.Console.errPrintln("redraw faded image ("+(fadedImage==null ?
+ // jalview.bin.Console.errPrintln("redraw faded image
+ // ("+(fadedImage==null ?
// "null image" : "") + " lastGood="+lastImageGood+")");
fadedImage = new BufferedImage(imgWidth, image.getHeight(),
BufferedImage.TYPE_INT_RGB);