|
@@ -9,6 +9,8 @@ import ui.model.Model;
|
|
|
import javax.swing.JLabel;
|
|
|
import javax.swing.JButton;
|
|
|
import javax.swing.SwingConstants;
|
|
|
+import javax.swing.Timer;
|
|
|
+
|
|
|
import java.awt.BorderLayout;
|
|
|
import javax.swing.border.LineBorder;
|
|
|
|
|
@@ -75,7 +77,7 @@ public class StatisticGraphPanel extends JPanel {
|
|
|
JPanel parent = (JPanel) that.getParent();
|
|
|
for (int i = 0; i < parent.getComponentCount(); i++) {
|
|
|
if (parent.getComponent(i).equals(that)) {
|
|
|
- parent.remove(parent.getComponent(i+1));
|
|
|
+ parent.remove(parent.getComponent(i + 1));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -89,7 +91,15 @@ public class StatisticGraphPanel extends JPanel {
|
|
|
this.add(topPanel, BorderLayout.NORTH);
|
|
|
this.add(maximumLabel, BorderLayout.WEST);
|
|
|
this.add(Legendpanel, BorderLayout.SOUTH);
|
|
|
-
|
|
|
+
|
|
|
+ Timer t = new Timer(200, new ActionListener() {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
+ that.repaint();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ t.start();
|
|
|
|
|
|
}
|
|
|
|
|
@@ -117,4 +127,13 @@ public class StatisticGraphPanel extends JPanel {
|
|
|
public void setMaximumLabel(int max) {
|
|
|
maximumLabel.setText(Integer.toString(max));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the name of the Graph.
|
|
|
+ *
|
|
|
+ * @return the name of the Graph
|
|
|
+ */
|
|
|
+ public String getGraphName() {
|
|
|
+ return this.graphName;
|
|
|
+ }
|
|
|
}
|