2017-07-24 10:04:00 -07:00
|
|
|
package org.nwapw.abacus;
|
|
|
|
|
2017-07-25 21:52:23 -07:00
|
|
|
import org.nwapw.abacus.plugin.PluginManager;
|
2017-07-28 11:17:54 -07:00
|
|
|
//import org.nwapw.abacus.plugin.StandardPlugin;
|
2017-07-28 15:18:23 -07:00
|
|
|
import org.nwapw.abacus.plugin.StandardPlugin;
|
2017-07-25 21:11:36 -07:00
|
|
|
import org.nwapw.abacus.window.Window;
|
2017-07-28 11:35:23 -07:00
|
|
|
import org.nwapw.abacus.plugin.ClassFinder;
|
2017-07-25 21:11:36 -07:00
|
|
|
|
|
|
|
import javax.swing.*;
|
2017-07-28 11:17:54 -07:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.ArrayList;
|
2017-07-25 21:11:36 -07:00
|
|
|
|
2017-07-24 10:04:00 -07:00
|
|
|
public class Abacus {
|
|
|
|
|
2017-07-25 21:11:36 -07:00
|
|
|
private Window mainUi;
|
2017-07-25 21:52:23 -07:00
|
|
|
private PluginManager manager;
|
2017-07-25 21:11:36 -07:00
|
|
|
|
|
|
|
public Abacus(){
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void init() {
|
|
|
|
try {
|
|
|
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
|
|
|
} catch (ClassNotFoundException | InstantiationException | UnsupportedLookAndFeelException | IllegalAccessException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
2017-07-25 21:52:23 -07:00
|
|
|
manager = new PluginManager();
|
2017-07-28 15:18:23 -07:00
|
|
|
manager.addInstantiated(new StandardPlugin(manager));
|
2017-07-28 11:17:54 -07:00
|
|
|
try {
|
2017-07-28 14:21:43 -07:00
|
|
|
ClassFinder.loadJars("plugins")
|
|
|
|
.forEach(plugin -> manager.addClass(plugin));
|
2017-07-28 11:35:23 -07:00
|
|
|
} catch (IOException | ClassNotFoundException e) {
|
2017-07-28 11:17:54 -07:00
|
|
|
e.printStackTrace();
|
|
|
|
}
|
2017-07-26 13:31:05 -07:00
|
|
|
mainUi = new Window(manager);
|
2017-07-25 21:11:36 -07:00
|
|
|
mainUi.setVisible(true);
|
2017-07-27 14:06:57 -07:00
|
|
|
manager.load();
|
2017-07-28 11:17:54 -07:00
|
|
|
|
2017-07-25 21:11:36 -07:00
|
|
|
}
|
|
|
|
|
2017-07-24 10:04:00 -07:00
|
|
|
public static void main(String[] args){
|
2017-07-25 21:11:36 -07:00
|
|
|
new Abacus();
|
2017-07-24 10:04:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|