}
}
void importOldDefaultStyle() {
final ModeController modeController = Controller.getCurrentController().getModeController(MModeController.MODENAME);
MFileManager fm = MFileManager.getController(modeController);
final String standardTemplateName = fm.getStandardTemplateName();
final File userDefault;
final File absolute = new File(standardTemplateName);
if(absolute.isAbsolute())
userDefault = absolute;
else{
final File userTemplates = fm.defaultUserTemplateDir();
userDefault= new File(userTemplates, standardTemplateName);
}
if(userDefault.exists()){
return;
}
userDefault.getParentFile().mkdirs();
if(! userDefault.getParentFile().exists()){
return;
}
MapModel defaultStyleMap = new MapModel();
final File allUserTemplates = fm.defaultStandardTemplateDir();
final File standardTemplate = new File(allUserTemplates, "standard.mm");
try {
fm.loadCatchExceptions(standardTemplate.toURL(), defaultStyleMap);
}
catch (Exception e) {
LogUtils.warn(e);
try {
fm.loadCatchExceptions(ResourceController.getResourceController().getResource("/styles/viewer_standard.mm"), defaultStyleMap);
}
catch (Exception e2) {
defaultStyleMap.createNewRoot();
LogUtils.severe(e);
}
}
final NodeStyleController nodeStyleController = NodeStyleController.getController(modeController);
updateDefaultStyle(nodeStyleController, defaultStyleMap);
updateNoteStyle(nodeStyleController, defaultStyleMap);
try {
fm.writeToFile(defaultStyleMap, userDefault);
}
catch (IOException e) {
}