Package org.gvt.model.biopaxl3

Examples of org.gvt.model.biopaxl3.BioPAXEdge


      }
    }

    for (Object o : graph.getEdges())
    {
      BioPAXEdge edge = (BioPAXEdge) o;
      if (edge.isHighlighted())
      {
        highlightMap.put(edge.getIDHash(), edge.getHighlightColor());
      }
    }

    // Reset highlight

    HighlightLayer hLayer = (HighlightLayer)
      ((ChsScalableRootEditPart) viewer.getRootEditPart()).getLayer(
        HighlightLayer.HIGHLIGHT_LAYER);

    hLayer.removeAll();
    hLayer.highlighted.clear();

    viewer.deselectAll();

    // Record layout
    graph.recordLayout();

    // Create updated graph
    pathway p = graph.getPathway();
    BioPAXGraph newGraph = main.getRootGraph().excise(p);
    newGraph.setName(p.getNAME());
    newGraph.setAsRoot();

    // Replace the graph
    viewer.setContents(newGraph);

    // Use same layout
    boolean layedout = newGraph.fetchLayout();

    if (!layedout)
    {
      new CoSELayoutAction(main).run();
    }

    viewer.deselectAll();
    GraphAnimation.run(viewer);

    // Recover highlights

    for (Object o : newGraph.getNodes())
    {
      IBioPAXNode node = (IBioPAXNode) o;
      if (highlightMap.containsKey(node.getIDHash()))
      {
        node.setHighlightColor(highlightMap.get(node.getIDHash()));
        node.setHighlight(true);
      }
    }

    for (Object o : newGraph.getEdges())
    {
      BioPAXEdge edge = (BioPAXEdge) o;
      if (highlightMap.containsKey(edge.getIDHash()))
      {
        edge.setHighlightColor(highlightMap.get(edge.getIDHash()));
        edge.setHighlight(true);
      }
    }
  }
View Full Code Here


      }
    }

    for (Object o : graph.getEdges())
    {
      BioPAXEdge edge = (BioPAXEdge) o;
      if (edge.isHighlighted())
      {
        highlightMap.put(edge.getIDHash(), edge.getHighlightColor());
      }
    }

    // Reset highlight

    HighlightLayer hLayer = (HighlightLayer)
      ((ChsScalableRootEditPart) viewer.getRootEditPart()).getLayer(
        HighlightLayer.HIGHLIGHT_LAYER);

    hLayer.removeAll();
    hLayer.highlighted.clear();

    viewer.deselectAll();

    // Record layout
    graph.recordLayout();

    // Create updated graph
    pathway p = graph.getPathway();

    // Update pathway components if update needed

    if (withContent != null)
    {
      for (pathwayComponent pc : new HashSet<pathwayComponent>(p.getPATHWAY_COMPONENTS()))
      {
        p.removePATHWAY_COMPONENTS(pc);
      }
     
      Set<conversion> convSet = new HashSet<conversion>();

      for (GraphObject go : withContent)
      {
        if (go instanceof Conversion)
        {
          Conversion conv = (Conversion) go;
          conversion cnv = conv.getConversion();
          convSet.add(cnv);
        }
      }

      Set<pathwayComponent> components = p.getPATHWAY_COMPONENTS();

      for (conversion cnv : convSet)
      {
        if (!components.contains(cnv))
        {
          p.addPATHWAY_COMPONENTS(cnv);
        }
      }
    }

    // Excise pathway

    BioPAXGraph newGraph = main.getRootGraph().excise(p);
    newGraph.setName(p.getNAME());
    newGraph.setAsRoot();

    // Replace the graph
    viewer.setContents(newGraph);

    // Use same layout
    boolean layedout = newGraph.fetchLayout();

    if (!layedout)
    {
      new CoSELayoutAction(main).run();
    }

    viewer.deselectAll();
    GraphAnimation.run(viewer);

    // Recover highlights

    for (Object o : newGraph.getNodes())
    {
      IBioPAXNode node = (IBioPAXNode) o;
      if (highlightMap.containsKey(node.getIDHash()))
      {
        node.setHighlightColor(highlightMap.get(node.getIDHash()));
        node.setHighlight(true);
      }
    }

    for (Object o : newGraph.getEdges())
    {
      BioPAXEdge edge = (BioPAXEdge) o;
      if (highlightMap.containsKey(edge.getIDHash()))
      {
        edge.setHighlightColor(highlightMap.get(edge.getIDHash()));
        edge.setHighlight(true);
      }
    }
  }
View Full Code Here

      {
        NodeModel model = (NodeModel) o;

        if (model instanceof Actor)
        {
          Actor actor = (Actor) model;

          System.out.println(actor.getEntity().l3pe.getRDFId());
        }
        else if (o instanceof ChbComplex)
        {
          ChbComplex cmp = (ChbComplex) o;
          System.out.println(cmp.getComplex().getRDFId());
View Full Code Here

          BioPAXL2Reader reader = new BioPAXL2Reader(model);
          reader.createGraph((BioPAXL2Graph) root);
        }
        else if (level == BioPAXLevel.L3)
        {
          root = new BioPAXL3Graph(model);
          BioPAXL3Reader reader = new BioPAXL3Reader(model);
          reader.createGraph((BioPAXL3Graph) root);
        }
      }
    }
View Full Code Here

          System.out.println(actor.getEntity().l3pe.getRDFId());
        }
        else if (o instanceof ChbComplex)
        {
          ChbComplex cmp = (ChbComplex) o;
          System.out.println(cmp.getComplex().getRDFId());
        }
      }
    }

  }
View Full Code Here

      for (GraphObject go : content)
      {
        if (go instanceof ChbConversion)
        {
          ChbConversion conv = (ChbConversion) go;
          org.biopax.paxtools.model.level3.Conversion cnv = conv.getConversion();
          convSet.add(cnv);
        }
      }

      Set<Process> components = l3p.getPathwayComponent();
View Full Code Here

TOP

Related Classes of org.gvt.model.biopaxl3.BioPAXEdge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.