* Try to load a features file onto the alignment.
*
* @param file
- * contents or path to retrieve file
+ * contents or path to retrieve file or a File object
* @param sourceType
* access mode of file (see jalview.io.AlignFile)
* @return true if features file was parsed correctly.
*/
- public boolean parseFeaturesFile(String file, DataSourceType sourceType)
+ public boolean parseFeaturesFile(Object file, DataSourceType sourceType)
{
+ // BH 2018
return avc.parseFeaturesFile(file, sourceType,
Cache.getDefault("RELAXEDSEQIDMATCHING", false));
// Java's Transferable for native dnd
evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
Transferable t = evt.getTransferable();
+
+
final AlignFrame thisaf = this;
- final List<String> files = new ArrayList<>();
+ final List<Object> files = new ArrayList<>();
List<DataSourceType> protocols = new ArrayList<>();
try
* Object[] { String,SequenceI}
*/
ArrayList<Object[]> filesmatched = new ArrayList<>();
- ArrayList<String> filesnotmatched = new ArrayList<>();
+ ArrayList<Object> filesnotmatched = new ArrayList<>();
for (int i = 0; i < files.size(); i++)
{
- String file = files.get(i).toString();
+ // BH 2018
+ Object file = files.get(i);
+ String fileName = file.toString();
String pdbfn = "";
- DataSourceType protocol = FormatAdapter.checkProtocol(file);
+ DataSourceType protocol = (file instanceof File ? DataSourceType.FILE : FormatAdapter.checkProtocol(fileName));
if (protocol == DataSourceType.FILE)
{
- File fl = new File(file);
+ File fl = (file instanceof File ? (File) file : new File(fileName));
pdbfn = fl.getName();
}
else if (protocol == DataSourceType.URL)
{
- URL url = new URL(file);
+ URL url = new URL(fileName);
pdbfn = url.getFile();
}
if (pdbfn.length() > 0)
}
if (mtch != null)
{
- FileFormatI type = null;
+ FileFormatI type;
try
{
type = new IdentifyFile().identify(file, protocol);
{
return;
}
- for (String fn : filesnotmatched)
+ for (Object fn : filesnotmatched)
{
loadJalviewDataFile(fn, null, null, null);
}
* @param file
* either a filename or a URL string.
*/
- public void loadJalviewDataFile(String file, DataSourceType sourceType,
+ public void loadJalviewDataFile(Object file, DataSourceType sourceType,
FileFormatI format, SequenceI assocSeq)
{
+ // BH 2018 was String file
try
{
if (sourceType == null)