Menu

[r42]: / GraphScript / trunk / ls / graph / ui / StatusPanel.java  Maximize  Restore  History

Download this file

66 lines (53 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package ls.graph.ui;
import java.awt.FlowLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import ls.graph.script.Algorithm;
import ls.graph.script.AlgorithmListener;
public class StatusPanel extends JPanel implements AlgorithmListener
{
private static final long serialVersionUID = 1L;
private JLabel lblStatus = null;
private JLabel lblStep = null;
private JLabel lblStepCount = null;
private int stepCount = 0;
StatusPanel()
{
super();
initComponents();
}
private void initComponents()
{
FlowLayout l = new FlowLayout();
l.setAlignment(FlowLayout.LEADING);
this.setLayout(l);
JLabel lbl = new JLabel("Status:");
this.add(lbl);
lblStatus = new JLabel();
this.add(lblStatus);
this.add(new JLabel("Step:"));
lblStep = new JLabel();
this.add(lblStep);
this.add(new JLabel("Step Count: "));
lblStepCount = new JLabel();
this.add(lblStepCount);
}
public void executionEnded(Algorithm alg)
{
lblStatus.setText("Stopped");
lblStep.setText("-");
lblStepCount.setText("-");
this.stepCount = 0;
}
public void executionStarted(Algorithm alg)
{
lblStatus.setText("Running");
lblStep.setText("0");
}
public void startingStep(int stepIndex)
{
lblStep.setText(String.valueOf(stepIndex));
this.stepCount++;
lblStepCount.setText(String.valueOf(this.stepCount));
}
}
MongoDB Logo MongoDB