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.lib;
26
27 import org.utgenome.gwt.utgb.client.bio.DASLocation;
28 import org.utgenome.gwt.utgb.client.bio.GenomeDB;
29 import org.utgenome.gwt.utgb.client.db.datatype.StringType;
30 import org.utgenome.gwt.utgb.client.track.Track;
31 import org.utgenome.gwt.utgb.client.track.TrackConfigChange;
32 import org.utgenome.gwt.utgb.client.track.TrackFrame;
33 import org.utgenome.gwt.utgb.client.track.TrackGroup;
34
35
36
37
38
39
40
41 public class DASTrack extends ReadTrack {
42
43 public static TrackFactory factory() {
44 return new TrackFactory() {
45 @Override
46 public Track newInstance() {
47 return new DASTrack();
48 }
49 };
50 }
51
52 public DASTrack() {
53 super("DAS Track", "DAS");
54 }
55
56 private final String CONFIG_DAS_TYPE = "dasType";
57
58 @Override
59 public void setUp(TrackFrame trackFrame, TrackGroup group) {
60 super.setUp(trackFrame, group);
61
62 getConfig().addConfig("DAS Data Type", new StringType(CONFIG_DAS_TYPE), "");
63 }
64
65 @Override
66 public void onChangeTrackConfig(TrackConfigChange change) {
67 super.onChangeTrackConfig(change);
68
69 if (change.contains(CONFIG_DAS_TYPE)) {
70 refresh();
71 }
72 }
73
74 @Override
75 public GenomeDB getGenomeDB() {
76 return new DASLocation(super.getGenomeDB(), getConfig().getParameter(CONFIG_DAS_TYPE));
77 }
78
79 }