From 27a5d5711de5fe3c324dc3d3ec625cd1596a1b62 Mon Sep 17 00:00:00 2001 From: kiramt Date: Mon, 26 Jun 2017 14:33:15 +0100 Subject: [PATCH] JAL-2600 reinstate original behaviour --- src/jalview/gui/AnnotationPanel.java | 9 ++++++--- src/jalview/gui/SeqCanvas.java | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 452f002..c688789 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -451,7 +451,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, * the selection list (read-only view) is in selection order, not * column order; make a copy so we can sort it */ - List selected = new ArrayList(viscols.getSelected()); + List selected = new ArrayList<>(viscols.getSelected()); Collections.sort(selected); for (int index : selected) { @@ -1168,10 +1168,13 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, public void propertyChange(PropertyChangeEvent evt) { // Respond to viewport range changes (e.g. alignment panel was scrolled) - if (evt.getPropertyName().equals("startres") - || evt.getPropertyName().equals("endres")) + if (evt.getPropertyName().equals("startres")) { fastPaint((int) evt.getNewValue() - (int) evt.getOldValue()); } + else if (evt.getPropertyName().equals("endres")) + { + // resize + } } } diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 1625c52..d3ba304 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -989,9 +989,10 @@ public class SeqCanvas extends JComponent implements ViewportListenerI { if (!av.getWrapAlignment()) { - if (evt.getPropertyName().equals("startres") - || evt.getPropertyName().equals("endres")) + if (evt.getPropertyName().equals("startres")) { + // scroll - startres and endres both change + // Make sure we're not trying to draw a panel // larger than the visible window ViewportRanges vpRanges = av.getRanges(); @@ -1006,11 +1007,19 @@ public class SeqCanvas extends JComponent implements ViewportListenerI } fastPaint(scrollX, 0); } - else if (evt.getPropertyName().equals("startseq") - || evt.getPropertyName().equals("endseq")) + else if (evt.getPropertyName().equals("endres")) + { + // resize - only endres changes + } + else if (evt.getPropertyName().equals("startseq")) { + // scroll fastPaint(0, (int) evt.getNewValue() - (int) evt.getOldValue()); } + else if (evt.getPropertyName().equals("endseq")) + { + // resize + } } } } -- 1.7.10.2