X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FSeqPanel.java;h=bf5ea93ae810f40254271409344422284472ce78;hb=ae216fceddd8539d20fa5425cdaef3da73aba8f0;hp=9c3d557af1c9ee6dea0ae5e7a7cc9d47aa4e737a;hpb=fc853e3c385e32591ceac07070d37932fcf87941;p=jalview.git diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 9c3d557..bf5ea93 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1,21 +1,23 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) - * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) + * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ - package jalview.gui; import java.util.*; @@ -31,6 +33,7 @@ import jalview.datamodel.*; import jalview.io.SequenceAnnotationReport; import jalview.schemes.*; import jalview.structure.*; +import jalview.util.MessageManager; /** * DOCUMENT ME! @@ -129,8 +132,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 +309,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(); } @@ -518,29 +520,34 @@ public class SeqPanel extends JPanel implements MouseListener, int getKeyboardNo1() { - try { - if (keyboardNo1 != null) + try { - int value = Integer.parseInt(keyboardNo1.toString()); - keyboardNo1 = null; - return value; - } + if (keyboardNo1 != null) + { + int value = Integer.parseInt(keyboardNo1.toString()); + keyboardNo1 = null; + return value; + } } catch (Exception x) - {} + { + } keyboardNo1 = null; return 1; } int getKeyboardNo2() { - try { - if (keyboardNo2!=null){ - int value = Integer.parseInt(keyboardNo2.toString()); - keyboardNo2 = null; - return value; - } + try + { + if (keyboardNo2 != null) + { + int value = Integer.parseInt(keyboardNo2.toString()); + keyboardNo2 = null; + return value; + } } catch (Exception x) - {} + { + } keyboardNo2 = null; return 1; } @@ -1430,9 +1437,10 @@ 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); + JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager + .getString("label.cannot_edit_annotations_in_wrapped_view"), + MessageManager.getString("label.wrapped_view_no_edit"), + JOptionPane.WARNING_MESSAGE); return; }