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.canvas.RibbonRuler;
28 import org.utgenome.gwt.utgb.client.track.Track;
29 import org.utgenome.gwt.utgb.client.track.TrackBase;
30 import org.utgenome.gwt.utgb.client.track.TrackFrame;
31 import org.utgenome.gwt.utgb.client.track.TrackGroup;
32 import org.utgenome.gwt.utgb.client.track.TrackWindow;
33
34 import com.google.gwt.user.client.ui.FlexTable;
35 import com.google.gwt.user.client.ui.Widget;
36
37
38
39
40
41
42
43 public class RibbonRulerTrack extends TrackBase {
44 FlexTable layoutTable = new FlexTable();
45 RibbonRuler ribbon = new RibbonRuler();
46
47 public static TrackFactory factory() {
48 return new TrackFactory() {
49 public Track newInstance() {
50 return new RibbonRulerTrack();
51 }
52 };
53 }
54
55 public RibbonRulerTrack() {
56 super("Ribbon Track");
57
58
59 layoutTable.setCellPadding(0);
60 layoutTable.setCellSpacing(0);
61 layoutTable.setBorderWidth(0);
62 layoutTable.setWidth("100%");
63 layoutTable.getCellFormatter().setWidth(0, 0, "100px");
64 layoutTable.setWidget(0, 1, ribbon);
65 }
66
67 public Widget getWidget() {
68 return layoutTable;
69 }
70
71 @Override
72 public void setUp(TrackFrame trackFrame, TrackGroup group) {
73
74 ribbon.setWindow(group.getTrackWindow());
75 }
76
77 @Override
78 public void onChangeTrackWindow(TrackWindow newWindow) {
79 ribbon.setWindow(newWindow);
80 }
81
82 }