From 5e67396f7f70d20025e8112ce09f2095ebc94584 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 6 Nov 2009 16:31:09 +0000 Subject: [PATCH] properly import column selection from message --- src/jalview/gui/SeqPanel.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 8b97853..e32c5cf 100755 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1904,18 +1904,31 @@ public class SeqPanel extends JPanel implements MouseListener, } if (av.colSel == null || !av.isColSelChanged()) { - // Check to see if the current selection is from a previous message + // the current selection is unset or from a previous message + // so import the new colsel. if (colsel == null || colsel.size() == 0) { - av.colSel.clear(); + if (av.colSel!=null) + { + av.colSel.clear(); + } } else { - av.colSel = new ColumnSelection(colsel); + if (av.colSel == null) + { + av.colSel = new ColumnSelection(colsel); + } else { + av.colSel.setElementsFrom(colsel); + } } repaint |= av.isColSelChanged(); } } + if (av.hasHiddenColumns && (av.colSel==null || av.colSel.getHiddenColumns()==null)) + { + System.err.println("Bad things"); + } if (repaint) { // probably finessing with multiple redraws here -- 1.7.10.2