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 // TrackView.java 20 // Since: 2009/11/27 21 // 22 // $URL$ 23 // $Author$ 24 //-------------------------------------- 25 package org.utgenome.gwt.utgb.client.view; 26 27 import java.io.Serializable; 28 import java.util.ArrayList; 29 30 import org.utgenome.gwt.utgb.client.util.CanonicalProperties; 31 32 /** 33 * view definition of tracks 34 * 35 * @author leo 36 * 37 */ 38 public class TrackView implements Serializable { 39 40 private static final long serialVersionUID = 1L; 41 42 public TrackGroup trackGroup = new TrackGroup(); 43 public ArrayList<Track> track = new ArrayList<Track>(); 44 45 //public Map<TrackGroup, Track> trackGroup_track = new HashMap<TrackGroup, Track>(); 46 47 public TrackView() { 48 } 49 50 /** 51 * Track Group is a set of tracks that share the same coordinate 52 * 53 * @author leo 54 * 55 */ 56 public static class TrackGroup implements Serializable { 57 private static final long serialVersionUID = 1L; 58 59 /** 60 * ID of this track group 61 */ 62 public int id; 63 /** 64 * Java class name of this track group. The underscore (_) is necessary to differentiate this parameter name 65 * from the Java keyword <i>class</i> 66 */ 67 public String class_; 68 69 /** 70 * 71 */ 72 public Coordinate coordinate; 73 74 public CanonicalProperties property = new CanonicalProperties(); 75 } 76 77 public static class Track implements Serializable { 78 private static final long serialVersionUID = 1L; 79 80 /** 81 * belonging track group 82 */ 83 public TrackGroup trackGroup; 84 85 public String name; 86 public int height = 0; 87 public boolean pack; 88 89 /** 90 * Java class name of this track. The underscore (_) is necessary to differentiate this parameter name from the 91 * same name Java keyword, <i>class</i> 92 */ 93 public String class_; 94 public CanonicalProperties property = new CanonicalProperties(); 95 96 } 97 98 /** 99 * Coordinate system 100 * 101 * @author leo 102 * 103 */ 104 public static class Coordinate implements Serializable { 105 106 private static final long serialVersionUID = 1L; 107 108 /** 109 * species name (optional) 110 */ 111 public String species; 112 113 /** 114 * reference sequence name 115 */ 116 public String ref; 117 /** 118 * name of chromosome, contig, scaffold, etc. 119 */ 120 public String chr; 121 122 /** 123 * 1-based start position (inclusive) 124 */ 125 public int start; 126 /** 127 * 1-based end position (inclusive) 128 */ 129 public int end; 130 131 /** 132 * ribbon string showing in/del states 133 */ 134 public String ribbon; 135 136 /** 137 * pixel width of the track window 138 */ 139 public int pixelWidth = -1; 140 } 141 142 }