View Javadoc

1   /*--------------------------------------------------------------------------
2    *  Copyright 2007 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  // GenomeBrowser Project
18  //
19  // OperationParser.java
20  // Since: 2007/06/13
21  //
22  // $URL$ 
23  // $Author$ ssksn
24  //--------------------------------------
25  package org.utgenome.gwt.utgb.client.track.operation;
26  
27  import org.utgenome.gwt.utgb.client.track.Track;
28  import org.utgenome.gwt.utgb.client.track.lib.old.OldUTGBOperationParser;
29  
30  import com.google.gwt.user.client.ui.AbsolutePanel;
31  import com.google.gwt.xml.client.Document;
32  import com.google.gwt.xml.client.Node;
33  import com.google.gwt.xml.client.XMLParser;
34  
35  /**
36   * 
37   * @author ssksn
38   * @since GWT 1.4
39   * @version 0.1
40   */
41  public abstract class OperationParser {
42  	private static OperationParser _parser = new OldUTGBOperationParser();
43  
44  	public static OperationParser getParser() {
45  		return _parser;
46  	}
47  
48  	public final void parse(final String operationXMLStr, final AbsolutePanel panel, final Track track) {
49  		final Document document = XMLParser.parse(operationXMLStr);
50  
51  		parse(document, panel, track);
52  	}
53  
54  	public abstract void parse(final Document document, final AbsolutePanel panel, final Track track);
55  
56  	protected abstract EventImpl parseEventNode(final Node eventNode);
57  
58  	public abstract Operation parseOperationNode(final Node operationNode, final Track track);
59  
60  	protected abstract MenuOperationItem parseMenuItemNode(final Node menuItemNode, final Track track);
61  
62  	protected abstract FrameCommand parseCommandNode(final Node commandNode, final Track track);
63  
64  }