|
@@ -7,8 +7,11 @@ import ui.controller.Control;
|
|
|
import ui.model.Model;
|
|
|
import javax.swing.JLabel;
|
|
|
import javax.swing.BoxLayout;
|
|
|
+import javax.swing.JButton;
|
|
|
import javax.swing.SwingConstants;
|
|
|
import java.awt.BorderLayout;
|
|
|
+import javax.swing.border.LineBorder;
|
|
|
+import java.awt.Color;
|
|
|
|
|
|
public class StatisticGraphPanel extends JPanel {
|
|
|
|
|
@@ -22,6 +25,8 @@ public class StatisticGraphPanel extends JPanel {
|
|
|
private StatisticGraph sGraph;
|
|
|
private final JLabel graphNameLabel;
|
|
|
private final JLabel maximumLabel = new JLabel("0");
|
|
|
+ private JPanel topPanel = new JPanel();
|
|
|
+ private JButton closeButton = new JButton("X");
|
|
|
|
|
|
// Variables
|
|
|
String graphName;
|
|
@@ -37,19 +42,22 @@ public class StatisticGraphPanel extends JPanel {
|
|
|
*/
|
|
|
public StatisticGraphPanel(Model mod, Control cont, String name) {
|
|
|
super();
|
|
|
+ setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
|
|
|
this.model = mod;
|
|
|
this.controller = cont;
|
|
|
this.sGraph = new StatisticGraph(mod, cont);
|
|
|
this.graphName = name;
|
|
|
setLayout(new BorderLayout(0, 0));
|
|
|
|
|
|
- /**** add everything *****/
|
|
|
+ //********** add everything **********//
|
|
|
// Statistic Graph
|
|
|
this.add(sGraph);
|
|
|
- // Graph Name
|
|
|
+ // Graph Name and Close Button
|
|
|
graphNameLabel = new JLabel(graphName);
|
|
|
- graphNameLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
- this.add(graphNameLabel, BorderLayout.NORTH);
|
|
|
+ topPanel.add(graphNameLabel);
|
|
|
+ topPanel.add(closeButton);
|
|
|
+ topPanel.setBorder(null);
|
|
|
+ this.add(topPanel, BorderLayout.NORTH);
|
|
|
// Y Maximum
|
|
|
maximumLabel.setVerticalAlignment(SwingConstants.TOP);
|
|
|
this.add(maximumLabel, BorderLayout.WEST);
|