View Javadoc

1   /*--------------------------------------------------------------------------
2    *  Copyright 2009 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  // GenomeTrack.java
20  // Since: Feb 17, 2009
21  //
22  // $URL: http://svn.utgenome.org/utgb/trunk/utgb/utgb-core/src/main/java/org/utgenome/gwt/utgb/client/track/lib/GenomeTrack.java $ 
23  // $Author: yoshimura $
24  //--------------------------------------
25  package org.utgenome.gwt.utgb.client.track.lib;
26  
27  import org.utgenome.gwt.utgb.client.db.datatype.StringType;
28  import org.utgenome.gwt.utgb.client.track.Track;
29  import org.utgenome.gwt.utgb.client.track.TrackConfigChange;
30  import org.utgenome.gwt.utgb.client.track.TrackFrame;
31  import org.utgenome.gwt.utgb.client.track.TrackGroup;
32  
33  /**
34   * BEDTrack is for visualizing data that can be located on BDE Format Data.
35   * 
36   * @deprecated Use {@link ReadTrack} instead
37   * 
38   * @author yoshimura
39   * 
40   */
41  @Deprecated
42  public class BEDTrack extends GenomeTrack {
43  
44  	protected final String CONFIG_FILENAME = "fileName";
45  
46  	public static TrackFactory factory() {
47  		return new TrackFactory() {
48  			@Override
49  			public Track newInstance() {
50  				return new BEDTrack();
51  			}
52  		};
53  	}
54  
55  	public BEDTrack() {
56  		super("BED Track");
57  	}
58  
59  	@Override
60  	public void draw() {
61  		getConfig().setParameter(CONFIG_TRACK_BASE_URL, "utgb-core/BEDViewer?%q&fileName=" + getConfig().getString(CONFIG_FILENAME, ""));
62  		super.draw();
63  	}
64  
65  	@Override
66  	public void setUp(TrackFrame trackFrame, TrackGroup group) {
67  		super.setUp(trackFrame, group);
68  
69  		getConfig().addConfig("File Name", new StringType(CONFIG_FILENAME), "");
70  	}
71  
72  	@Override
73  	public void onChangeTrackConfig(TrackConfigChange change) {
74  		super.onChangeTrackConfig(change);
75  
76  		if (change.contains(CONFIG_FILENAME)) {
77  			refresh();
78  		}
79  	}
80  
81  }