JAL-4023 use %g for distances (scientific notation for very small or large values)
[jalview.git] / src / jalview / gui / JvSwingUtils.java
index d44080a..e7f992d 100644 (file)
@@ -20,8 +20,6 @@
  */
 package jalview.gui;
 
-import jalview.util.MessageManager;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
@@ -48,6 +46,8 @@ import javax.swing.SwingConstants;
 import javax.swing.border.Border;
 import javax.swing.border.TitledBorder;
 
+import jalview.util.MessageManager;
+
 /**
  * useful functions for building Swing GUIs
  * 
@@ -96,20 +96,14 @@ public final class JvSwingUtils
     }
 
     return (enclose ? "<html>" : "")
-            
-     // BH 2018
-            
+            // BH 2018
             + "<style> div.ttip {width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;}</style><div class=\"ttip\">"
-            
-//            + "<style> p.ttip {width:350px;margin:-14px 0px -14px 0px;padding:2px;overflow-wrap:break-word;}"
-//            + "</style><p class=\"ttip\">"
-                        
-            + ttext
-            
-            + " </div>"
-//            + "</p>"
+            // + "<style> p.ttip {width:350px;margin:-14px 0px -14px
+            // 0px;padding:2px;overflow-wrap:break-word;}"
+            // + "</style><p class=\"ttip\">"
+            + ttext + " </div>"
+            // + "</p>"
             + ((enclose ? "</html>" : ""));
-
   }
 
   public static JButton makeButton(String label, String tooltip,
@@ -330,13 +324,13 @@ public final class JvSwingUtils
    * @param entries
    * @param tooltips
    */
-  public static JComboBox<String> buildComboWithTooltips(
-          List<String> entries, List<String> tooltips)
+  public static JComboBox<Object> buildComboWithTooltips(
+          List<Object> entries, List<String> tooltips)
   {
-    JComboBox<String> combo = new JComboBox<>();
+    JComboBox<Object> combo = new JComboBox<>();
     final ComboBoxTooltipRenderer renderer = new ComboBoxTooltipRenderer();
     combo.setRenderer(renderer);
-    for (String attName : entries)
+    for (Object attName : entries)
     {
       combo.addItem(attName);
     }
@@ -352,6 +346,7 @@ public final class JvSwingUtils
           combo.setToolTipText(tooltips.get(j));
         }
       }
+
       @Override
       public void mouseExited(MouseEvent e)
       {