X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignFrame.java;h=0a4f4b83de92db42759ed09a02baeebec152a625;hb=87ea83af3e209a8c3a4b19f9530a9c05b4541148;hp=d984f3ce0fc4d0a286758cd0fc0eb521630dab1a;hpb=b57a02c25e335d033c97f8a6bacd6b54f62bd2b6;p=jalview.git diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java old mode 100755 new mode 100644 index d984f3c..0a4f4b8 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1,18 +1,18 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) - * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle - * + * 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 + * * 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 + * 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. - * - * 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 + * + * 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 . */ package jalview.gui; @@ -75,6 +75,7 @@ import jalview.schemes.TaylorColourScheme; import jalview.schemes.TurnColourScheme; import jalview.schemes.UserColourScheme; import jalview.schemes.ZappoColourScheme; +import jalview.util.MessageManager; import jalview.ws.jws1.Discoverer; import jalview.ws.jws2.Jws2Discoverer; import jalview.ws.seqfetcher.DbSourceProxy; @@ -475,8 +476,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, case KeyEvent.VK_F2: viewport.cursorMode = !viewport.cursorMode; - statusBar.setText("Keyboard editing mode is " - + (viewport.cursorMode ? "on" : "off")); + statusBar.setText(MessageManager.formatMessage("label.keyboard_editing_mode", new String[]{(viewport.cursorMode ? "on" : "off")})); if (viewport.cursorMode) { alignPanel.seqPanel.seqCanvas.cursorX = viewport.startRes; @@ -808,7 +808,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, final JPanel progressPanel = (JPanel) progressBars.get(new Long(id)); if (handler.canCancel()) { - JButton cancel = new JButton("Cancel"); + JButton cancel = new JButton(MessageManager.getString("action.cancel")); final IProgressIndicator us = this; cancel.addActionListener(new ActionListener() { @@ -1025,8 +1025,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, success = new Jalview2XML().SaveAlignment(this, file, shortName); - statusBar.setText("Successfully saved to file: " + fileName + " in " - + format + " format."); + statusBar.setText(MessageManager.formatMessage("label.successfully_saved_to_file_in_format",new String[]{fileName, format})); + } else @@ -1079,8 +1079,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, out.print(output); out.close(); this.setTitle(file); - statusBar.setText("Successfully saved to file: " + fileName - + " in " + format + " format."); + statusBar.setText(MessageManager.formatMessage("label.successfully_saved_to_file_in_format",new String[]{fileName, format})); } catch (Exception ex) { success = false; @@ -1347,12 +1346,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { undoMenuItem.setEnabled(true); CommandI command = (CommandI) viewport.historyList.peek(); - undoMenuItem.setText("Undo " + command.getDescription()); + undoMenuItem.setText(MessageManager.formatMessage("label.undo_command", new String[]{command.getDescription()})); } else { undoMenuItem.setEnabled(false); - undoMenuItem.setText("Undo"); + undoMenuItem.setText(MessageManager.getString("action.undo")); } if (viewport.redoList.size() > 0) @@ -1360,12 +1359,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, redoMenuItem.setEnabled(true); CommandI command = (CommandI) viewport.redoList.peek(); - redoMenuItem.setText("Redo " + command.getDescription()); + redoMenuItem.setText(MessageManager.formatMessage("label.redo_command", new String[]{command.getDescription()})); } else { redoMenuItem.setEnabled(false); - redoMenuItem.setText("Redo"); + redoMenuItem.setText(MessageManager.getString("action.redo")); } } @@ -1693,7 +1692,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, Desktop.jalviewClipboard = new Object[] { seqs, viewport.getAlignment().getDataset(), hiddenColumns }; - statusBar.setText("Copied " + seqs.length + " sequences to clipboard."); + statusBar.setText(MessageManager.formatMessage("label.copied_sequences_to_clipboard", new String[]{Integer.valueOf(seqs.length).toString()})); } /** @@ -2294,7 +2293,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, viewport.getSelectionGroup()); } - statusBar.setText("Removed " + trimRegion.getSize() + " columns."); + statusBar.setText(MessageManager.formatMessage("label.removed_columns", new String[]{Integer.valueOf(trimRegion.getSize()).toString()})); addHistoryItem(trimRegion); @@ -2342,8 +2341,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, addHistoryItem(removeGapCols); - statusBar.setText("Removed " + removeGapCols.getSize() - + " empty columns."); + statusBar.setText(MessageManager.formatMessage("label.removed_empty_columns", new String[]{Integer.valueOf(removeGapCols.getSize()).toString()})); // This is to maintain viewport position on first residue // of first sequence @@ -2951,7 +2949,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, editPane.setEditable(false); StringBuffer contents = new AlignmentProperties(viewport.getAlignment()) .formatAsHtml(); - editPane.setText("" + contents.toString() + ""); + editPane.setText(MessageManager.formatMessage("label.html_content", new String[]{contents.toString()})); JInternalFrame frame = new JInternalFrame(); frame.getContentPane().add(new JScrollPane(editPane)); @@ -4603,7 +4601,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } catch (Exception ex) { al = null; - jalview.bin.Cache.log.debug("Exception during translation.", ex); + jalview.bin.Cache.log.error("Exception during translation. Please report this !", ex); + JOptionPane + .showMessageDialog( + Desktop.desktop, + "Unfortunately, something went wrong when translating your sequences.\nPlease take a look in the Jalview java console\nand submit a bug report including the stacktrace.", + "Implementation error: Translation Failed", JOptionPane.ERROR_MESSAGE); + return; } if (al == null) { @@ -4908,8 +4912,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, tcoffeeColour.setSelected(true); changeColour(new TCoffeeColourScheme(viewport.getAlignment())); isAnnotation = true; - statusBar - .setText("Successfully pasted T-Coffee scores to alignment."); + statusBar.setText(MessageManager.getString("label.successfully_pasted_tcoffee_scores_to_alignment")); } else { @@ -4918,9 +4921,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, JOptionPane .showMessageDialog( Desktop.desktop, - tcf.getWarningMessage() == null ? "Check that the file matches sequence IDs in the alignment." + tcf.getWarningMessage() == null ? MessageManager.getString("label.check_file_matches_sequence_ids_alignment") : tcf.getWarningMessage(), - "Problem reading T-COFFEE score file", + MessageManager.getString("label.problem_reading_tcoffee_score_file"), JOptionPane.WARNING_MESSAGE); } } @@ -5317,7 +5320,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, ++i; if (++icomp >= mcomp || i == (otherdb.size())) { - ifetch.setText(imname + " to '" + sname + "'"); + ifetch.setText(MessageManager.formatMessage("label.source_to_target",new String[]{imname,sname})); dfetch.add(ifetch); ifetch = new JMenu(); imname = null; @@ -5329,7 +5332,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, ++dbi; if (comp >= mcomp || dbi >= (dbclasses.length)) { - dfetch.setText(mname + " to '" + dbclass + "'"); + dfetch.setText(MessageManager.formatMessage("label.source_to_target",new String[]{mname,dbclass})); rfetch.add(dfetch); dfetch = new JMenu(); mname = null;