algorithms-for-computing-li.../src/main/java/App.java

61 lines
1.6 KiB
Java
Raw Normal View History

import Model.LineModel;
import Presenter.Presenter;
import View.MainFrame;
2017-06-21 15:41:40 +00:00
import java.awt.Font;
2017-06-23 16:17:11 +00:00
import javax.swing.JFrame;
2017-06-20 14:59:24 +00:00
import javax.swing.SwingUtilities;
2017-06-21 15:41:40 +00:00
import javax.swing.UIManager;
2017-06-23 16:17:11 +00:00
import javax.swing.UnsupportedLookAndFeelException;
/**
* Implementierung verschiedener Algorithmen zur Berechnung von Ausgleichsgeraden.
*
* @Author: Armin Wolf
* @Email: a_wolf28@uni-muenster.de
* @Date: 28.05.2017.
*/
public class App {
2017-06-21 15:41:40 +00:00
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);
}
}
}
2017-06-23 16:17:11 +00:00
private static void setLookAndFeel(JFrame view){
try {
UIManager.setLookAndFeel("com.jtattoo.plaf.aluminium.AluminiumLookAndFeel");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
SwingUtilities.updateComponentTreeUI(view);
}
2017-06-20 14:59:24 +00:00
public static void main(String[] args) {
2017-06-20 14:59:24 +00:00
SwingUtilities.invokeLater(() -> {
MainFrame view = new MainFrame();
2017-06-23 16:17:11 +00:00
setLookAndFeel(view);
2017-06-21 15:41:40 +00:00
setUIFont (new javax.swing.plaf.FontUIResource(new Font("Verdana",Font.PLAIN, 12)));
view.setPresenter(new Presenter(new LineModel(), view));
2017-06-20 14:59:24 +00:00
});
2017-06-20 14:59:24 +00:00
}
}