From: gmungoc Date: Fri, 27 May 2016 14:24:15 +0000 (+0100) Subject: JAL-1989 tightened up use of flag for 'column selection changed' X-Git-Tag: Release_2_10_0~206 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7182b83bcc2d48f6335ac0ca16528607cee81408;p=jalview.git JAL-1989 tightened up use of flag for 'column selection changed' --- diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index 479b746..a4dad4b 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -1964,7 +1964,6 @@ public class SeqPanel extends Panel implements MouseMotionListener, ColumnSelection cs = MappingUtils.mapColumnSelection(colsel, sourceAv, av); av.setColumnSelection(cs); - av.isColSelChanged(true); ap.scalePanelHolder.repaint(); ap.repaint(); diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index f2cbf33..2165b2c 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -43,17 +43,14 @@ import javax.swing.JPopupMenu; import javax.swing.ToolTipManager; /** - * DOCUMENT ME! - * - * @author $author$ - * @version $Revision$ + * The panel containing the sequence ruler (when not in wrapped mode), and + * supports a range of mouse operations to select, hide or reveal columns. */ public class ScalePanel extends JPanel implements MouseMotionListener, MouseListener { protected int offy = 4; - /** DOCUMENT ME!! */ public int width; protected AlignViewport av; @@ -62,13 +59,26 @@ public class ScalePanel extends JPanel implements MouseMotionListener, boolean stretchingGroup = false; - int min; // used by mouseDragged to see if user + /* + * min, max hold the extent of a mouse drag action + */ + int min; - int max; // used by mouseDragged to see if user + int max; boolean mouseDragging = false; - // wants to delete columns + /* + * holds a hidden column range when the mouse is over an adjacent column + */ + int[] reveal; + + /** + * Constructor + * + * @param av + * @param ap + */ public ScalePanel(AlignViewport av, AlignmentPanel ap) { this.av = av; @@ -393,6 +403,8 @@ public class ScalePanel extends JPanel implements MouseMotionListener, @Override public void mouseMoved(MouseEvent evt) { + this.setToolTipText(null); + reveal = null; if (!av.hasHiddenColumns()) { return; @@ -402,7 +414,6 @@ public class ScalePanel extends JPanel implements MouseMotionListener, res = av.getColumnSelection().adjustForHiddenColumns(res); - reveal = null; if (av.getColumnSelection().getHiddenColumns() != null) { for (int[] region : av.getColumnSelection().getHiddenColumns()) @@ -415,17 +426,11 @@ public class ScalePanel extends JPanel implements MouseMotionListener, .getString("label.reveal_hidden_columns")); break; } - else - { - this.setToolTipText(null); - } } } repaint(); } - int[] reveal; - /** * DOCUMENT ME! * diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 3fbb809..bd4b234 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -2061,7 +2061,6 @@ public class SeqPanel extends JPanel implements MouseListener, ColumnSelection cs = MappingUtils.mapColumnSelection(colsel, sourceAv, av); av.setColumnSelection(cs); - av.isColSelChanged(true); PaintRefresher.Refresh(this, av.getSequenceSetId()); diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index fbd1622..c16fdce 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -1078,6 +1078,7 @@ public abstract class AlignmentViewport implements AlignViewportI, { updateHiddenColumns(); } + isColSelChanged(true); } /** @@ -1206,8 +1207,7 @@ public abstract class AlignmentViewport implements AlignViewportI, */ public boolean isColSelChanged(boolean b) { - int hc = (colSel == null || colSel.isEmpty()) ? -1 : colSel - .hashCode(); + int hc = (colSel == null || colSel.isEmpty()) ? -1 : colSel.hashCode(); if (hc != -1 && hc != colselhash) { if (b) @@ -1308,7 +1308,7 @@ public abstract class AlignmentViewport implements AlignViewportI, colSel.hideSelectedColumns(); setSelectionGroup(null); - + isColSelChanged(true); } public void hideColumns(int start, int end) @@ -1321,17 +1321,19 @@ public abstract class AlignmentViewport implements AlignViewportI, { colSel.hideColumns(start, end); } + isColSelChanged(true); } public void showColumn(int col) { colSel.revealHiddenColumns(col); - + isColSelChanged(true); } public void showAllHiddenColumns() { colSel.revealAllHiddenColumns(); + isColSelChanged(true); } // common hide/show seq stuff