1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.utgenome.gwt.utgb.client.track.lib;
24
25 import org.utgenome.gwt.utgb.client.track.Track;
26 import org.utgenome.gwt.utgb.client.track.TrackConfigChange;
27 import org.utgenome.gwt.utgb.client.track.TrackFrame;
28 import org.utgenome.gwt.utgb.client.track.TrackGroup;
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 public class RefSeqTrack extends GenomeTrack {
44
45 public static TrackFactory factory() {
46 return new TrackFactory() {
47 @Override
48 public Track newInstance() {
49 return new RefSeqTrack();
50 }
51 };
52 }
53
54 public RefSeqTrack() {
55 super("Reference Sequence");
56 }
57
58 private static final String CONFIG_PATH = "path";
59
60 @Override
61 public void draw() {
62
63 String path = getConfig().getString(CONFIG_PATH, "");
64 String trackBaseURL = "utgb-core/Sequence.png?path=" + path + "&%q";
65 getConfig().setParameter(GenomeTrack.CONFIG_TRACK_BASE_URL, trackBaseURL);
66
67 super.draw();
68 }
69
70 @Override
71 public void setUp(TrackFrame trackFrame, TrackGroup group) {
72 super.setUp(trackFrame, group);
73
74 getConfig().addConfigString("path", CONFIG_PATH, "");
75 getConfig().setParameter(GenomeTrack.CONFIG_TRACK_TYPE, "image");
76 }
77
78 @Override
79 public void onChangeTrackConfig(TrackConfigChange change) {
80
81 if (change.contains(CONFIG_PATH)) {
82 refresh();
83 }
84 }
85
86 }