algorithms-for-computing-li.../src/main/java/View/Panels/MenuPanel.java

53 lines
1.1 KiB
Java
Raw Normal View History

2017-06-21 15:41:40 +00:00
package View.Panels;
2017-05-29 15:08:58 +00:00
import View.MainFrame;
import javax.swing.*;
import java.awt.*;
2017-05-29 15:08:58 +00:00
/**
* Implementierung verschiedener Algorithmen zur Berechnung von Ausgleichsgeraden.
*
* @Author: Armin Wolf
* @Email: a_wolf28@uni-muenster.de
* @Date: 29.05.2017.
*/
2017-05-30 12:59:06 +00:00
public class MenuPanel extends JPanel {
2017-05-29 15:08:58 +00:00
private MainFrame view;
2017-06-20 14:59:24 +00:00
private JMenuBar menuBar;
private JMenu fileMenu;
private JMenu toolsMenu;
2017-06-20 14:59:24 +00:00
private JMenuItem item;
private JMenuItem evaluate;
2017-05-29 15:08:58 +00:00
public MenuPanel(MainFrame view) {
this.view = view;
2017-06-20 14:59:24 +00:00
this.setLayout(new BorderLayout());
this.menuBar = new JMenuBar();
2017-09-08 19:23:02 +00:00
this.fileMenu = new JMenu("Datei");
this.toolsMenu = new JMenu("Extras");
2017-05-29 15:08:58 +00:00
2017-06-20 14:59:24 +00:00
this.item = new JMenuItem("Exit");
this.item.addActionListener(e -> {
System.exit(0);
});
2017-05-29 15:08:58 +00:00
this.evaluate = new JMenuItem("Evaluation");
this.evaluate.addActionListener(e -> {
view.showEvauluationDialog();
});
fileMenu.add(item);
toolsMenu.add(evaluate);
menuBar.add(fileMenu);
menuBar.add(toolsMenu);
2017-06-20 14:59:24 +00:00
this.add(menuBar, BorderLayout.WEST);
this.add(new JSeparator(SwingConstants.HORIZONTAL), BorderLayout.SOUTH);
}
2017-05-29 15:08:58 +00:00
}