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-25 21:11:36 -07:00
|
|
|
import org.nwapw.abacus.window.Window;
|
2017-07-28 11:17:54 -07:00
|
|
|
import org.nwapw.abacus.plugin.ClassFinderV2;
|
2017-07-25 21:11:36 -07:00
|
|
|
|
|
|
|
import javax.swing.*;
|
2017-07-28 11:17:54 -07:00
|
|
|
import java.io.File;
|
|
|
|
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 11:17:54 -07:00
|
|
|
ArrayList<String> names = new ArrayList();
|
|
|
|
try {
|
|
|
|
|
|
|
|
ClassFinderV2 classFinder = new ClassFinderV2();
|
|
|
|
File pluginFile = new File("C:\\Users\\galbraithja\\Desktop\\.git\\abacus\\src\\org\\nwapw\\abacus\\plugin");
|
|
|
|
for(File classes:pluginFile.listFiles()){
|
|
|
|
if(classes.getName().endsWith(".jar")){
|
|
|
|
names.addAll(classFinder.addJar("C:\\Users\\galbraithja\\Desktop\\.git\\abacus\\src\\org\\nwapw\\abacus\\plugin\\Standard.jar"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for(String name:names){
|
|
|
|
System.out.println(name);
|
|
|
|
}
|
|
|
|
ArrayList<Class> classes = classFinder.getClasses();
|
|
|
|
for(Class classGet:classes){
|
|
|
|
manager.addClass(classGet);
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
} catch (ClassNotFoundException e) {
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
}
|