X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFileLoader.java;h=f3a4a1ca21f25a80907af307b0a2050f983dc2ff;hb=6fd5f99f753ae1ce8c09b22fff11de2b6cdb3954;hp=088e384bde9e4c283edaca82ec64e531649ecea4;hpb=d1f25a5bd328b4f9a47bf98fe85e00209b91e0f2;p=jalview.git diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 088e384..f3a4a1c 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -29,8 +29,6 @@ import jalview.bin.Jalview; import jalview.datamodel.AlignmentI; import jalview.datamodel.HiddenColumns; import jalview.datamodel.PDBEntry; -import jalview.datamodel.Profile; -import jalview.datamodel.Profiles; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; @@ -283,7 +281,8 @@ public class FileLoader implements Runnable @Override public void run() { - String title = protocol == DataSourceType.PASTE ? "Copied From Clipboard" + String title = protocol == DataSourceType.PASTE + ? "Copied From Clipboard" : file; Runtime rt = Runtime.getRuntime(); try @@ -314,8 +313,7 @@ public class FileLoader implements Runnable + "\" has null or unidentifiable data content!"); if (!Jalview.isHeadlessMode()) { - JvOptionPane.showInternalMessageDialog( - Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager.getString("label.couldnt_read_data") + " in " + file + "\n" + AppletFormatAdapter.getSupportedFormats(), @@ -342,8 +340,8 @@ public class FileLoader implements Runnable if (source != null) { // Tell the user (developer?) that this is going to cause a problem - System.err - .println("IMPLEMENTATION ERROR: Cannot read consecutive Jalview XML projects from a stream."); + System.err.println( + "IMPLEMENTATION ERROR: Cannot read consecutive Jalview XML projects from a stream."); // We read the data anyway - it might make sense. } alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign(file); @@ -368,9 +366,10 @@ public class FileLoader implements Runnable if (downloadStructureFile) { String structExt = format.getExtensions().split(",")[0]; - String urlLeafName = file.substring(file.lastIndexOf(System - .getProperty("file.separator")), file - .lastIndexOf(".")); + String urlLeafName = file.substring( + file.lastIndexOf( + System.getProperty("file.separator")), + file.lastIndexOf(".")); String tempStructureFileStr = createNamedJvTempFile( urlLeafName, structExt); UrlDownloadClient.download(file, tempStructureFileStr); @@ -405,8 +404,9 @@ public class FileLoader implements Runnable { // register PDB entries with desktop's structure selection // manager - StructureSelectionManager.getStructureSelectionManager( - Desktop.instance).registerPDBEntry(pdbe); + StructureSelectionManager + .getStructureSelectionManager(Desktop.instance) + .registerPDBEntry(pdbe); } } } @@ -426,6 +426,7 @@ public class FileLoader implements Runnable AlignmentI alignment = viewport.getAlignment(); SequenceI seq = alignment .getSequenceAt(alignment.getAbsoluteHeight() - 1); + seq.setIsHMMConsensusSequence(true); alignment.deleteSequence(alignment.getAbsoluteHeight() - 1); SequenceGroup sg = viewport.getSelectionGroup(); if (sg != null) @@ -443,19 +444,14 @@ public class FileLoader implements Runnable { alignment.insertSequenceAt(0, seq); } - viewport.initInformation(); - viewport.setSequenceInformationHash( - new Profiles(new Profile[1]), 0); - viewport.updateInformation(viewport.getAlignPanel()); viewport.getAlignPanel().adjustAnnotationHeight(); viewport.updateSequenceIdColours(); if (viewport.getAlignPanel().alignFrame .getSelectedHMM() == null) { viewport.getAlignPanel().alignFrame - .setSelectedHMM(seq.getHMM()); + .setSelectedHMMSequence(seq); } - viewport.alignmentChanged(viewport.getAlignPanel()); } } @@ -478,8 +474,8 @@ public class FileLoader implements Runnable alignFrame.getViewport().setFeaturesDisplayed(fd); alignFrame.getViewport().setShowSequenceFeatures( ((ComplexAlignFile) source).isShowSeqFeatures()); - ColourSchemeI cs = ColourSchemeMapper.getJalviewColourScheme( - colourSchemeName, al); + ColourSchemeI cs = ColourSchemeMapper + .getJalviewColourScheme(colourSchemeName, al); if (cs != null) { alignFrame.changeColour(cs); @@ -505,8 +501,8 @@ public class FileLoader implements Runnable .applyFeaturesStyle(proxyColourScheme); } alignFrame.statusBar.setText(MessageManager.formatMessage( - "label.successfully_loaded_file", - new String[] { title })); + "label.successfully_loaded_file", new String[] + { title })); if (raiseGUI) { @@ -521,8 +517,8 @@ public class FileLoader implements Runnable try { - alignFrame.setMaximum(jalview.bin.Cache.getDefault( - "SHOW_FULLSCREEN", false)); + alignFrame.setMaximum(jalview.bin.Cache + .getDefault("SHOW_FULLSCREEN", false)); } catch (java.beans.PropertyVetoException ex) { } @@ -535,11 +531,8 @@ public class FileLoader implements Runnable Desktop.instance.stopLoading(); } - final String errorMessage = MessageManager - .getString("label.couldnt_load_file") - + " " - + title - + "\n" + error; + final String errorMessage = MessageManager.getString( + "label.couldnt_load_file") + " " + title + "\n" + error; // TODO: refactor FileLoader to be independent of Desktop / Applet GUI // bits ? if (raiseGUI && Desktop.desktop != null) @@ -550,7 +543,8 @@ public class FileLoader implements Runnable public void run() { JvOptionPane.showInternalMessageDialog(Desktop.desktop, - errorMessage, MessageManager + errorMessage, + MessageManager .getString("label.error_loading_file"), JvOptionPane.WARNING_MESSAGE); } @@ -576,11 +570,11 @@ public class FileLoader implements Runnable @Override public void run() { - JvOptionPane.showInternalMessageDialog( - Desktop.desktop, MessageManager.formatMessage( - "label.problems_opening_file", - new String[] { file }), MessageManager - .getString("label.file_open_error"), + JvOptionPane.showInternalMessageDialog(Desktop.desktop, + MessageManager.formatMessage( + "label.problems_opening_file", new String[] + { file }), + MessageManager.getString("label.file_open_error"), JvOptionPane.WARNING_MESSAGE); } }); @@ -598,11 +592,11 @@ public class FileLoader implements Runnable @Override public void run() { - JvOptionPane.showInternalMessageDialog( - Desktop.desktop, MessageManager.formatMessage( + JvOptionPane.showInternalMessageDialog(Desktop.desktop, + MessageManager.formatMessage( "warn.out_of_memory_loading_file", new String[] - { file }), MessageManager - .getString("label.out_of_memory"), + { file }), + MessageManager.getString("label.out_of_memory"), JvOptionPane.WARNING_MESSAGE); } }); @@ -666,8 +660,8 @@ public class FileLoader implements Runnable String seprator = System.getProperty("file.separator"); String jvTempDir = System.getProperty("java.io.tmpdir") + "jalview" + seprator + System.currentTimeMillis(); - File tempStructFile = new File(jvTempDir + seprator + fileName + "." - + extension); + File tempStructFile = new File( + jvTempDir + seprator + fileName + "." + extension); tempStructFile.mkdirs(); return tempStructFile.toString(); }