git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4815037
)
Distinguish text-only output formats and others (.jar/.jvp)
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Thu, 24 Nov 2016 16:43:06 +0000
(16:43 +0000)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Thu, 24 Nov 2016 16:43:06 +0000
(16:43 +0000)
src/jalview/appletgui/APopupMenu.java
patch
|
blob
|
history
src/jalview/appletgui/AlignFrame.java
patch
|
blob
|
history
src/jalview/gui/PopupMenu.java
patch
|
blob
|
history
src/jalview/io/FileFormat.java
patch
|
blob
|
history
src/jalview/io/FileFormatI.java
patch
|
blob
|
history
src/jalview/jbgui/GAlignFrame.java
patch
|
blob
|
history
diff --git
a/src/jalview/appletgui/APopupMenu.java
b/src/jalview/appletgui/APopupMenu.java
index
1b66e9c
..
fbdf241
100644
(file)
--- a/
src/jalview/appletgui/APopupMenu.java
+++ b/
src/jalview/appletgui/APopupMenu.java
@@
-217,7
+217,7
@@
public class APopupMenu extends java.awt.PopupMenu implements
e.printStackTrace();
}
e.printStackTrace();
}
- for (String ff : FileFormat.getWritableFormats())
+ for (String ff : FileFormat.getWritableFormats(true))
{
MenuItem item = new MenuItem(ff);
{
MenuItem item = new MenuItem(ff);
diff --git
a/src/jalview/appletgui/AlignFrame.java
b/src/jalview/appletgui/AlignFrame.java
index
e1b01a8
..
fcdf9d2
100644
(file)
--- a/
src/jalview/appletgui/AlignFrame.java
+++ b/
src/jalview/appletgui/AlignFrame.java
@@
-3241,7
+3241,7
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
inputText.addActionListener(this);
Menu outputTextboxMenu = new Menu(
MessageManager.getString("label.out_to_textbox"));
inputText.addActionListener(this);
Menu outputTextboxMenu = new Menu(
MessageManager.getString("label.out_to_textbox"));
- for (String ff : FileFormat.getWritableFormats())
+ for (String ff : FileFormat.getWritableFormats(true))
{
MenuItem item = new MenuItem(ff);
{
MenuItem item = new MenuItem(ff);
diff --git
a/src/jalview/gui/PopupMenu.java
b/src/jalview/gui/PopupMenu.java
index
4d9dc4d
..
9f65708
100644
(file)
--- a/
src/jalview/gui/PopupMenu.java
+++ b/
src/jalview/gui/PopupMenu.java
@@
-258,7
+258,7
@@
public class PopupMenu extends JPopupMenu
colours.add(purinePyrimidineColour);
colours.add(RNAInteractionColour);
colours.add(purinePyrimidineColour);
colours.add(RNAInteractionColour);
- for (String ff : FileFormat.getWritableFormats())
+ for (String ff : FileFormat.getWritableFormats(true))
{
JMenuItem item = new JMenuItem(ff);
{
JMenuItem item = new JMenuItem(ff);
diff --git
a/src/jalview/io/FileFormat.java
b/src/jalview/io/FileFormat.java
index
a43bc22
..
d0ce86e
100644
(file)
--- a/
src/jalview/io/FileFormat.java
+++ b/
src/jalview/io/FileFormat.java
@@
-218,7
+218,7
@@
public enum FileFormat implements FileFormatI
}
},
}
},
- Pileup("PileUp", "pileup", false, true)
+ Pileup("PileUp", "pileup", true, true)
{
@Override
public AlignmentFileI getAlignmentFile(String inFile,
{
@Override
public AlignmentFileI getAlignmentFile(String inFile,
@@
-329,7
+329,7
@@
public enum FileFormat implements FileFormatI
}
},
}
},
- Features("GFF or Jalview features", "gff2,gff3", false, false)
+ Features("GFF or Jalview features", "gff2,gff3", true, false)
{
@Override
public AlignmentFileI getAlignmentFile(String inFile,
{
@Override
public AlignmentFileI getAlignmentFile(String inFile,
@@
-351,7
+351,7
@@
public enum FileFormat implements FileFormatI
return new FeaturesFile();
}
},
return new FeaturesFile();
}
},
- PDB("PDB", "", false, false)
+ PDB("PDB", "pdb,ent", true, false)
{
@Override
{
@Override
@@
-414,7
+414,7
@@
public enum FileFormat implements FileFormatI
return new JmolParser(); // todo or null?
}
},
return new JmolParser(); // todo or null?
}
},
- MMCif("mmCIF", "cif", false, false)
+ MMCif("mmCIF", "cif", true, false)
{
@Override
{
@Override
@@
-445,7
+445,7
@@
public enum FileFormat implements FileFormatI
return new JmolParser(); // todo or null?
}
},
return new JmolParser(); // todo or null?
}
},
- Jalview("Jalview", "jar,jvp", true, false)
+ Jalview("Jalview", "jar,jvp", true, true)
{
@Override
{
@Override
@@
-467,6
+467,12
@@
public enum FileFormat implements FileFormatI
{
return null;
}
{
return null;
}
+
+ @Override
+ public boolean isTextFormat()
+ {
+ return false;
+ }
};
/**
};
/**
@@
-496,12
+502,12
@@
public enum FileFormat implements FileFormatI
*
* @return
*/
*
* @return
*/
- public static List<String> getWritableFormats()
+ public static List<String> getWritableFormats(boolean textOnly)
{
List<String> l = new ArrayList<String>();
for (FileFormatI ff : values())
{
{
List<String> l = new ArrayList<String>();
for (FileFormatI ff : values())
{
- if (ff.isWritable())
+ if (ff.isWritable() && (!textOnly || ff.isTextFormat()))
{
l.add(ff.toString());
}
{
l.add(ff.toString());
}
@@
-596,4
+602,10
@@
public enum FileFormat implements FileFormatI
{
return getAlignmentFile((AlignmentI) null);
}
{
return getAlignmentFile((AlignmentI) null);
}
+
+ @Override
+ public boolean isTextFormat()
+ {
+ return true;
+ }
}
}
diff --git
a/src/jalview/io/FileFormatI.java
b/src/jalview/io/FileFormatI.java
index
082d9f1
..
319df9f
100644
(file)
--- a/
src/jalview/io/FileFormatI.java
+++ b/
src/jalview/io/FileFormatI.java
@@
-10,6
+10,7
@@
public interface FileFormatI
AlignmentFileI getAlignmentFile(String inFile, DataSourceType sourceType)
throws IOException;
AlignmentFileI getAlignmentFile(String inFile, DataSourceType sourceType)
throws IOException;
+ // TODO can we get rid of one of these methods?
AlignmentFileI getAlignmentFile(FileParse source) throws IOException;
AlignmentFileI getAlignmentFile(AlignmentI al);
AlignmentFileI getAlignmentFile(FileParse source) throws IOException;
AlignmentFileI getAlignmentFile(AlignmentI al);
@@
-26,7
+27,30
@@
public interface FileFormatI
*/
String getExtensions();
*/
String getExtensions();
+ /**
+ * Answers true if the format is one that Jalview can read. This implies that
+ * the format provides implementations for getAlignmentFile(FileParse) and
+ * getAlignmentFile(String, DataSourceType) which parse the data source for
+ * sequence data.
+ *
+ * @return
+ */
boolean isReadable();
boolean isReadable();
+ /**
+ * Answers true if the format is one that Jalview can write. This implies that
+ * the object returned by getAlignmentFile provides an implementation of the
+ * print() method.
+ *
+ * @return
+ */
boolean isWritable();
boolean isWritable();
+
+ /**
+ * Answers true if the format is one that Jalview can output as text, e.g. to
+ * a text box
+ *
+ * @return
+ */
+ boolean isTextFormat();
}
}
diff --git
a/src/jalview/jbgui/GAlignFrame.java
b/src/jalview/jbgui/GAlignFrame.java
index
73d1b3c
..
44c4192
100755
(executable)
--- a/
src/jalview/jbgui/GAlignFrame.java
+++ b/
src/jalview/jbgui/GAlignFrame.java
@@
-245,7
+245,7
@@
public class GAlignFrame extends JInternalFrame
setJMenuBar(alignFrameMenuBar);
// dynamically fill save as menu with available formats
setJMenuBar(alignFrameMenuBar);
// dynamically fill save as menu with available formats
- for (String ff : FileFormat.getWritableFormats())
+ for (String ff : FileFormat.getWritableFormats(true))
{
JMenuItem item = new JMenuItem(ff);
{
JMenuItem item = new JMenuItem(ff);