JAL-1159 Merging 2.8.1 patches and Anne Menards work from 2012 into development branch
[jalview.git] / src / jalview / gui / SeqPanel.java
index 9c3d557..c71b154 100644 (file)
@@ -31,6 +31,7 @@ import jalview.datamodel.*;
 import jalview.io.SequenceAnnotationReport;
 import jalview.schemes.*;
 import jalview.structure.*;
+import jalview.util.MessageManager;
 
 /**
  * DOCUMENT ME!
@@ -129,8 +130,7 @@ public class SeqPanel extends JPanel implements MouseListener,
       addMouseMotionListener(this);
       addMouseListener(this);
       addMouseWheelListener(this);
-      ssm = StructureSelectionManager
-              .getStructureSelectionManager(Desktop.instance);
+      ssm = av.getStructureSelectionManager();
       ssm.addStructureViewerListener(this);
       ssm.addSelectionListener(this);
     }
@@ -307,7 +307,7 @@ public class SeqPanel extends JPanel implements MouseListener,
   {
     SequenceI sequence = av.getAlignment().getSequenceAt(seqCanvas.cursorY);
 
-    seqCanvas.cursorX = sequence.findIndex(getKeyboardNo1() - 1);
+    seqCanvas.cursorX = sequence.findIndex(getKeyboardNo1()) - 1;
     scrollToVisible();
   }
 
@@ -1431,8 +1431,8 @@ public class SeqPanel extends JPanel implements MouseListener,
     if (av.wrapAlignment && seq > av.getAlignment().getHeight())
     {
       JOptionPane.showInternalMessageDialog(Desktop.desktop,
-              "Cannot edit annotations in wrapped view.",
-              "Wrapped view - no edit", JOptionPane.WARNING_MESSAGE);
+              MessageManager.getString("label.cannot_edit_annotations_in_wrapped_view"),
+              MessageManager.getString("label.wrapped_view_no_edit"), JOptionPane.WARNING_MESSAGE);
       return;
     }