Package org.gvt.model

Examples of org.gvt.model.NodeModel


  /**
   * Gets the graph that this node is inserted.
   */
  public BioPAXL3Graph getGraph()
  {
    NodeModel parent = (NodeModel) node;

    do
    {
      parent = parent.getParentModel();
    }
    while (parent != null && !(parent instanceof BioPAXL3Graph));

    return (BioPAXL3Graph) parent;
  }
View Full Code Here


  /**
   * Gets the compartment that this node is in.
   */
  public Compartment getCompartment()
  {
    NodeModel parent = (NodeModel) node;

    do
    {
      parent = parent.getParentModel();
    }
    while (parent != null && !(parent instanceof Compartment));

    return (Compartment) parent;
  }
View Full Code Here

        Control mod = (Control) map.get(c.getRDFId());
        new EffectorSecondHalf(mod, this, mod.getControl());
      }
      else if (c.isCONTROLLEDOf().isEmpty() && c.getCONTROLLER().size() == 1)
      {
        NodeModel source = map.get(c.getCONTROLLER().iterator().next().getRDFId());
        new NonModulatedEffector(source, this, c,
          c.getCONTROLLER().iterator().next(), inter);
      }
      else
      {
View Full Code Here

   
    Set<physicalEntityParticipant> pars = con.getCONTROLLER();
   
    for (physicalEntityParticipant par : pars)
    {
      NodeModel node = map.get(par.getRDFId());
      new EffectorFirstHalf(node, this, par);
    }

    new EffectorSecondHalf(this, target, con);
   
    // Connect modulators.
   
    for (control c : con.isCONTROLLEDOf())
    {
      if (map.containsKey(c.getRDFId()))
      {
        Control mod = (Control) map.get(c.getRDFId());
        new EffectorSecondHalf(mod, this, mod.getControl());
      }
      else if (c.isCONTROLLEDOf().isEmpty() && c.getCONTROLLER().size() == 1)
      {
        NodeModel source = map.get(c.getCONTROLLER().iterator().next().getRDFId());
        new NonModulatedEffector(source, this, c, c.getCONTROLLER().iterator().next(), con);
      }
      else
      {
        Control ctrl = new Control(root, c, this, map);
View Full Code Here

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

      while (nodeIter.hasNext())
      {
        NodeModel node = nodeIter.next();

        if (node.getText().toLowerCase().indexOf(name) >= 0 ||
          (node.getTooltipText() != null &&
            node.getTooltipText().toLowerCase().indexOf(name) >= 0))
        {
          node.setHighlight(true);
        }
      }
    }
   
    name = null;
View Full Code Here

              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);

          for (physicalEntityParticipant pep : peps)
          {
            NodeModel node = map.get(pep.getRDFId());

            // TEMPORARY CODE -- REMOVE WHEN BUG IS FIXED
            if (node == null)
            {
              System.err.println("PEP without PE");
View Full Code Here

      instanceof FileMoveTool))
      event.doit = false;
  }

  public void dragSetData(DragSourceEvent event) {
    NodeModel model =
      (NodeModel) ((EditPart) getViewer().getSelectedEditParts().get(0))
        .getModel();
    event.data = new String[] { model.getText()};
  }
View Full Code Here

*/
public class ModelFactory implements CreationFactory {
  private String path;

  public Object getNewObject() {
    NodeModel model = new NodeModel();
    model.setText(path);
    return model;
  }
View Full Code Here

{
  ChsDirectEditManager directManager = null;

  protected IFigure createFigure()
  {
    NodeModel model = getNodeModel();
    NodeFigure nFigure = new NodeFigure(model.getLocationAbs(),
      model.getSize(),
      model.getText(),
      model.getTooltipText(),
      model.getTextFont(),
      model.getTextColor(),
      model.getColor(),
      model.getBorderColor(),
      model.getShape(),
      model.getHighlightColor(),
      model.isHighlight());

    nFigure.updateHighlight(
      (HighlightLayer) getLayer(HighlightLayer.HIGHLIGHT_LAYER),
      getNodeModel().isHighlight());
View Full Code Here

    {
      EditPart childEditPart = (EditPart) selectedObjects.next();
      // if selected one is a node or compound DeleteCommand is called
      if (childEditPart instanceof ChsNodeEditPart)
      {
        NodeModel node = (NodeModel) childEditPart.getModel();
        DeleteCommand command = new DeleteCommand();
        command.setChild(node);
        EditPart parent = childEditPart.getParent();
        command.setParent((CompoundModel) parent.getModel());
        command.execute();
View Full Code Here

TOP

Related Classes of org.gvt.model.NodeModel

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.