/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package medusa.georgios.Layouts;

import java.util.ArrayList;
import java.util.Iterator;
import medusa.georgios.vecmathpackage.Point3d;
import medusa.graph.Edge;
import medusa.graph.Graph;
import medusa.MedusaSimplerFrame;

/**
 *
 * @author Georgios
 */
public class GeneOntologyLayoutNode {

    public medusa.graph.Node node;
    public int distance;
    public int children;
    public int parents;
    public int level;
    public Point3d p;
    public ArrayList children_list = new ArrayList();
    public ArrayList parents_list = new ArrayList();
    public ArrayList leaf_list = new ArrayList();

    public GeneOntologyLayoutNode(medusa.graph.Node node, int distance, Graph g ) {
        this.node = node;
        this.distance = distance;
        this.level = 0;
        int count = 0;


        for (Iterator it = g.edgesIterator(); it.hasNext();) {
            Edge e = (Edge) it.next();
            String source = e.getFromName();
            String destination = e.getToName();
            if (source.compareToIgnoreCase(node.getLabel()) == 0) {
                children_list.add(g.getNode(e.getToName()));
                this.children++;
            }
        }


        for (Iterator it = g.edgesIterator(); it.hasNext();) {
            Edge e = (Edge) it.next();
            String source = e.getFromName();
            String destination = e.getToName();
            if (destination.compareToIgnoreCase(node.getLabel()) == 0) {
                parents_list.add(g.getNode(e.getFromName()));
                this.parents++;
            }
        }



    }
}

 

Ads help maintain this website.