/*
- * 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.1)
+ * Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
*
* 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 <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.gui;
import jalview.io.IdentifyFile;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
+import jalview.util.MessageManager;
import jalview.ws.params.ParamManager;
import java.awt.BorderLayout;
void showPasteMenu(int x, int y)
{
JPopupMenu popup = new JPopupMenu();
- JMenuItem item = new JMenuItem("Paste To New Window");
+ JMenuItem item = new JMenuItem(MessageManager.getString("label.paste_new_window"));
item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent evt)
*/
public void drop(DropTargetDropEvent evt)
{
+ boolean success=true;
Transferable t = evt.getTransferable();
java.util.List files = null;
java.util.List protocols = null;
}
} catch (Exception e)
{
+ success=false;
}
if (files != null)
}
} catch (Exception ex)
{
+ success=false;
}
}
+ evt.dropComplete(success); // need this to ensure input focus is properly transfered to any new windows created
}
/**
jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
chooser.setFileView(new JalviewFileView());
- chooser.setDialogTitle("Open local file");
- chooser.setToolTipText("Open");
+ chooser.setDialogTitle(MessageManager.getString("label.open_local_file"));
+ chooser.setToolTipText(MessageManager.getString("action.open"));
int value = chooser.showOpenDialog(this);
.getSelectedFile().getParent());
String format = null;
- if (chooser.getSelectedFormat().equals("Jalview"))
+ if (chooser.getSelectedFormat()!=null && chooser.getSelectedFormat().equals("Jalview"))
{
format = "Jalview";
}
{
// This construct allows us to have a wider textfield
// for viewing
- JLabel label = new JLabel("Enter URL of Input File");
+ JLabel label = new JLabel(MessageManager.getString("label.input_file_url"));
final JComboBox history = new JComboBox();
JPanel panel = new JPanel(new GridLayout(2, 1));
}
int reply = JOptionPane.showInternalConfirmDialog(desktop, panel,
- "Input Alignment From URL", JOptionPane.OK_CANCEL_OPTION);
+ MessageManager.getString("label.input_alignment_from_url"), JOptionPane.OK_CANCEL_OPTION);
if (reply != JOptionPane.OK_OPTION)
{
{
JalviewFileChooser chooser = new JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
- { "jar" }, new String[]
+ { "jvp" }, new String[]
{ "Jalview Project" }, "Jalview Project");
chooser.setFileView(new JalviewFileView());
{
JalviewFileChooser chooser = new JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
- { "jar" }, new String[]
- { "Jalview Project" }, "Jalview Project");
+ { "jvp","jar" }, new String[]
+ { "Jalview Project", "Jalview Project (old)" }, "Jalview Project");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Restore state");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Open a saved VAMSAS session");
- chooser.setToolTipText("select a vamsas session to be opened as a new vamsas session.");
+ chooser.setToolTipText(MessageManager.getString("label.select_vamsas_session_opened_as_new_vamsas_session"));
int value = chooser.showOpenDialog(this);
if (!vamsasImport(chooser.getSelectedFile()))
{
JOptionPane.showInternalMessageDialog(Desktop.desktop,
- "Couldn't import '" + fle + "' as a new vamsas session.",
- "Vamsas Document Import Failed",
+ MessageManager.formatMessage("label.couldnt_import_as_vamsas_session", new String[]{fle}),
+ MessageManager.getString("label.vamsas_document_import_failed"),
JOptionPane.ERROR_MESSAGE);
}
}
protected void setupVamsasConnectedGui()
{
- vamsasStart.setText("Session Update");
+ vamsasStart.setText(MessageManager.getString("label.session_update"));
vamsasSave.setVisible(true);
vamsasStop.setVisible(true);
vamsasImport.setVisible(false); // Document import to existing session is
vamsasSave.setVisible(false);
vamsasStop.setVisible(false);
vamsasImport.setVisible(true);
- vamsasStart.setText("New Vamsas Session");
+ vamsasStart.setText(MessageManager.getString("label.new_vamsas_session"));
}
public void vamsasStop_actionPerformed(ActionEvent e)
{
JMenuItem sessit = new JMenuItem();
sessit.setText(sess[i]);
- sessit.setToolTipText("Connect to session " + sess[i]);
+ sessit.setToolTipText(MessageManager.formatMessage("label.connect_to_session", new String[]{sess[i]}));
final Desktop dsktp = this;
final String mysesid = sess[i];
sessit.addActionListener(new ActionListener()
if (fm != null)
{
g.drawString(
- "Total Free Memory: " + df.format(totalFreeMemory)
- + "MB; Max Memory: " + df.format(maxMemory)
- + "MB; " + df.format(percentUsage) + "%", 10,
+ MessageManager.formatMessage("label.memory_stats", new String[]{df.format(totalFreeMemory),df.format(maxMemory),df.format(percentUsage)}), 10,
getHeight() - fm.getHeight());
}
}
if (jalview.bin.Cache.groovyJarsPresent())
{
groovyShell = new JMenuItem();
- groovyShell.setText("Groovy Console...");
+ groovyShell.setText(MessageManager.getString("label.groovy_console"));
groovyShell.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
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()
{