1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-11-14 06:39:53 -08:00
Abacus/src/org/nwapw/abacus/Abacus.java

45 lines
1.1 KiB
Java
Raw Normal View History

2017-07-24 10:04:00 -07:00
package org.nwapw.abacus;
import org.nwapw.abacus.plugin.PluginManager;
2017-07-28 11:17:54 -07:00
//import org.nwapw.abacus.plugin.StandardPlugin;
import org.nwapw.abacus.window.Window;
import org.nwapw.abacus.plugin.ClassFinder;
import javax.swing.*;
2017-07-28 11:17:54 -07:00
import java.io.IOException;
import java.util.ArrayList;
2017-07-24 10:04:00 -07:00
public class Abacus {
private Window mainUi;
private PluginManager manager;
public Abacus(){
init();
}
private void init() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | UnsupportedLookAndFeelException | IllegalAccessException e) {
e.printStackTrace();
}
manager = new PluginManager();
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));
} catch (IOException | ClassNotFoundException e) {
2017-07-28 11:17:54 -07:00
e.printStackTrace();
}
mainUi = new Window(manager);
mainUi.setVisible(true);
manager.load();
2017-07-28 11:17:54 -07:00
}
2017-07-24 10:04:00 -07:00
public static void main(String[] args){
new Abacus();
2017-07-24 10:04:00 -07:00
}
}