Desktop.instance.removeJalviewPropertyChangeListener("services",
thisListener);
closeMenuItem_actionPerformed(true);
- };
+ }
});
// Finally, build the menu once to get current service state
new Thread(new Runnable()
@Override
public void setStatus(String text)
{
- // BH note: If text width and height are 0, then the layout manager
- // will dispense of it and change the frame height.
- // In JavaScript, we use \u00A0 -- unicode "non-breaking space"
- // which is the unicode encoding of
-
statusBar.setText(text == null || text.isEmpty() ? " " : text);
}
*/
public void saveAlignment(String file, FileFormatI format)
{
- lastSaveSuccessful = false;
+ lastSaveSuccessful = true;
lastFilenameSaved = file;
lastFormatSaved = format;
else
{
// create backupfiles object and get new temp filename destination
- BackupFiles backupfiles = new BackupFiles(file);
+ boolean doBackup = BackupFiles.getEnabled();
+ BackupFiles backupfiles = doBackup ? new BackupFiles(file) : null;
try
{
- PrintWriter out = new PrintWriter(
- new FileWriter(backupfiles.getTempFilePath()));
+ String tempFilePath = doBackup ? backupfiles.getTempFilePath() : file;
+ PrintWriter out = new PrintWriter(
+ new FileWriter(tempFilePath));
out.print(output);
out.close();
statusBar.setText(MessageManager.formatMessage(
"label.successfully_saved_to_file_in_format", new Object[]
{ fileName, format.getName() }));
+ lastSaveSuccessful = true;
} catch (Exception ex)
{
lastSaveSuccessful = false;
ex.printStackTrace();
}
- backupfiles.setWriteSuccess(lastSaveSuccessful);
- // do the backup file roll and rename the temp file to actual file
- lastSaveSuccessful = backupfiles.rollBackupsAndRenameTempFile();
+ if (doBackup)
+ {
+ backupfiles.setWriteSuccess(lastSaveSuccessful);
+ // do the backup file roll and rename the temp file to actual file
+ lastSaveSuccessful = backupfiles.rollBackupsAndRenameTempFile();
+ }
}
}
};
{
overview.dispose();
alignPanel.setOverviewPanel(null);
- };
+ }
});
if (getKeyListeners().length > 0)
{
trimrs.setSelected(trimrs.isSelected());
Cache.setProperty(DBRefFetcher.TRIM_RETRIEVED_SEQUENCES,
Boolean.valueOf(trimrs.isSelected()).toString());
- };
+ }
});
rfetch.add(trimrs);
JMenuItem fetchr = new JMenuItem(
Cache.setProperty("LAST_DIRECTORY", choice);
SequenceI[] seqs = viewport.getAlignment().getSequencesArray();
new VCFLoader(choice).loadVCF(seqs, us);
- };
+ }
});
chooser.showOpenDialog(null);