JAL-1713 update from Jalview 2.11.3 develop
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index 21c45e9..4702f2a 100755 (executable)
  */
 package jalview.gui;
 
-import java.util.Locale;
-
-import jalview.analysis.AlignSeq;
-import jalview.analysis.AlignmentUtils;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.Annotation;
-import jalview.datamodel.HiddenColumns;
-import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceGroup;
-import jalview.datamodel.SequenceI;
-import jalview.io.FileFormat;
-import jalview.io.FormatAdapter;
-import jalview.util.Comparison;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-
 import java.awt.Color;
 import java.awt.Cursor;
 import java.awt.Dimension;
@@ -56,6 +39,7 @@ import java.awt.geom.AffineTransform;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.Locale;
 
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JMenuItem;
@@ -64,6 +48,21 @@ import javax.swing.JPopupMenu;
 import javax.swing.SwingUtilities;
 import javax.swing.ToolTipManager;
 
+import jalview.analysis.AlignSeq;
+import jalview.analysis.AlignmentUtils;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.HiddenColumns;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.io.FileFormat;
+import jalview.io.FormatAdapter;
+import jalview.util.Comparison;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+
 /**
  * The panel that holds the labels for alignment annotations, providing
  * tooltips, context menus, drag to reorder rows, and drag to adjust panel
@@ -137,7 +136,7 @@ public class AnnotationLabels extends JPanel
    */
   public AnnotationLabels(AlignmentPanel ap)
   {
-         
+
     this.ap = ap;
     av = ap.av;
     ToolTipManager.sharedInstance().registerComponent(this);
@@ -293,27 +292,22 @@ public class AnnotationLabels extends JPanel
     EditNameDialog dialog = new EditNameDialog(annotation.label,
             annotation.description, name, description);
 
-    dialog.showDialog(ap.alignFrame, title,
-            new Runnable()
-            {
-              @Override
-              public void run()
-              {
-                annotation.label = dialog.getName();
-                String text = dialog.getDescription();
-                if (text != null && text.length() == 0)
-                {
-                  text = null;
-                }
-                annotation.description = text;
-                if (addNew)
-                {
-                  ap.av.getAlignment().addAnnotation(annotation);
-                  ap.av.getAlignment().setAnnotationIndex(annotation, 0);
-                }
-                ap.refresh(true);
-              }
-            });
+    dialog.showDialog(ap.alignFrame, title, () -> {
+      annotation.label = dialog.getName();
+      String text = dialog.getDescription();
+      if (text != null && text.length() == 0)
+      {
+        text = null;
+      }
+      annotation.description = text;
+      if (addNew)
+      {
+        ap.av.getAlignment().addAnnotation(annotation);
+        ap.av.getAlignment().setAnnotationIndex(annotation, 0);
+      }
+      ap.refresh(true);
+      return null;
+    });
   }
 
   @Override
@@ -438,8 +432,7 @@ public class AnnotationLabels extends JPanel
    * @param pop
    */
   static void addConsensusMenuOptions(AlignmentPanel ap,
-          AlignmentAnnotation ann,
-          JPopupMenu pop)
+          AlignmentAnnotation ann, JPopupMenu pop)
   {
     pop.addSeparator();