use of com.ramussoft.idef0.ModelParaleler in project ramus by Vitaliy-Yakovchuk.
the class AbstractDataPlugin method loadFromParalel.
public void loadFromParalel(final DataPlugin dataPlugin, final Function base, final File file, final GUIFramework framework) throws IOException {
Thread t = new Thread("Paralel-DataLoader") {
@Override
public void run() {
try {
framework.showAnimation(ResourceLoader.getString("Wait.Message"));
MemoryDatabase md = new MemoryDatabase() {
protected String getJournalDirectoryName(String tmp) {
return null;
}
@Override
protected File getFile() {
return file;
}
};
LoadFromParalelDialog dialog = new LoadFromParalelDialog(framework.getMainFrame(), md.getEngine("idef0"));
if (dialog.showModal()) {
((Journaled) getEngine()).startUserTransaction();
try {
framework.propertyChanged(ModelsView.SET_UPDATE_ALL_MODELS, false);
framework.propertyChanged(IDEF0TabView.DISABLE_SILENT_REFRESH, true);
DataPlugin fdp = NDataPluginFactory.getDataPlugin(null, md.getEngine("idef0"), md.getAccessRules("idef0"));
ModelParaleler paraleler = new ModelParaleler(fdp, dataPlugin, framework);
paraleler.loadFromParalel(base, dialog.isImportAll(), dialog.getSelected());
} finally {
framework.propertyChanged(IDEF0TabView.DISABLE_SILENT_REFRESH, false);
((Journaled) getEngine()).commitUserTransaction();
framework.propertyChanged(ModelsView.SET_UPDATE_ALL_MODELS, true);
framework.propertyChanged(ModelsView.REFRESH_ALL_MODELS);
}
}
FileIEngineImpl impl = (FileIEngineImpl) md.getEngine("idef0").getDeligate();
impl.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
framework.hideAnimation();
}
}
};
t.start();
}
use of com.ramussoft.idef0.ModelParaleler in project ramus by Vitaliy-Yakovchuk.
the class AbstractDataPlugin method loadFromParalel.
public void loadFromParalel(final File file, final GUIFramework framework) throws IOException {
Thread t = new Thread() {
@Override
public void run() {
try {
framework.propertyChanged(ModelsView.SET_UPDATE_ALL_MODELS, false);
framework.propertyChanged(IDEF0TabView.DISABLE_SILENT_REFRESH, true);
framework.showAnimation(ResourceLoader.getString("Wait.Message"));
MemoryDatabase md = new MemoryDatabase() {
protected String getJournalDirectoryName(String tmp) {
return null;
}
@Override
protected File getFile() {
return file;
}
};
LoadFromParalelDialog dialog = new LoadFromParalelDialog(framework.getMainFrame(), md.getEngine("idef0"));
if (dialog.showModal()) {
((Journaled) getEngine()).startUserTransaction();
try {
DataPlugin fdp = NDataPluginFactory.getDataPlugin(null, md.getEngine("idef0"), md.getAccessRules("idef0"));
ModelParaleler paraleler = new ModelParaleler(fdp, AbstractDataPlugin.this, framework);
paraleler.loadFromParalel(dialog.isImportAll(), dialog.getSelected());
} finally {
((Journaled) getEngine()).commitUserTransaction();
}
}
FileIEngineImpl impl = (FileIEngineImpl) md.getEngine("idef0").getDeligate();
impl.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
framework.propertyChanged(ModelsView.SET_UPDATE_ALL_MODELS, true);
framework.propertyChanged(ModelsView.REFRESH_ALL_MODELS);
framework.propertyChanged(IDEF0TabView.DISABLE_SILENT_REFRESH, false);
framework.hideAnimation();
}
}
};
t.start();
}
use of com.ramussoft.idef0.ModelParaleler in project ramus by Vitaliy-Yakovchuk.
the class AbstractDataPlugin method createParalel.
public boolean createParalel(final Function base, final boolean copyAllRows, final boolean clearElements, final File file, final GUIFramework framework, final DataPlugin dataPlugin) throws IOException {
Thread thread = new Thread("Model-paraleler") {
public void run() {
try {
framework.propertyChanged(ModelsView.SET_UPDATE_ALL_MODELS, false);
framework.propertyChanged(IDEF0TabView.DISABLE_SILENT_REFRESH, true);
framework.showAnimation(ResourceLoader.getString("Wait.Message"));
MemoryDatabase md = new MemoryDatabase() {
protected String getJournalDirectoryName(String tmp) {
return null;
}
};
final NDataPlugin fdp = new NDataPlugin(md.getEngine("idef0"), md.getAccessRules("idef0"));
final ModelParaleler paraleler = new ModelParaleler(AbstractDataPlugin.this, fdp, framework);
paraleler.createParalel(base, copyAllRows);
FileIEngineImpl impl = (FileIEngineImpl) md.getEngine("idef0").getDeligate();
impl.saveToFile(file);
impl.close();
if (clearElements) {
((Journaled) getEngine()).startUserTransaction();
try {
paraleler.clear(base);
} finally {
((Journaled) getEngine()).commitUserTransaction();
}
}
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(framework.getMainFrame(), e.getLocalizedMessage());
} finally {
framework.propertyChanged(IDEF0TabView.DISABLE_SILENT_REFRESH, false);
framework.propertyChanged(ModelsView.SET_UPDATE_ALL_MODELS, true);
framework.propertyChanged(ModelsView.REFRESH_ALL_MODELS);
framework.hideAnimation();
}
}
};
thread.start();
return true;
}
Aggregations