diff --git a/uk/ac/sanger/artemis/components/EntryFileDialog.java b/uk/ac/sanger/artemis/components/EntryFileDialog.java index 0d500e2f8f7974ee454743583df2edc0357d4505..d12145421298122c8c3af1aa9e6090faa6a94904 100644 --- a/uk/ac/sanger/artemis/components/EntryFileDialog.java +++ b/uk/ac/sanger/artemis/components/EntryFileDialog.java @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/EntryFileDialog.java,v 1.8 2008-06-23 13:31:26 tjc Exp $ + * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/EntryFileDialog.java,v 1.9 2008-06-23 13:53:46 tjc Exp $ */ package uk.ac.sanger.artemis.components; @@ -42,7 +42,7 @@ import javax.swing.*; * This class is a JFileChooser that can read EMBL Entry objects. * * @author Kim Rutherford - * @version $Id: EntryFileDialog.java,v 1.8 2008-06-23 13:31:26 tjc Exp $ + * @version $Id: EntryFileDialog.java,v 1.9 2008-06-23 13:53:46 tjc Exp $ **/ public class EntryFileDialog extends StickyFileChooser @@ -442,7 +442,7 @@ public class EntryFileDialog extends StickyFileChooser try { if(entry.getEMBLEntry() instanceof DatabaseDocumentEntry) - ReadAndWriteEntry.writeEntry(entry, file, + ReadAndWriteEntry.writeDatabaseEntryToFile(entry, file, flattenGeneModel.isSelected(), false, destination_type); else if(include_diana_extensions) entry.save(file, destination_type, false); @@ -460,7 +460,7 @@ public class EntryFileDialog extends StickyFileChooser try { if(entry.getEMBLEntry() instanceof DatabaseDocumentEntry) - ReadAndWriteEntry.writeEntry(entry, file, + ReadAndWriteEntry.writeDatabaseEntryToFile(entry, file, flattenGeneModel.isSelected(), true, destination_type); else if(include_diana_extensions) entry.save(file, destination_type, true); diff --git a/uk/ac/sanger/artemis/components/ReadAndWriteEntry.java b/uk/ac/sanger/artemis/components/ReadAndWriteEntry.java index 81be4eb7482948c912cdfc1d1a73f88db0a9e875..2a68f618ed71c7ce063ae6656d12d1644964d5a6 100644 --- a/uk/ac/sanger/artemis/components/ReadAndWriteEntry.java +++ b/uk/ac/sanger/artemis/components/ReadAndWriteEntry.java @@ -102,14 +102,21 @@ class ReadAndWriteEntry * Write entry to a file * @param entry * @param file - * @param flatten if true the gene model is flattened + * @param flatten Flatten the gene model and combine the qualifiers if true. + * If false it will write all features and qualifiers out. + * @param force invalid qualifiers and any features with invalid keys will + * be quietly thrown away when saving. + * @param destination_type Should be one of EMBL_FORMAT, GENBANK_FORMAT, + * GFF_FORMAT or ANY_FORMAT. If ANY_FORMAT then the Entry will + * be saved in the same format it was created, otherwise it will be saved + * in the given format. * @throws IOException * @throws EntryInformationException */ - public static void writeEntry(final Entry entry, final File file, - final boolean flatten, - final boolean force, - final int destination_type) + public static void writeDatabaseEntryToFile(final Entry entry, final File file, + final boolean flatten, + final boolean force, + final int destination_type) throws IOException, EntryInformationException { GeneUtils.lazyLoadAll(entry, null); @@ -195,11 +202,11 @@ class ReadAndWriteEntry try { Entry entry = ReadAndWriteEntry.readEntryFromDatabase("Pf3D7_03"); - ReadAndWriteEntry.writeEntry( + ReadAndWriteEntry.writeDatabaseEntryToFile( entry, new File("Pf3D7_03.flatten"), true, false, DocumentEntryFactory.EMBL_FORMAT); - ReadAndWriteEntry.writeEntry( + ReadAndWriteEntry.writeDatabaseEntryToFile( entry, new File("Pf3D7_03.not-flatten"), false, false, DocumentEntryFactory.EMBL_FORMAT); }