use of com.ramussoft.common.PluginProvider in project ramus by Vitaliy-Yakovchuk.
the class Client method run.
public void run(final String[] args) {
final SplashScreen screen = new SplashScreen() {
/**
*/
private static final long serialVersionUID = -4641958771849938048L;
@Override
protected String getImageName() {
for (String s : args) if (s.equals("-season"))
return "/com/ramussoft/season/about.png";
return "/com/ramussoft/gui/about.png";
}
};
if (Metadata.CLIENT) {
Metadata.REGISTERED_FOR = ClientConnection.getName();
Metadata.DEMO_REGISTERED = ClientConnection.getName() != null;
}
screen.setLocationRelativeTo(null);
boolean hide = false;
for (String s : args) if ("--hide-splash".equals(s))
hide = true;
if (!hide)
screen.setVisible(true);
Thread t = new Thread(new Runnable() {
@Override
public void run() {
List<PluginProvider> suits = new ArrayList<PluginProvider>();
suits.add(new SimpleAttributePluginSuit());
initAdditionalPluginSuits(suits);
PluginFactory factory = createPluginFactory(suits);
PersistentFactory persistentFactory = new PersistentFactory(null, factory.getAttributePlugins(), null);
persistentFactory.reinit();
Engine engine = getEngine(factory, persistentFactory);
AccessRules rules = getAccessRules();
e = engine;
e.setPluginProperty("Core", "PluginList", factory.getPlugins());
e.setPluginProperty("Core", "PluginFactory", factory);
LightClient.staticEngine = e;
LightClient.staticAccessRules = rules;
List<GUIPlugin> list = new ArrayList<GUIPlugin>();
QualifierPluginSuit.addPlugins(list, e, rules);
initAdditionalGuiPlugins(list);
User me = getMe();
List<Group> groups = me.getGroups();
String[] grps = new String[groups.size()];
for (int i = 0; i < grps.length; i++) grps[i] = groups.get(i).getName();
AbstractGUIPluginFactory factory1;
String ws = Options.getString("WindowsControl", "simple");
if (ws.equals("simple"))
factory1 = new SimleGUIPluginFactory(list, e, rules, getType(), grps, loadPlugins);
else
factory1 = new GUIPluginFactory(list, e, rules, getType(), grps, loadPlugins);
framework = factory1.getFramework();
framework.addCloseMainFrameListener(new CloseMainFrameAdapter() {
@Override
public void afterClosed() {
Client.this.close();
}
});
final JFrame frame = factory1.getMainFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
String title = getTitle();
frame.setTitle(title);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
frame.setVisible(true);
screen.setVisible(false);
}
});
}
});
t.start();
Thread thread = new Thread("Icons-buffer-cleaner") {
@Override
public void run() {
while (true) {
try {
Thread.sleep(20000);
IconFactory.clearIconsBuffer(LightClient.staticEngine);
IconFactory.clearQualifierIconsBuffer(LightClient.staticEngine);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
};
thread.setDaemon(true);
thread.setPriority(Thread.MIN_PRIORITY);
thread.start();
}
use of com.ramussoft.common.PluginProvider in project ramus by Vitaliy-Yakovchuk.
the class Client method createPluginFactory.
private PluginFactory createPluginFactory(List<PluginProvider> list) {
ArrayList<Plugin> plugins = new ArrayList<Plugin>();
for (PluginProvider suit : list) {
plugins.addAll(suit.getPlugins());
}
PluginFactory factory = new PluginFactory(plugins);
return factory;
}
use of com.ramussoft.common.PluginProvider in project ramus by Vitaliy-Yakovchuk.
the class AbstractDatabase method createPluginFactory.
protected PluginFactory createPluginFactory(List<PluginProvider> list) {
ArrayList<Plugin> plugins = new ArrayList<Plugin>();
for (PluginProvider suit : list) {
plugins.addAll(suit.getPlugins());
}
PluginFactory factory = new PluginFactory(plugins);
return factory;
}
use of com.ramussoft.common.PluginProvider in project ramus by Vitaliy-Yakovchuk.
the class NDataPluginFactory method createTemplateDataPlugin.
private static DataPlugin createTemplateDataPlugin() {
MemoryDatabase database = new MemoryDatabase() {
@Override
protected Collection<? extends PluginProvider> getAdditionalSuits() {
ArrayList<PluginProvider> ps = new ArrayList<PluginProvider>(1);
ps.add(new IDEF0PluginProvider());
return ps;
}
@Override
protected String getJournalDirectoryName(String tmp) {
return null;
}
@Override
protected FileIEngineImpl createFileIEngine(PluginFactory factory) throws ClassNotFoundException, ZipException, IOException {
return createNotSessionedFileIEngine(factory);
}
};
Engine e = database.getEngine(null);
AccessRules rules = database.getAccessRules(null);
Qualifier q = e.createQualifier();
IDEF0Plugin.installFunctionAttributes(q, e);
return getDataPlugin(q, e, rules);
}
use of com.ramussoft.common.PluginProvider in project ramus by Vitaliy-Yakovchuk.
the class Navigator method createPluginFactory.
private PluginFactory createPluginFactory(List<PluginProvider> list) {
ArrayList<Plugin> plugins = new ArrayList<Plugin>();
for (PluginProvider suit : list) {
plugins.addAll(suit.getPlugins());
}
PluginFactory factory = new PluginFactory(plugins);
return factory;
}
Aggregations