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 package org.utgenome.gwt.utgb.client.track;
26
27 import java.util.ArrayList;
28 import java.util.Iterator;
29
30
31
32
33
34
35
36 public class TrackInfo {
37 private String trackName;
38 private String description = "";
39 private String linkURL = "";
40
41 private ArrayList<TrackInfoChangeListener> _listenerList = new ArrayList<TrackInfoChangeListener>();
42
43 public TrackInfo(String trackName) {
44 setTrackName(trackName);
45 description = trackName;
46 }
47
48
49
50
51
52 public TrackInfo(String trackName, String description) {
53 this.trackName = trackName;
54 this.description = description;
55 }
56
57
58
59
60
61
62 public void addChangeListener(TrackInfoChangeListener listener) {
63 _listenerList.add(listener);
64 }
65
66
67
68
69
70
71 public void removeChangeListner(TrackInfoChangeListener listner) {
72 _listenerList.remove(listner);
73 }
74
75 public String getDescription() {
76 return description;
77 }
78
79 public void setDescription(String description) {
80 this.description = description;
81 notifyTheChange();
82 }
83
84 public String getTrackName() {
85 return trackName;
86 }
87
88 public void setTrackName(final String trackName) {
89 this.trackName = trackName;
90 notifyTheChange();
91 }
92
93 public String getLinkURL() {
94 return linkURL;
95 }
96
97
98
99
100
101
102 public void setLinkURL(String linkURL) {
103 this.linkURL = linkURL;
104 notifyTheChange();
105 }
106
107 private void notifyTheChange() {
108 for (Iterator<TrackInfoChangeListener> it = _listenerList.iterator(); it.hasNext();) {
109 TrackInfoChangeListener listener = it.next();
110 listener.onChange(this);
111 }
112 }
113 }