addKeyListener();
}
-
+ /**
+ * Change the filename and format for the alignment, and
+ * enable the 'reload' button functionality.
+ * @param file valid filename
+ * @param format format of file
+ */
public void setFileName(String file, String format)
{
fileName = file;
public void save_actionPerformed(ActionEvent e)
{
if(fileName==null
- || currentFileFormat==null
+ || (currentFileFormat==null || jalview.io.AppletFormatAdapter.isValidFormat(currentFileFormat, true))
|| fileName.startsWith("http")
)
{
}
else
- {
-
+ {
+ if (!jalview.io.AppletFormatAdapter.isValidFormat(format, true))
+ {
+ // JBPNote need to have a raise_gui flag here
+ JOptionPane.showInternalMessageDialog(
+ this, "Cannot save file " + fileName + " using format "+format,
+ "Alignment output format not supported",
+ JOptionPane.WARNING_MESSAGE);
+ saveAs_actionPerformed(null);
+ return false;
+ }
+
String[] omitHidden = null;
if (viewport.hasHiddenColumns)
}
}
FormatAdapter f = new FormatAdapter();
-
String output = f.formatSequences(
format,
(Alignment) viewport.alignment, // class cast exceptions will occur in the distant future
}
/**
- * DOCUMENT ME!
+ * Paste contents of Jalview clipboard
*
- * @param newAlignment DOCUMENT ME!
+ * @param newAlignment true to paste to a new alignment, otherwise add to this.
*/
void paste(boolean newAlignment)
{