Merge branch 'tasks/JAL-3035_remove_dasobert_dependency' into develop
[jalview.git] / src / jalview / gui / FeatureSettings.java
index 40e49fb..4526517 100644 (file)
@@ -130,7 +130,7 @@ public class FeatureSettings extends JPanel
 
   private static final int MIN_HEIGHT = 400;
 
-  private final static String BASE_TOOLTIP = "Click to edit, right-click for menu";
+  private final static String BASE_TOOLTIP = MessageManager.getString("label.click_to_edit");
 
   final FeatureRenderer fr;
 
@@ -201,8 +201,6 @@ public class FeatureSettings extends JPanel
 
     table = new JTable()
     {
-      static final String tt = "Click to edit, right-click for menu"; // todo i18n
-      
       @Override
       public String getToolTipText(MouseEvent e)
       {
@@ -219,7 +217,7 @@ public class FeatureSettings extends JPanel
         case COLOUR_COLUMN:
           FeatureColourI colour = (FeatureColourI) table.getValueAt(row,
                   column);
-          tip = getColorTooltip(colour);
+          tip = getColorTooltip(colour, true);
           break;
         case FILTER_COLUMN:
           FeatureMatcherSet o = (FeatureMatcherSet) table.getValueAt(row,
@@ -232,11 +230,12 @@ public class FeatureSettings extends JPanel
         default:
           break;
         }
+        
         return tip;
       }
 
       /**
-       * Position the tooltip at the bottom edge of, and half way across, the
+       * Position the tooltip near the bottom edge of, and half way across, the
        * current cell
        */
       @Override
@@ -246,7 +245,7 @@ public class FeatureSettings extends JPanel
         int column = table.columnAtPoint(point);
         int row = table.rowAtPoint(point);
         Rectangle r = getCellRect(row, column, false);
-        Point loc = new Point(r.x + r.width / 2, r.y + r.height);
+        Point loc = new Point(r.x + r.width / 2, r.y + r.height - 3);
         return loc;
       }
     };
@@ -255,9 +254,6 @@ public class FeatureSettings extends JPanel
     tableHeader.setReorderingAllowed(false);
     table.setFont(new Font("Verdana", Font.PLAIN, 12));
 
-    // table.setDefaultRenderer(Color.class, new ColorRenderer());
-    // table.setDefaultEditor(Color.class, new ColorEditor(this));
-    //
     table.setDefaultEditor(FeatureColour.class, new ColorEditor(this));
     table.setDefaultRenderer(FeatureColour.class, new ColorRenderer());
 
@@ -1198,22 +1194,6 @@ public class FeatureSettings extends JPanel
         }
       }
     });
-    help.setFont(JvSwingUtils.getLabelFont());
-    help.setText(MessageManager.getString("action.help"));
-    help.addActionListener(new ActionListener()
-    {
-      @Override
-      public void actionPerformed(ActionEvent e)
-      {
-        try
-        {
-          Help.showHelpWindow(HelpId.SequenceFeatureSettings);
-        } catch (HelpSetException e1)
-        {
-          e1.printStackTrace();
-        }
-      }
-    });
 
     JButton cancel = new JButton(MessageManager.getString("action.cancel"));
     cancel.setFont(JvSwingUtils.getLabelFont());
@@ -1311,9 +1291,12 @@ public class FeatureSettings extends JPanel
    * Answers a suitable tooltip to show on the colour cell of the table
    * 
    * @param fcol
+   * @param withHint
+   *          if true include 'click to edit' and similar text
    * @return
    */
-  public static String getColorTooltip(FeatureColourI fcol)
+  public static String getColorTooltip(FeatureColourI fcol,
+          boolean withHint)
   {
     if (fcol == null)
     {
@@ -1321,13 +1304,16 @@ public class FeatureSettings extends JPanel
     }
     if (fcol.isSimpleColour())
     {
-      return BASE_TOOLTIP;
+      return withHint ? BASE_TOOLTIP : null;
     }
     String description = fcol.getDescription();
     description = description.replaceAll("<", "&lt;");
     description = description.replaceAll(">", "&gt;");
     StringBuilder tt = new StringBuilder(description);
-    tt.append("<br>").append(BASE_TOOLTIP).append("</br>");
+    if (withHint)
+    {
+      tt.append("<br>").append(BASE_TOOLTIP).append("</br>");
+    }
     return JvSwingUtils.wrapTooltip(true, tt.toString());
   }