62 lines
1.7 KiB
Java
62 lines
1.7 KiB
Java
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) {
|
|
final Presenter presenter = new Presenter(new LineModel(), null);
|
|
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);
|
|
}
|
|
|
|
view.setPresenter(presenter);
|
|
view.setActionListeners();
|
|
presenter.setView(view);
|
|
});
|
|
|
|
|
|
}
|
|
|
|
}
|