* DOCUMENT ME!
*/
@Override
- public void saveState_actionPerformed(ActionEvent e)
+ public void saveState_actionPerformed(boolean asCastor)
{
- JalviewFileChooser chooser = new JalviewFileChooser("jvp",
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ asCastor ? "jvp" : "jvx",
"Jalview Project");
chooser.setFileView(new JalviewFileView());
// TODO prevent user from messing with the Desktop whilst we're saving
try
{
- new Jalview2XML().saveState(choice);
+ if (asCastor)
+ {
+ new Jalview2XML().saveState(choice);
+ }
+ else
+ {
+ new jalview.project.Jalview2XML().saveState(choice);
+ }
} catch (OutOfMemoryError oom)
{
new OOMWarning(
* DOCUMENT ME!
*/
@Override
- public void loadState_actionPerformed(ActionEvent e)
- {
+ public void loadState_actionPerformed(boolean asCastor)
+ {
+ final String[] suffix = asCastor ? new String[] { "jvp", "jar" }
+ : new String[]
+ { "jvx" };
+ final String[] desc = asCastor
+ ? new String[]
+ { "Jalview Project", "Jalview Project (old)" }
+ : new String[]
+ { "Jalview Project" };
JalviewFileChooser chooser = new JalviewFileChooser(
- Cache.getProperty("LAST_DIRECTORY"), new String[]
- { "jvp", "jar" },
- new String[]
- { "Jalview Project", "Jalview Project (old)" },
+ Cache.getProperty("LAST_DIRECTORY"), suffix,
+ desc,
"Jalview Project");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.restore_state"));
{ choice }), choice.hashCode());
try
{
- new Jalview2XML().loadJalviewAlign(choice);
+ if (asCastor)
+ {
+ new Jalview2XML().loadJalviewAlign(choice);
+ }
+ else
+ {
+ new jalview.project.Jalview2XML().loadJalviewAlign(choice);
+ }
} catch (OutOfMemoryError oom)
{
new OOMWarning("Whilst loading project from " + choice, oom);
@Override
public void actionPerformed(ActionEvent e)
{
- saveState_actionPerformed(e);
+ saveState_actionPerformed(true);
+ }
+ });
+ JMenuItem saveAsJaxb = new JMenuItem("Save Project as JAXB");
+ saveAsJaxb.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ saveState_actionPerformed(false);
}
});
loadState.setText(MessageManager.getString("action.load_project"));
@Override
public void actionPerformed(ActionEvent e)
{
- loadState_actionPerformed(e);
+ loadState_actionPerformed(true);
+ }
+ });
+ JMenuItem loadAsJaxb = new JMenuItem("Load Project as JAXB");
+ loadAsJaxb.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ loadState_actionPerformed(false);
}
});
inputMenu.setText(MessageManager.getString("label.input_alignment"));
FileMenu.add(inputSequence);
FileMenu.addSeparator();
FileMenu.add(saveState);
+ FileMenu.add(saveAsJaxb);
FileMenu.add(loadState);
+ FileMenu.add(loadAsJaxb);
FileMenu.addSeparator();
FileMenu.add(quit);
HelpMenu.add(aboutMenuItem);
* @param e
* DOCUMENT ME!
*/
- public void saveState_actionPerformed(ActionEvent e)
+ public void saveState_actionPerformed(boolean asCastor)
{
}
* @param e
* DOCUMENT ME!
*/
- public void loadState_actionPerformed(ActionEvent e)
+ public void loadState_actionPerformed(boolean asCastor)
{
}