1
2
3
4 package org.telscenter.pas.navigation;
5
6 import java.beans.PropertyChangeEvent;
7 import java.beans.PropertyChangeListener;
8
9 import javax.swing.JPanel;
10
11 import org.telscenter.pas.beans.PasActivity;
12 import org.telscenter.pas.service.PasProjectServiceProvider;
13
14
15 public abstract class PasProjectNavigationPanel extends JPanel implements
16 PropertyChangeListener {
17
18 protected PasActivity[] activities = new PasActivity[0];
19
20 protected String projectTitle = "PROJECT TITLE";
21
22 protected PasProjectServiceProvider pasProjectServiceProvider;
23
24 public void propertyChange(PropertyChangeEvent evt) {
25 if (evt.getPropertyName() == "activities") {
26 activities = (PasActivity[]) evt.getNewValue();
27 addActivityListeners();
28 } else if (evt.getPropertyName() == "title") {
29 projectTitle = (String) evt.getNewValue();
30 } else if (evt.getPropertyName() == "steps") {
31
32 updateDisplay();
33 } else {
34 return;
35 }
36 updateDisplay();
37 }
38
39 /***
40 * @param activities2
41 */
42 private void addActivityListeners() {
43 for (int i = 0; i < activities.length; i++) {
44 activities[i].addPropertyChangeListener("steps", this);
45 }
46 }
47
48 abstract public void updateDisplay();
49
50 abstract public void showFirstStep();
51
52
53 }