From 8fc5b290e89e90de7ddbf89b92349829f52f8aff Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 4 Oct 2018 12:29:08 +0100 Subject: [PATCH] JAL-1244 status message while dragging a stretch group --- src/jalview/gui/SeqPanel.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 8b2e7bc..e50e65d 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -2012,6 +2012,32 @@ public class SeqPanel extends JPanel { scrollThread.setEvent(evt); } + + /* + * construct a status message showing the range of the selection + */ + StringBuilder status = new StringBuilder(64); + List seqs = stretchGroup.getSequences(); + String name = seqs.get(0).getName(); + if (name.length() > 20) + { + name = name.substring(0, 20); + } + status.append(name).append(" - "); + name = seqs.get(seqs.size() - 1).getName(); + if (name.length() > 20) + { + name = name.substring(0, 20); + } + status.append(name).append(" "); + int startRes = stretchGroup.getStartRes(); + status.append(" cols ").append(String.valueOf(startRes + 1)) + .append("-"); + int endRes = stretchGroup.getEndRes(); + status.append(String.valueOf(endRes + 1)); + status.append(" (").append(String.valueOf(seqs.size())).append(" x ") + .append(String.valueOf(endRes - startRes + 1)).append(")"); + ap.alignFrame.setStatus(status.toString()); } void scrollCanvas(MouseEvent evt) -- 1.7.10.2