Examples of Subgraph


Examples of com.nigelsmall.geoff.Subgraph

    @Override
    public ElementCounter load(Reader reader, Reporter reporter, Config config) throws IOException {
        try (Transaction tx = db.beginTx())  {
            NeoLoader loader = new NeoLoader(db);
            Subgraph subgraph = new GeoffReader(reader).readSubgraph();
            Map<String, Node> result = loader.load(subgraph);
            tx.success();
            reporter.update(result.size(),0,0); // todo more insights
        }
        return reporter.getTotal();
View Full Code Here

Examples of net.wigis.graph.dnv.SubGraph

    double width = originalMaxX - originalMinX;
    double minX = minXPercent * width + originalMinX;
    double maxX = maxXPercent * width + originalMinX;
    double minY = minYPercent * height + originalMinY;
    double maxY = maxYPercent * height + originalMinY;
    SubGraph subGraph = new SubGraph( graph, level );
    if( graph.getVisibleNodes( level ).size() < 2000 || ( minXPercent == 0 && minYPercent == 0 && maxXPercent == 1 && maxYPercent == 1 ) )
    {
      subGraph.setEdges( graph.getVisibleEdges( level ) );
      subGraph.setNodes( graph.getVisibleNodes( level ) );
      return subGraph;
    }
   
    List<DNVNode> nodes = new ArrayList<DNVNode>( graph.getVisibleNodes( level ).values() );
    DNVNode tempNode;
    if( nodes != null )
    {
      for( Iterator<DNVNode> i = nodes.iterator(); i.hasNext(); )
      {
        tempNode = i.next();
        if( tempNode.isVisible() && isNodeWithin( tempNode, minX, minY, maxX, maxY ) )
        {
          // Add the node
          subGraph.add( tempNode );
          // Add all the neighbor nodes
          subGraph.addAllNodes( tempNode.getNeighbors( true ) );
          // Add the edges to all the neighbors
          subGraph.addAllEdges( tempNode.getFromEdges( true ) );
          subGraph.addAllEdges( tempNode.getToEdges( true ) );
        }
      }
    }

    return subGraph;
View Full Code Here

Examples of net.wigis.graph.dnv.SubGraph

      double minY = getMinY();
      double maxX = getMaxX();
      double maxY = getMaxY();

      findSubGraph();
      SubGraph subGraph = this.subGraph;
      int edgeThickness = (int)this.edgeThickness;
      if( overview )
      {
        edgeThickness = 1;
        level = 0;
View Full Code Here

Examples of org.apache.struts2.sitegraph.model.SubGraph

            if (!namespace.startsWith(ns)) {
                continue;
            }

            SubGraph subGraph = graph.create(namespace);

            Set actionNames = StrutsConfigRetriever.getActionNames(namespace);
            for (Iterator iterator = actionNames.iterator(); iterator.hasNext();) {
                String actionName = (String) iterator.next();
                ActionConfig actionConfig = StrutsConfigRetriever.getActionConfig(namespace,
                        actionName);

                ActionNode action = new ActionNode(actionName);
                subGraph.addNode(action);

                Set resultNames = actionConfig.getResults().keySet();
                for (Iterator iterator2 = resultNames.iterator(); iterator2.hasNext();) {
                    String resultName = (String) iterator2.next();
                    ResultConfig resultConfig = ((ResultConfig) actionConfig.getResults().get(resultName));
                    String resultClassName = resultConfig.getClassName();

                    if (resultClassName.equals(ActionChainResult.class.getName())) {

                    } else if (resultClassName.indexOf("Dispatcher") != -1
                            || resultClassName.indexOf("Velocity") != -1
                            || resultClassName.indexOf("Freemarker") != -1) {
                        if (resultConfig.getParams().get("location") == null) {
                            continue;
                        }

                        String location = getViewLocation((String) resultConfig.getParams().get("location"), namespace);
                        //  FIXME: work with new configuration style                       
                        if (location.endsWith("action")) {
                            addTempLink(action, location, Link.TYPE_RESULT, resultConfig.getName());
                        } else {
                            ViewNode view = new ViewNode(stripLocation(location));
                            subGraph.addNode(view);

                            addTempLink(action, location, Link.TYPE_RESULT, resultConfig.getName());

                            View viewFile = getView(namespace, actionName, resultName, location);
                            if (viewFile != null) {
                                viewMap.put(view, viewFile);
                            }
                        }
                    } else if (resultClassName.indexOf("Jasper") != -1) {

                    } else if (resultClassName.indexOf("XSLT") != -1) {

                    } else if (resultClassName.indexOf("Redirect") != -1) {
                        // check if the redirect is to an action -- if so, link it
                        String location = getViewLocation((String) resultConfig.getParams().get("location"), namespace);
                        //  FIXME: work with new configuration style
                        if (location.endsWith("action")) {
                            addTempLink(action, location, Link.TYPE_REDIRECT, resultConfig.getName());
                        } else {
                            ViewNode view = new ViewNode(stripLocation(location));
                            subGraph.addNode(view);

                            addTempLink(action, location, Link.TYPE_REDIRECT, resultConfig.getName());

                            View viewFile = getView(namespace, actionName, resultName, location);
                            if (viewFile != null) {
View Full Code Here

Examples of org.apache.struts2.sitegraph.model.SubGraph

            if (!namespace.startsWith(ns)) {
                continue;
            }

            SubGraph subGraph = graph.create(namespace);

            Set actionNames = StrutsConfigRetriever.getActionNames(namespace);
            for (Iterator iterator = actionNames.iterator(); iterator.hasNext();) {
                String actionName = (String) iterator.next();
                ActionConfig actionConfig = StrutsConfigRetriever.getActionConfig(namespace,
                        actionName);

                ActionNode action = new ActionNode(actionName);
                subGraph.addNode(action);

                Set resultNames = actionConfig.getResults().keySet();
                for (Iterator iterator2 = resultNames.iterator(); iterator2.hasNext();) {
                    String resultName = (String) iterator2.next();
                    ResultConfig resultConfig = ((ResultConfig) actionConfig.getResults().get(resultName));
                    String resultClassName = resultConfig.getClassName();

                    if (resultClassName.equals(ActionChainResult.class.getName())) {

                    } else if (resultClassName.indexOf("Dispatcher") != -1
                            || resultClassName.indexOf("Velocity") != -1
                            || resultClassName.indexOf("Freemarker") != -1) {
                        if (resultConfig.getParams().get("location") == null) {
                            continue;
                        }

                        String location = getViewLocation((String) resultConfig.getParams().get("location"), namespace);
                        //  FIXME: work with new configuration style                       
                        if (location.endsWith("action")) {
                            addTempLink(action, location, Link.TYPE_RESULT, resultConfig.getName());
                        } else {
                            ViewNode view = new ViewNode(stripLocation(location));
                            subGraph.addNode(view);

                            addTempLink(action, location, Link.TYPE_RESULT, resultConfig.getName());

                            View viewFile = getView(namespace, actionName, resultName, location);
                            if (viewFile != null) {
                                viewMap.put(view, viewFile);
                            }
                        }
                    } else if (resultClassName.indexOf("Jasper") != -1) {

                    } else if (resultClassName.indexOf("XSLT") != -1) {

                    } else if (resultClassName.indexOf("Redirect") != -1) {
                        // check if the redirect is to an action -- if so, link it
                        String locationConfig = (String) resultConfig.getParams().get("location");
                        if (locationConfig == null) {
                            locationConfig = (String) resultConfig.getParams().get("actionName");
                        }
                        String location = getViewLocation(locationConfig, namespace);
                        //  FIXME: work with new configuration style
                        if (location.endsWith("action")) {
                            addTempLink(action, location, Link.TYPE_REDIRECT, resultConfig.getName());
                        } else {
                            ViewNode view = new ViewNode(stripLocation(location));
                            subGraph.addNode(view);

                            addTempLink(action, location, Link.TYPE_REDIRECT, resultConfig.getName());

                            View viewFile = getView(namespace, actionName, resultName, location);
                            if (viewFile != null) {
View Full Code Here

Examples of org.eclipse.draw2d.graph.Subgraph

   * @param parent
   *            If non-null, the parent subgraph.
   */
  @SuppressWarnings("unchecked")
  void addNodes(NodeList nodes) {
    subgraph = new Subgraph(this);
    subgraph.innerPadding = new Insets(0, 0, 0, 0);
    subgraph.insets = new Insets(20, 0, 0, 0);
    Figure figure = (Figure) getFigure();
    subgraph.setSize(figure.getPreferredSize());
    subgraph.setPadding(new Insets(2, 2, 2, 2));
View Full Code Here

Examples of org.eclipse.persistence.jaxb.Subgraph

    private void createSubgraphs(final org.eclipse.persistence.jaxb.ObjectGraph graph,
                                 final Class<?> entityClass, final Map<String, ObjectGraph> entitySubgraphs) {
        final Set<String> processed = Sets.newHashSet();

        for (final Map.Entry<String, ObjectGraph> entry : entitySubgraphs.entrySet()) {
            final Subgraph subgraph = graph.addSubgraph(entry.getKey());
            final ObjectGraph entityGraph = entry.getValue();

            final Set<String> fields = entityGraph.getFields(entry.getKey());
            if (!fields.isEmpty()) {
                subgraph.addAttributeNodes(fields.toArray(new String[fields.size()]));
            }

            final Map<String, ObjectGraph> subgraphs = entityGraph.getSubgraphs(entry.getKey());
            if (!subgraphs.isEmpty()) {
                final Class<?> subEntityClass = entityGraph.getEntityClass();
View Full Code Here

Examples of org.eclipse.persistence.jaxb.Subgraph

    }

    private void createSubgraphs(final String parent, final Subgraph graph, final Class<?> entityClass,
                                 final Map<String, ObjectGraph> entitySubgraphs, final Set<String> processed) {
        for (final Map.Entry<String, ObjectGraph> entry : entitySubgraphs.entrySet()) {
            final Subgraph subgraph = graph.addSubgraph(entry.getKey());
            final ObjectGraph entityGraph = entry.getValue();
           
            String path = parent + "." + entry.getKey();

            final Set<String> fields = entityGraph.getFields(path);
            if (!fields.isEmpty()) {
                subgraph.addAttributeNodes(fields.toArray(new String[fields.size()]));
            }

            final Map<String, ObjectGraph> subgraphs = entityGraph.getSubgraphs();
            final Class<?> subEntityClass = entityGraph.getEntityClass();
            final String processedSubgraph = getProcessedSubgraph(entityClass, entry.getKey(), subEntityClass);
View Full Code Here

Examples of org.jboss.dna.graph.Subgraph

        // File expectedFile = new File("src/test/resources/");
        // if ( expectedFile.exists() ) {
        // expectedGraph.importXmlFrom(expectedFile).into("/");   
       
        Subgraph subgraph = graph.getSubgraphOfDepth(10).at("/");
        assertThat(subgraph, is(notNullValue()));
        //String value = subgraph.toString();
        //System.out.println(value);
       
        SubgraphNode rootNode = subgraph.getNode(".");
        assertThat(rootNode.getChildren().size(), is(1));
       
        SubgraphNode statementsNode = rootNode.getNode(path("ddl:statements"));
        assertNotNull(statementsNode);
        assertThat(statementsNode.getChildren().size(), is(1));
View Full Code Here

Examples of org.jboss.dna.graph.Subgraph

        assertThat(content, is(notNullValue()));
        sequencer.sequence(content, output, context);
       
        output.close();

        Subgraph subgraph = graph.getSubgraphOfDepth(10).at("/");
        assertThat(subgraph, is(notNullValue()));
        //String value = subgraph.toString();
        //System.out.println(value);
       
        SubgraphNode rootNode = subgraph.getNode(".");
        assertThat(rootNode.getChildren().size(), is(1));
       
        SubgraphNode statementsNode = rootNode.getNode(path("ddl:statements"));
        assertNotNull(statementsNode);
        assertThat(statementsNode.getChildren().size(), is(1));
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.