import jalview.gui.AlignViewport;
import jalview.gui.Desktop;
import jalview.gui.Jalview2XML;
+import jalview.json.binding.biojson.v1.ColourSchemeMapper;
import jalview.schemes.ColourSchemeI;
import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
}
}
- if ((al != null) && (al.getHeight() > 0))
+ if ((al != null) && (al.getHeight() > 0) && al.hasValidSequence())
{
// construct and register dataset sequences
for (SequenceI sq : al.getSequences())
.getHiddenSequences();
boolean showSeqFeatures = ((ComplexAlignFile) source)
.isShowSeqFeatures();
- ColourSchemeI cs = ((ComplexAlignFile) source)
- .getColourScheme();
+ String colourSchemeName = ((ComplexAlignFile) source)
+ .getGlobalColourScheme();
FeaturesDisplayedI fd = ((ComplexAlignFile) source)
.getDisplayedFeatures();
alignFrame = new AlignFrame(al, hiddenSeqs, colSel,
alignFrame.getViewport().setShowSequenceFeatures(
showSeqFeatures);
alignFrame.getViewport().setFeaturesDisplayed(fd);
- alignFrame.changeColour(cs);
+ ColourSchemeI cs = ColourSchemeMapper.getJalviewColourScheme(
+ colourSchemeName, al);
+ if (cs != null)
+ {
+ alignFrame.changeColour(cs);
+ }
}
else
{
}
alignFrame.statusBar.setText(MessageManager.formatMessage(
- "label.successfully_loaded_file", new String[]
- { title }));
+ "label.successfully_loaded_file",
+ new String[] { title }));
if (raiseGUI)
{
Desktop.instance.stopLoading();
}
- final String errorMessage = "Couldn't 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)
{
javax.swing.JOptionPane.showInternalMessageDialog(
Desktop.desktop, MessageManager.formatMessage(
- "label.problems_opening_file", new String[]
- { file }), MessageManager
+ "label.problems_opening_file",
+ new String[] { file }), MessageManager
.getString("label.file_open_error"),
javax.swing.JOptionPane.WARNING_MESSAGE);
}