Package org.gvt.model

Examples of org.gvt.model.CompoundModel


    CTabItem tab = main.createNewTab(graph);

    if (refsToHighlight != null && !refsToHighlight.isEmpty())
    {
      ScrollingGraphicalViewer viewer = main.getTabToViewerMap().get(tab);
      CompoundModel root = (CompoundModel) viewer.getContents().getModel();

      if (root instanceof BioPAXGraph)
      {
        new HighlightWithRefAction(main, (BioPAXGraph) root, refsToHighlight).run();
      }
View Full Code Here


  // Section: Traversing
  //----------------------------------------------------------------------------------------------

  public Collection<? extends Node> getParents()
  {
    CompoundModel p = this.getParentModel();
    Collection<Node> col = new ArrayList<Node>(1);

    if (p == null || p.isRoot())
    {
      return col;
    }
    else
    {
View Full Code Here

    ScrollingGraphicalViewer viewer = main.getTabToViewerMap().get(tab);

    main.closeTab(tab, false);

    CompoundModel root = (CompoundModel) viewer.getContents().getModel();

    if (root instanceof BioPAXGraph)
    {
      BioPAXGraph graph = (BioPAXGraph) root;
View Full Code Here

      name = name.toLowerCase().trim();

      // Iterate all nodes in graph
     
      CompoundModel root = (CompoundModel) ((ChsRootEditPart)main.getViewer().
        getRootEditPart().getChildren().get(0)).getModel();

      Iterator<NodeModel> nodeIter = root.getNodes().iterator();

      while (nodeIter.hasNext())
      {
        NodeModel node = nodeIter.next();
View Full Code Here

  }

  public void closeTab(CTabItem tab, boolean rememberLayout)
  {
    ScrollingGraphicalViewer viewer = tabToViewerMap.get(tab);
    CompoundModel root = (CompoundModel) viewer.getContents().getModel();

    if (root instanceof BioPAXGraph)
    {
      BioPAXGraph graph = (BioPAXGraph) root;
View Full Code Here

  }

  public void closeTab(CTabItem tab, boolean rememberLayout)
  {
    ScrollingGraphicalViewer viewer = tabToViewerMap.get(tab);
    CompoundModel root = (CompoundModel) viewer.getContents().getModel();

    if (root instanceof BioPAXGraph)
    {
      BioPAXGraph graph = (BioPAXGraph) root;
View Full Code Here

      {
        Collection<List<physicalEntityParticipant>> coll = groupParticipants(pe);
       
        for (List<physicalEntityParticipant> list : coll)
        {
          CompoundModel compart = getCompartment(list.get(0), map, root);
         
          Actor actor = new Actor(compart, pe, list);
         
          for (physicalEntityParticipant par : list)
          {
            map.put(par.getRDFId(), actor);
          }
        }
      }
    }
   
    // Create complexes

    for (complex cmp : model.getObjects(complex.class))
    {
      if (cmp.isPHYSICAL_ENTITYof().isEmpty())
      {
        Complex c = new Complex(root, cmp, new ArrayList<physicalEntityParticipant>(0));
        createComplexContent(c, cmp, new ArrayList<physicalEntityParticipant>());
      }
      else
      {
        Collection<List<physicalEntityParticipant>> coll = groupParticipants(cmp);
       
        for (List<physicalEntityParticipant> list : coll)
        {
          CompoundModel compart = getCompartment(list.get(0), map, root);

          if (compart == root)
          {
            String nm = Complex.suggestCompartmentNameUsingMembers(cmp.getCOMPONENTS());

            if (nm != null)
            {
              if (nestCompartments) nm = CompartmentManager.getUnifiedName(nm);
              compart = getCompartment(nm, map, root);
            }
          }

          NodeModel nd;

          if (cmp.getCOMPONENTS().isEmpty())
          {
            nd = new Actor(compart, cmp, list);
          }
          else
          {
            Complex c = new Complex(compart, cmp, list);
            createComplexContent(c, cmp, list);
            nd = c;
          }

          for (physicalEntityParticipant par : list)
          {
            map.put(par.getRDFId(), nd);
          }
        }
      }
    }   
   
    // Create events
   
    for (conversion conv : model.getObjects(conversion.class))
    {
      String compName = Conversion.getPossibleCompartmentName(conv);

      if (compName != null && nestCompartments)
        compName = CompartmentManager.getUnifiedName(compName);
     
      CompoundModel compart = compName == null ? root : (CompoundModel) map.get(compName);
     
      Conversion forwd = null, rever = null;
     
      if (evidenceExists(conv, Conversion.LEFT_TO_RIGHT))
      {
        forwd = new Conversion(compart, conv, Conversion.LEFT_TO_RIGHT, map);
        forwd.selectBestCompartment();
      }     
      if (evidenceExists(conv, Conversion.RIGHT_TO_LEFT))
      {
        rever = new Conversion(compart, conv, Conversion.RIGHT_TO_LEFT, map);
        rever.selectBestCompartment();
      }
      if (forwd == null && rever == null)
      {
        forwd = new Conversion(compart, conv, Conversion.LEFT_TO_RIGHT, map);
        forwd.selectBestCompartment();
      }
    }

    for (interaction inter : model.getObjects(interaction.class))
    {
      boolean drawPPI = true;
      if (!drawPPI) break;

      if (!(inter instanceof conversion) && !(inter instanceof control))
      {
        Set<InteractionParticipant> interPartic = inter.getPARTICIPANTS();
        Set<physicalEntityParticipant> peps = new HashSet<physicalEntityParticipant>();

        boolean hasControl = !inter.isCONTROLLEDOf().isEmpty();

        for (InteractionParticipant partic : interPartic)
        {
          if (partic instanceof physicalEntityParticipant)
          {
            peps.add((physicalEntityParticipant) partic);
          }
        }

        if (hasControl || peps.size() != 2)
        {
          String compName = Hub.getPossibleCompartmentName(peps);

          if (nestCompartments) compName = CompartmentManager.getUnifiedName(compName);

          CompoundModel compart = compName == null ? root :
            (CompoundModel) map.get(compName);

          Hub hub = new Hub(compart, inter,
            new ArrayList<physicalEntityParticipant>(peps), map);
View Full Code Here

   * unknown compartment is nested under cytoplasm.
   * @param map compartment map
   */
  public static void nestCompartments(Map<String, CompoundModel> map)
  {
    CompoundModel cytoplasm = map.get(CYTOPLASM);

    if (cytoplasm != null)
    {
      CompoundModel cell_mem = map.get(CELL_MEMBRANE);
      CompoundModel extracel = map.get(EXTRACELLULAR);

      Set<CompoundModel> processed = new HashSet<CompoundModel>();

      if (extracel != null) processed.add(extracel);

      if (cell_mem !=  null)
      {
        moveCompartmentIndside(cytoplasm, cell_mem);
        processed.add(cell_mem);
      }

      processed.add(cytoplasm);

      for (CompoundModel cm : map.values())
      {
        if (!processed.contains(cm))
        {
          moveCompartmentIndside(cm, cytoplasm);
        }
      }
    }

    CompoundModel nuc_mem = map.get(NUCLEAR_MEM);
    CompoundModel nucleus = map.get(NUCLEUS);

    if (nuc_mem != null && nucleus != null) moveCompartmentIndside(nucleus, nuc_mem);

    CompoundModel mitoc = map.get(MITOCHONDRIA);
    CompoundModel mit_inn_mem = map.get(MITOCH_INNER_MEM);
    CompoundModel mit_out_mem = map.get(MITOCH_OUTER_MEM);
    CompoundModel mit_int_mem = map.get(MITOCH_INTER_MEM);

    if (mitoc != null)
    {
      if (mit_inn_mem != null) moveCompartmentIndside(mitoc, mit_inn_mem);
      else if (mit_int_mem != null) moveCompartmentIndside(mitoc, mit_int_mem);
      else if (mit_out_mem != null) moveCompartmentIndside(mitoc, mit_out_mem);
    }
    if (mit_inn_mem != null)
    {
      if (mit_int_mem != null) moveCompartmentIndside(mit_inn_mem, mit_int_mem);
      else if (mit_out_mem != null) moveCompartmentIndside(mit_inn_mem, mit_out_mem);
    }
    if (mit_int_mem != null)
    {
      if (mit_out_mem != null) moveCompartmentIndside(mit_int_mem, mit_out_mem);
    }

    CompoundModel endo = map.get(ENDOSOME);
    CompoundModel endo_mem = map.get(ENDOSOME_MEM);

    if (endo != null && endo_mem != null) moveCompartmentIndside(endo, endo_mem);

    CompoundModel gol_lum = map.get(GOLGI_LUM);
    CompoundModel gol_mem = map.get(GOLGI_MEM);

    if (gol_lum != null && gol_mem != null) moveCompartmentIndside(gol_lum, gol_mem);

    CompoundModel er_lum = map.get(ER_LUM);
    CompoundModel er_mem = map.get(ER_MEM);

    if (er_lum != null && er_mem != null) moveCompartmentIndside(er_lum, er_mem);
  }
View Full Code Here

  }

  public void run()
  {
    // creates a new compound model for setting the margin value
    CompoundModel cm = new CompoundModel();
    cm.setParentModel(root);
    cm.setMarginSize(newMargin);
  }
View Full Code Here

  }

  public void run()
  {
    // creates a new compound model for setting the margin value
    CompoundModel cm = new CompoundModel();
    cm.setParentModel(root);
    cm.setMarginSize(newMargin);
  }
View Full Code Here

TOP

Related Classes of org.gvt.model.CompoundModel

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.