JAL-1517 update copyright to version 2.8.2
[jalview.git] / src / jalview / gui / AnnotationPanel.java
index 8a22288..b18501e 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
  * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
@@ -21,11 +21,13 @@ package jalview.gui;
 import java.awt.*;
 import java.awt.event.*;
 import java.awt.image.*;
+
 import javax.swing.*;
 
 import jalview.datamodel.*;
 import jalview.renderer.AnnotationRenderer;
 import jalview.renderer.AwtRenderPanelI;
+import jalview.util.MessageManager;
 
 /**
  * AnnotationPanel displays visible portion of annotation rows below unwrapped
@@ -267,7 +269,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     else if (evt.getActionCommand().equals(LABEL))
     {
       String exMesg = collectAnnotVals(anot, av.getColumnSelection(), LABEL);
-      String label = JOptionPane.showInputDialog(this, "Enter label",
+      String label = JOptionPane.showInputDialog(this, MessageManager.getString("label.enter_label"),
               exMesg);
 
       if (label == null)
@@ -349,7 +351,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       }
 
       String label = JOptionPane.showInputDialog(
-              "Enter a label for the structure?", symbol);
+              MessageManager.getString("label.enter_label_for_the_structure"), symbol);
 
       if (label == null)
       {
@@ -359,8 +361,11 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       if ((label.length() > 0) && !aa[activeRow].hasText)
       {
         aa[activeRow].hasText = true;
+        if (evt.getActionCommand().equals(STEM))
+        {
+          aa[activeRow].showAllColLabels=true;
+        }
       }
-
       for (int i = 0; i < av.getColumnSelection().size(); i++)
       {
         int index = av.getColumnSelection().columnAt(i);
@@ -375,6 +380,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
 
         anot[index].secondaryStructure = type;
         anot[index].displayCharacter = label;
+        
       }
     }
     av.getAlignment().validateAnnotation(aa[activeRow]);
@@ -482,7 +488,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
         return;
       }
 
-      JPopupMenu pop = new JPopupMenu("Structure type");
+      JPopupMenu pop = new JPopupMenu(MessageManager.getString("label.structure_type"));
       JMenuItem item;
       /*
        * Just display the needed structure options
@@ -664,7 +670,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
               && aa[row].annotations[res].description != null
               && aa[row].annotations[res].description.length() > 0)
       {
-        this.setToolTipText(aa[row].annotations[res].description);
+        this.setToolTipText("<html>"+JvSwingUtils.wrapTooltip(aa[row].annotations[res].description)+"</html>");
       }
       else
       {
@@ -923,7 +929,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       g.setColor(Color.black);
       if (av.validCharWidth)
       {
-        g.drawString("Alignment has no annotations", 20, 15);
+        g.drawString(MessageManager.getString("label.alignment_has_no_annotations"), 20, 15);
       }
 
       return;