From: James Procter Date: Mon, 30 Oct 2023 11:24:22 +0000 (+0000) Subject: Handle feature settings files loaded via drag and drop or import X-Git-Tag: Release_2_11_4_0~119^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ffeature%2FJAL-4315_fc_draganddrop;p=jalview.git Handle feature settings files loaded via drag and drop or import --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index ac8ffb9..958ebcc 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -4818,7 +4818,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * Object[] { String,SequenceI} */ ArrayList filesmatched = new ArrayList<>(); - ArrayList filesnotmatched = new ArrayList<>(); + ArrayList filesnotmatched = new ArrayList<>(); for (int i = 0; i < files.size(); i++) { // BH 2018 @@ -4864,9 +4864,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } mtch = idm.findAllIdMatches(pdbfn); } + FileFormatI type=null; if (mtch != null) { - FileFormatI type; try { type = new IdentifyFile().identify(file, protocol); @@ -4882,7 +4882,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } // File wasn't named like one of the sequences or wasn't a PDB // file. - filesnotmatched.add(file); + filesnotmatched.add(new Object[] { file, protocol, type}); } } int assocfiles = 0; @@ -4936,7 +4936,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, */ for (Object[] o : filesmatched) { - filesnotmatched.add(o[0]); + filesnotmatched.add(new Object[] { o[0], o[1]}); } } } @@ -4958,9 +4958,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { return; } - for (Object fn : filesnotmatched) + for (Object[] fn : filesnotmatched) { - loadJalviewDataFile(fn, null, null, null); + loadJalviewDataFile(fn[0], (DataSourceType) fn[1], (FileFormatI)fn[2], null); } } @@ -5056,7 +5056,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { format = new IdentifyFile().identify(file, sourceType); } - if (FileFormat.ScoreMatrix == format) + if (FileFormat.FeatureSettings == format) + { + if (featureSettings != null) + { + featureSettings.load(file, sourceType); + } + else + { + FeatureSettings.loadFeatureSettingsFile(getFeatureRenderer(), + fileObject, sourceType); + } + } + else if (FileFormat.ScoreMatrix == format) { ScoreMatrixFile sm = new ScoreMatrixFile( new FileParse(file, sourceType));