From 58962a97c9819d186ce347072e8750dbcae16f0f Mon Sep 17 00:00:00 2001 From: kiramt Date: Fri, 25 Aug 2017 14:13:48 +0100 Subject: [PATCH] JAL-2587 Removed annoying double repaint on hide insertions --- src/jalview/gui/PopupMenu.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 756b77b..2c4eb7a 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -452,7 +452,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener buildGroupURLMenu(sg, groupLinks); } // Add a 'show all structures' for the current selection - Hashtable pdbe = new Hashtable(), reppdb = new Hashtable(); + Hashtable pdbe = new Hashtable<>(), reppdb = new Hashtable<>(); SequenceI sqass = null; for (SequenceI sq : ap.av.getSequenceSelection()) { @@ -519,7 +519,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener void addFeatureLinks(final SequenceI seq, List links) { JMenu linkMenu = new JMenu(MessageManager.getString("action.link")); - Map> linkset = new LinkedHashMap>(); + Map> linkset = new LinkedHashMap<>(); for (String link : links) { @@ -603,8 +603,8 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener * the insertion order, which is the order of the annotations on the * alignment. */ - Map>> shownTypes = new LinkedHashMap>>(); - Map>> hiddenTypes = new LinkedHashMap>>(); + Map>> shownTypes = new LinkedHashMap<>(); + Map>> hiddenTypes = new LinkedHashMap<>(); AlignmentAnnotationUtils.getShownHiddenTypes(shownTypes, hiddenTypes, AlignmentAnnotationUtils.asList(annotations), forSequences); @@ -710,7 +710,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener SequenceI[] seqs = ap.av.getSelectionAsNewSequence(); String[][] idandseqs = GroupUrlLink.formStrings(seqs); - Hashtable commonDbrefs = new Hashtable(); + Hashtable commonDbrefs = new Hashtable<>(); for (int sq = 0; sq < seqs.length; sq++) { @@ -1369,8 +1369,8 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener * Temporary store to hold distinct calcId / type pairs for the tooltip. * Using TreeMap means calcIds are shown in alphabetical order. */ - SortedMap tipEntries = new TreeMap(); - final Map> candidates = new LinkedHashMap>(); + SortedMap tipEntries = new TreeMap<>(); + final Map> candidates = new LinkedHashMap<>(); AlignmentI al = this.ap.av.getAlignment(); AlignmentUtils.findAddableReferenceAnnotations(forSequences, tipEntries, candidates, al); @@ -1556,7 +1556,9 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener void refresh() { ap.updateAnnotation(); - ap.paintAlignment(true); + // removed paintAlignment(true) here: + // updateAnnotation calls paintAlignment already, so don't need to call + // again PaintRefresher.Refresh(this, ap.av.getSequenceSetId()); } @@ -1925,8 +1927,8 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener return; } - List seqs = new ArrayList(); - List features = new ArrayList(); + List seqs = new ArrayList<>(); + List features = new ArrayList<>(); /* * assemble dataset sequences, and template new sequence features, -- 1.7.10.2