Examples of NodeContainer


Examples of ca.nengo.ui.models.NodeContainer

     * @return Top Node Container available in the Application Window. Null, if
     *          the Top Window is not a Node Container
     */
    private NodeContainer getTopNodeContainer() {
        Window window = getTopWindow();
        NodeContainer nodeContainer = null;

        if (window != null) {
            WorldObject wo = window.getContents();
            if (wo instanceof NodeContainer) {
                nodeContainer = (NodeContainer) wo;
View Full Code Here

Examples of org.corrib.s3b.sscf.tools.sscf2js.NodeContainer

    //TODO: checking credit.
    //boolean reachable = checkCredit(viewer, resource);

    level++;
   
    NodeContainer nc = new NodeContainer();
   
    //** selected link/filtering **
    Set<List<String>> newPathsToUri = pathsToUri;
   
    if(pathsToUri!=null)
    {
      //check if node is on one of the paths in pathsToUri - if yes cut off this path
      for(List<String> path:pathsToUri)
      {
        if(!path.isEmpty())
          if(path.get(0).equals(resource.getStringURI()))
          {
            onPath = true;
            break;
          }
      }
     
      //if the current node is on some path - rewrite the list, and remove current node from it.
      if(onPath)
      {
        newPathsToUri = new HashSet<List<String>>();
        for(List<String> path:pathsToUri)
        {
          if(!path.isEmpty())
            if(path.get(0).equals(resource.getStringURI()))
            {
              path.remove(0);
            }
         
          if(!path.isEmpty())
          {
            newPathsToUri.add(path);
          }
        }
      }
    } 
   
    //need to think some more wise way to tell when script should stop go deeper
    if(level>=maxAbsoluteLevel&&hasContent&&!onPath) {
      isDyn = true;
    }
    nc.setDyn(isDyn);
   
    //set dynamic load
    //nc.setDyn(false);
   
    if (resource instanceof SiocPostResource) {
      SiocPostResource spr = SiocPostResource.getInstance(resource.getStringURI());
     
      owner = spr.getMaker();
      isOwner = viewer.equals(owner);
     
      nc.setType("siocPost");
   
      BookmarkNode bn = new BookmarkNode();
      bn.setId(spr.getStringURI());
     
      if(spr.getTitle()!=null&&!"".equals(spr.getTitle().trim()))
        bn.setLabel("Post:"+spr.getTitle());
      else
        bn.setLabel("Post:"+spr.getStringURI());
       
      //check if this bookmark is selected this directory        
      if(resource.getStringURI().equals(selectedUri))
      {
        bn.setSelected(true);
      }
      else bn.setSelected(false);
     
      bn.setLevel(level);
      bn.setOwn(parentIsOwner)
      bn.setStandalone(standalone);
      nc.setContent(bn);
    }
    else if (resource instanceof SiocForumResource) {
      SiocForumResource sfr = SiocForumResource.getInstance(resource.getStringURI());
     
      hasContent = sfr.hasContent();
   
      nc.setType("siocForum");
     
      DirectoryNode dn = new DirectoryNode();
      dn.setId(sfr.getStringURI());
      dn.setLevel(level);
     
      if(sfr.getName()!=null&&!"".equals(sfr.getName()))
        dn.setLabel("Forum: "+sfr.getName());
      else if(sfr.getTitle()!=null&&!"".equals(sfr.getTitle()))
        dn.setLabel("Forum: "+sfr.getTitle());
      else dn.setLabel("Forum: "+sfr.getStringURI());
      dn.setOwn(isOwner);
      //TODO - get owner from this tags
      //dn.setOwnerMbox((owner != null) ? (owner.getMbox().toString()) : "");
      //dn.setOwnerName((owner != null) ? (owner.getName()) : "");
      dn.setOwnerMbox("");
      dn.setOwnerName("");
      dn.setRemovable(!hasContent);
      dn.setLinkedIn(parentIsOwner&!isOwner);
     
      //check if user select this directory - we can get id or whole uri.
      if(selectedUri!=null&&!"".equals(selectedUri.trim())&&selectedUri.length()>=40)
      {
        if(resource.getStringURI().equals(selectedUri)||
            resource.getStringURI().endsWith(selectedUri.substring(selectedUri.length()-40,selectedUri.length())))
        {
          dn.setSelected(true);
          dn.setOpened(false);
        }
        else dn.setSelected(false);
      }
     
      dn.setStandalone(standalone);
      nc.setContent(dn);

    }
    else if (resource instanceof SiocSiteResource) {
      SiocSiteResource ssr = SiocSiteResource.getInstance(resource.getStringURI());
     
      hasContent = ssr.hasContent();

      nc.setType("siocSite");
   
      DirectoryNode dn = new DirectoryNode();
      dn.setId(resource.getResource().toString());
      dn.setLevel(level);
      dn.setLabel("Site: "+ssr.getTitle());
      dn.setOwn(isOwner);
      //TODO - get owner from this tags
      //dn.setOwnerMbox((owner != null) ? (owner.getMbox().toString()) : "");
      //dn.setOwnerName((owner != null) ? (owner.getName()) : "");
      dn.setOwnerMbox("");
      dn.setOwnerName("");   
      dn.setRemovable(!hasContent);
      dn.setLinkedIn(parentIsOwner&!isOwner);
     
      //check if user select this directory - we can get id or whole uri.
      if(selectedUri!=null&&!"".equals(selectedUri.trim())&&selectedUri.length()>=40)
      {
        if(resource.getStringURI().equals(selectedUri)||
            resource.getStringURI().endsWith(selectedUri.substring(selectedUri.length()-40,selectedUri.length())))
        {
          dn.setSelected(true);
          dn.setOpened(false);
        }
        else dn.setSelected(false);
      }
     
      dn.setStandalone(standalone);
      nc.setContent(dn);
    }
   
    //add created nodes to the buffer
    nc.toJSON(buffer);
   
    //proceed the content of this resource

    if (hasContent&&!isDyn) {
      //parentIsOwner = isOwner;
View Full Code Here

Examples of org.drools.definition.process.NodeContainer

              y = y + offsetY;
              height = 48;
        }
        int parentOffsetX = 0;
        int parentOffsetY = 0;
        NodeContainer nodeContainer = node.getNodeContainer();
        while (nodeContainer instanceof CompositeNode) {
          CompositeNode parent = (CompositeNode) nodeContainer;
          Integer parentX = (Integer) parent.getMetaData().get("x");
          if (parentX != null) {
            parentOffsetX += parentX;
View Full Code Here

Examples of org.drools.definition.process.NodeContainer

      String result = (String) node.getMetaData().get("UniqueId");
      if (result != null) {
        return result;
      }
      result = node.getId() + "";
      NodeContainer nodeContainer = node.getNodeContainer();
      while (nodeContainer instanceof CompositeNode) {
        CompositeNode composite = (CompositeNode) nodeContainer;
        result = composite.getId() + "-" + result;
        nodeContainer = composite.getNodeContainer();
      }
View Full Code Here

Examples of org.drools.definition.process.NodeContainer

            }
        }
    }
   
    private boolean acceptsNoIncomingConnections(Node node) {
      NodeContainer nodeContainer = node.getNodeContainer();
      return nodeContainer instanceof DynamicNode ||
        (nodeContainer instanceof WorkflowProcess && ((WorkflowProcess) nodeContainer).isDynamic());
    }
View Full Code Here

Examples of org.drools.definition.process.NodeContainer

      return nodeContainer instanceof DynamicNode ||
        (nodeContainer instanceof WorkflowProcess && ((WorkflowProcess) nodeContainer).isDynamic());
    }

    private boolean acceptsNoOutgoingConnections(Node node) {
      NodeContainer nodeContainer = node.getNodeContainer();
      return nodeContainer instanceof DynamicNode ||
        (nodeContainer instanceof WorkflowProcess && ((WorkflowProcess) nodeContainer).isDynamic());
    }
View Full Code Here

Examples of org.drools.definition.process.NodeContainer

        return this.id;
    }
   
    public String getUniqueId() {
      String result = id + "";
      NodeContainer nodeContainer = getNodeContainer();
      while (nodeContainer instanceof CompositeNode) {
        CompositeNode composite = (CompositeNode) nodeContainer;
        result = composite.getId() + ":" + result;
        nodeContainer = composite.getNodeContainer();
      }
View Full Code Here

Examples of org.drools.definition.process.NodeContainer

    }
   
    private String createNodeId(NodeInstance nodeInstance) {
      Node node = ((org.drools.workflow.instance.NodeInstance) nodeInstance).getNode();
      String nodeId = "" + node.getId();
      NodeContainer nodeContainer = node.getNodeContainer();
      while (nodeContainer != null) {
        if (nodeContainer instanceof CompositeNode) {
          node = (CompositeNode) nodeContainer;
          nodeId = node.getId() + ":" + nodeId;
          nodeContainer = node.getNodeContainer();
View Full Code Here

Examples of org.drools.definition.process.NodeContainer

        Node node = nodeInstance.getNode();
        if (node == null) {
            return "";
        }
        String nodeId = "" + node.getId();
        NodeContainer nodeContainer = node.getNodeContainer();
        while (nodeContainer != null) {
            if (nodeContainer instanceof Node) {
                node = (Node) nodeContainer;
                nodeContainer = node.getNodeContainer();
                // TODO fix this filter out hidden compositeNode inside ForEach node
                if (!(nodeContainer.getClass().getName().endsWith("ForEachNode"))) {
                    nodeId = node.getId() + ":" + nodeId;
                }
            } else {
                break;
            }
View Full Code Here

Examples of org.drools.definition.process.NodeContainer

      Node node = nodeInstance.getNode();
      if (node == null) {
        return "";
      }
      String nodeId = "" + node.getId();
      NodeContainer nodeContainer = node.getNodeContainer();
      while (nodeContainer != null) {
        if (nodeContainer instanceof Node) {
          node = (Node) nodeContainer;
          nodeContainer = node.getNodeContainer();
          // TODO fix this filter out hidden compositeNode inside ForEach node
          if (!(nodeContainer.getClass().getName().endsWith("ForEachNode"))) {
              nodeId = node.getId() + ":" + nodeId;
          }
        } else {
          break;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.