53 lines
1.1 KiB
Java
53 lines
1.1 KiB
Java
package View.Panels;
|
|
|
|
import 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: 29.05.2017.
|
|
*/
|
|
public class MenuPanel extends JPanel {
|
|
|
|
private MainFrame view;
|
|
private JMenuBar menuBar;
|
|
|
|
private JMenu fileMenu;
|
|
private JMenu toolsMenu;
|
|
|
|
private JMenuItem item;
|
|
private JMenuItem evaluate;
|
|
|
|
public MenuPanel(MainFrame view) {
|
|
this.view = view;
|
|
this.setLayout(new BorderLayout());
|
|
this.menuBar = new JMenuBar();
|
|
this.fileMenu = new JMenu("Datei");
|
|
this.toolsMenu = new JMenu("Extras");
|
|
|
|
|
|
this.item = new JMenuItem("Exit");
|
|
this.item.addActionListener(e -> {
|
|
System.exit(0);
|
|
});
|
|
|
|
this.evaluate = new JMenuItem("Evaluation");
|
|
this.evaluate.addActionListener(e -> {
|
|
view.showEvauluationDialog();
|
|
});
|
|
|
|
fileMenu.add(item);
|
|
toolsMenu.add(evaluate);
|
|
|
|
menuBar.add(fileMenu);
|
|
menuBar.add(toolsMenu);
|
|
this.add(menuBar, BorderLayout.WEST);
|
|
this.add(new JSeparator(SwingConstants.HORIZONTAL), BorderLayout.SOUTH);
|
|
}
|
|
}
|