use of com.ramussoft.pb.master.NewProjectDialog in project ramus by Vitaliy-Yakovchuk.
the class IDEF0ViewPlugin method setFramework.
@Override
public void setFramework(final GUIFramework framework) {
super.setFramework(framework);
this.engine = framework.getEngine();
this.rules = framework.getAccessRules();
this.frame.setEngine(framework);
addOpenDiagramListener();
addOpenStreamsViewListener();
framework.addCloseMainFrameListener(new CloseMainFrameAdapter() {
@Override
public void closed() {
Options.save();
if (navigator != null)
navigator.dispose();
if (engine.getPluginProperty("Core", "MainFrame") == framework.getMainFrame()) {
NDataPlugin dataPlugin = (NDataPlugin) engine.getPluginProperty("IDEF0", "DataPlugin");
if (dataPlugin != null) {
dataPlugin.clear();
dataPlugin.clearAll();
}
}
if (server != null) {
try {
server.getServer().close();
} catch (IOException e) {
e.printStackTrace();
}
server.interrupt();
}
}
});
framework.addActionListener("FileOpened", new ActionListener() {
@Override
public void onAction(ActionEvent event) {
if (event.getValue() == null) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
NewProjectDialog dialog = new NewProjectDialog(framework.getMainFrame());
dialog.showModal(engine, rules, framework);
}
});
}
}
});
framework.addActionListener(Commands.FULL_REFRESH, new ActionListener() {
@Override
public void onAction(ActionEvent event) {
if (NDataPluginFactory.getExistingDataPlugin(engine) != null)
NDataPluginFactory.fullRefrash(framework);
}
});
framework.setSystemAttributeName(IDEF0Plugin.getBackgroundColorAttribute(engine), ResourceLoader.getString("bk_color"));
framework.setSystemAttributeName(IDEF0Plugin.getForegroundColorAttribute(engine), ResourceLoader.getString("fg_color"));
framework.setSystemAttributeName(IDEF0Plugin.getFontAttribute(engine), ResourceLoader.getString("font"));
framework.setSystemAttributeName(IDEF0Plugin.getFunctionTypeAttribute(engine), ResourceLoader.getString("function_type"));
framework.setSystemAttributeName(IDEF0Plugin.getFunctionOunerAttribute(engine), ResourceLoader.getString("select_owner"));
StreamAttributePlugin plugin = new StreamAttributePlugin();
plugin.setFramework(framework);
framework.setSystemAttributePlugin(IDEF0Plugin.getStreamAttribute(engine), plugin);
framework.setSystemAttributeName(IDEF0Plugin.getStreamAttribute(engine), ResourceLoader.getString("stream"));
framework.setSystemAttributePlugin(IDEF0Plugin.getSectorBorderEndAttribute(engine), new SectorFontAttributePlugin());
framework.setSystemAttributeName(IDEF0Plugin.getSectorBorderEndAttribute(engine), ResourceLoader.getString("font"));
framework.setSystemAttributePlugin(IDEF0Plugin.getSectorBorderStartAttribute(engine), new SectorColorAttributePlugin());
framework.setSystemAttributeName(IDEF0Plugin.getSectorBorderStartAttribute(engine), ResourceLoader.getString("color"));
framework.setSystemAttributePlugin(IDEF0Plugin.getSectorFunctionAttribute(engine), new LineStyleAttributePlugin());
framework.setSystemAttributeName(IDEF0Plugin.getSectorFunctionAttribute(engine), ResourceLoader.getString("arrow"));
}
Aggregations