1 /*--------------------------------------------------------------------------
2 * Copyright 2010 utgenome.org
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *--------------------------------------------------------------------------*/
16 //--------------------------------------
17 // utgb-core Project
18 //
19 // ScaleBarTrack.java
20 // Since: 2010/08/02
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.TrackFrame;
27 import org.utgenome.gwt.utgb.client.track.TrackGroup;
28
29 /**
30 * Scale bar
31 *
32 * @author hatsuda
33 *
34 */
35 public class ScaleBarTrack extends GenomeTrack {
36
37 public static TrackFactory factory() {
38 return new TrackFactory() {
39 @Override
40 public Track newInstance() {
41 return new ScaleBarTrack();
42 }
43 };
44 }
45
46 public ScaleBarTrack() {
47 super("ScaleBar Track");
48 }
49
50 @Override
51 public void setUp(TrackFrame trackFrame, TrackGroup group) {
52 super.setUp(trackFrame, group);
53
54 String trackBaseURL = "utgb-core/ScaleBar?range=%len&width=%pixelwidth";
55 getConfig().setParameter(GenomeTrack.CONFIG_TRACK_BASE_URL, trackBaseURL);
56 getConfig().setParameter(GenomeTrack.CONFIG_TRACK_TYPE, "image");
57 }
58
59 }