edu.hust.go.gui
Class GraphCreator

java.lang.Object
  |
  +--edu.hust.go.gui.GraphCreator

public class GraphCreator
extends java.lang.Object

Three kinds of graphical pathways can be displayed. The pathway is a set of nodes connected by "is_a" or "part of". In general, it is from one of three root nodes to the target nodes. Here, the pathway can be expanded or shorten with defined parent or child level. For parents, 0 means the pathway should begin from one of 3 root nodes, -1 means the pathway should not including parent nodes and begin from itself, and positive integer n means the pathway should include n level nodes from itself to root. For children, 0 means the pathway should ends at its final leaf nodes, -1 means the pathway should not include any children and end at itself, and positive integer means the pathway shoudl include n level nodes from itself to final leaf nodes.In default, the parent level should be 0, and child level should be -1.


Field Summary
static byte JGRAPHVIEW
           
static byte JTREEGRAPHVIEW
           
static byte JTREEVIEW
           
 
Constructor Summary
GraphCreator()
           
 
Method Summary
static javax.swing.JComponent createView(edu.hust.go.model.GoGraphModel graph, java.util.ArrayList golist, byte viewType, int parentLevel, int childLevel)
          Construct GUI by GO terms
static java.lang.Object[] query(java.lang.String[] goids, java.util.HashMap goMap, byte viewType, int childLevel)
          Construct GUI by GO ids
static java.util.ArrayList[] transForm(java.lang.String[] goids, java.util.HashMap goMap, java.util.HashSet obsoleteSet)
          transforms standard GO ids into GO terms.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JTREEGRAPHVIEW

public static final byte JTREEGRAPHVIEW
See Also:
Constant Field Values

JTREEVIEW

public static final byte JTREEVIEW
See Also:
Constant Field Values

JGRAPHVIEW

public static final byte JGRAPHVIEW
See Also:
Constant Field Values
Constructor Detail

GraphCreator

public GraphCreator()
Method Detail

query

public static java.lang.Object[] query(java.lang.String[] goids,
                                       java.util.HashMap goMap,
                                       byte viewType,
                                       int childLevel)
Construct GUI by GO ids

Parameters:
goids - every ids should be in the style of GO:*******
goMap - the key is GO ids, the value is GO terms.
viewType - GUI type,should be one of JTREEVIEW,JGRAPHVIEW,JTREEGRAPHVIEW
childLevel - -1 means discard children, 0 means all children postive integer means the depth from itself to corresponding children
Returns:
two elements, element one is JComponent, element two is String

transForm

public static java.util.ArrayList[] transForm(java.lang.String[] goids,
                                              java.util.HashMap goMap,
                                              java.util.HashSet obsoleteSet)
transforms standard GO ids into GO terms.

Parameters:
goids - every ids should be in the style of GO:*******
goMap - the key is GO ids, the value is GO terms.
obsoleteSet - the obsolete GO terms does not exist in graph model
Returns:
three GO terms list: aviable, obsolete, not-exist GO ids. The former two are GO terms, the latter is String

createView

public static javax.swing.JComponent createView(edu.hust.go.model.GoGraphModel graph,
                                                java.util.ArrayList golist,
                                                byte viewType,
                                                int parentLevel,
                                                int childLevel)
Construct GUI by GO terms

Parameters:
graph - the graph model including all GO terms except obsolete terms
golist - aviable query GO terms
viewType - GUI type,should be one of JTREEVIEW,JGRAPHVIEW,JTREEGRAPHVIEW
parentLevel - -1 means discard parents, 0 means all parents postive integer means the depth from itself to corresponding parents
childLevel - -1 means discard children, 0 means all children postive integer means the depth from itself to corresponding children
Returns: