algorithms-for-computing-li.../LinearRegressionTool/src/main/java/de/wwwu/awolf/App.java

65 lines
1.8 KiB
Java
Raw Normal View History

2020-03-21 00:37:09 +00:00
package de.wwwu.awolf;
import de.wwwu.awolf.model.LineModel;
import de.wwwu.awolf.presenter.Presenter;
import de.wwwu.awolf.presenter.util.Logging;
import de.wwwu.awolf.view.MainFrame;
import javax.swing.*;
import java.awt.*;
/**
* Implementierung verschiedener Algorithmen zur Berechnung von Ausgleichsgeraden.
*
* @Author: Armin Wolf
* @Email: a_wolf28@uni-muenster.de
* @Date: 28.05.2017.
*/
public class App {
/**
* Schriftart wird neu gesetzt
*
* @param f Schriftart
*/
private static void setUIFont(javax.swing.plaf.FontUIResource f) {
java.util.Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource) {
UIManager.put(key, f);
}
}
}
/**
* Maim Methode
*
* @param argv
*/
public static void main(String[] argv) {
2020-03-23 20:58:39 +00:00
final Presenter presenter = Presenter.getInstance();
presenter.setModel(new LineModel());
presenter.setView(null);
2020-03-21 19:54:03 +00:00
SwingUtilities.invokeLater(() -> {
MainFrame view = new MainFrame();
setUIFont(new javax.swing.plaf.FontUIResource(new Font("SansSerif", Font.PLAIN, 12)));
try {
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | IllegalAccessException | InstantiationException e) {
Logging.logError("Error with the UI. ", e);
}
2020-03-21 00:37:09 +00:00
2020-03-21 19:54:03 +00:00
view.setPresenter(presenter);
view.setActionListeners();
presenter.setView(view);
});
2020-03-21 00:37:09 +00:00
}
}