Examples of Graph


Examples of org.boris.expr.graph.Graph

import org.boris.expr.graph.Graph;

public class GraphTest extends TH
{
    public void testCheckCycle() throws Exception {
        Graph g = new Graph();
        g.add(new Edge("a", "b"));
        g.add(new Edge("a", "c"));
        g.add(new Edge("b", "d"));
        g.add(new Edge("c", "d"));
    }
View Full Code Here

Examples of org.cx4a.rsense.typing.Graph

    private void prepare(Project project) {
        context.project = project;
        context.typeSet = new TypeSet();
        context.main = true;

        Graph graph = project.getGraph();
        graph.addSpecialMethod(TYPE_INFERENCE_METHOD_NAME, typeInferenceMethod);
        graph.addSpecialMethod("require", requireMethod);
        graph.addSpecialMethod("require_next", requireNextMethod);
        graph.setNodeDiff(new NodeDiffForTypeInference());

        require(project, "_builtin", "UTF-8");
    }
View Full Code Here

Examples of org.drools.beliefs.graph.Graph

        assertEquals( bitSet("11110"), vt1.getCliqueBitSit());
    }

    @Test
    public void testEliminationCandidate2() {
        Graph graph = new BayesNetwork();
        GraphNode x0 = addNode(graph);
        GraphNode x1 = addNode(graph);
        GraphNode x2 = addNode(graph);
        GraphNode x3 = addNode(graph);
        GraphNode x4 = addNode(graph);
View Full Code Here

Examples of org.eclipse.zest.core.widgets.Graph

        viewer.getGraphControl().addControlListener(new ControlAdapter()
        {
            @Override
            public void controlResized(ControlEvent e)
            {
                Graph g = (Graph) e.getSource();
                int x = g.getSize().x;
                int y = g.getSize().y;
                if (lastX != x || lastY != y)
                {
                    lastX = x;
                    lastY = y;
                    redraw();
View Full Code Here

Examples of org.enhydra.jawe.components.graph.Graph

                jaweController.openPackageFromStream(xpdl.getBytes("UTF-8"));
                org.enhydra.shark.xpdl.elements.Package pkg = xpdlHandler.getPackageById(packageId);
                org.enhydra.shark.xpdl.elements.WorkflowProcess wp = pkg.getWorkflowProcess(processDefId);
                GraphController gc = (GraphController) jaweManager.getComponentManager().getComponent("GraphComponent");
                gc.selectGraphForElement(wp);
                Graph graph = gc.getGraph(wp);

                // highlight running activities
                if (runningActivityIds != null && runningActivityIds.length > 0) {
                    graph.clearSelection();
                    try {
                        for (int i = 0; i < runningActivityIds.length; i++) {
                            try {
                                GraphManager wm = graph.getGraphManager();
                                Object go = wm.getGraphActivity(runningActivityIds[i]);
                                if (go != null) {
                                    graph.addSelectionCell(go);
                                }
                            } catch (Exception ex) {
                                LogFactory.getLog(Viewer.class.getName()).error(ex);
                            }
                        }
                    } catch (Exception ex) {
                        LogFactory.getLog(Viewer.class.getName()).error("Problems while updating selection", ex);
                    }
                }

                // generate image
                BufferedImage img = null;
                Object[] cells = graph.getRoots();

                if (cells.length > 0) {
                    graph.setSize(graph.getPreferredSize());
                    Rectangle bounds = graph.getCellBounds(cells).getBounds();// HM, JGraph3.4.1
                    graph.toScreen(bounds);

                    // Create a Buffered Image
                    Dimension d = bounds.getSize();
                    img = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_RGB);
                    Graphics2D graphics = img.createGraphics();
                    graph.paint(graphics);
                }

                LogFactory.getLog(Viewer.class.getName()).info("Completed generating process image");

                return img;
View Full Code Here

Examples of org.geotools.graph.structure.Graph

        FeatureCollection<SimpleFeatureType, SimpleFeature> features = source.getFeatures( filter );
       
        FeatureType schema = features.getSchema();
        Class<?> binding = schema.getGeometryDescriptor().getType().getBinding();
        Graph graph = null;
        if( MultiLineString.class.isAssignableFrom( binding )){
            graph = buildFromMultiLineString( features, new SubProgressMonitor(monitor, 90) );
        }       
        if( graph == null ){
            // prompt or otherwise anny user?  
View Full Code Here

Examples of org.gephi.graph.api.Graph

                nodeDynamicColumns.add(col);
            }
        }
        AttributeColumn[] dynamicCols = nodeDynamicColumns.toArray(new AttributeColumn[0]);
        if (dynamicCols.length > 0) {
            Graph graph = graphModel.getGraph();
            for (Node n : graph.getNodes()) {
                Attributes attributeRow = n.getNodeData().getAttributes();
                for (int i = 0; i < dynamicCols.length; i++) {
                    DynamicType<?> ti = (DynamicType) attributeRow.getValue(dynamicCols[i].getIndex());
                    if (ti != null) {
                        for (Interval interval : ti.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)) {
                            timeIntervalIndex.add(interval);
                        }
                    }
                }
            }
        }
        for (AttributeColumn col : attributeModel.getNodeTable().getColumns()) {
            if (col.getType().isDynamicType()) {
                edgeDynamicColumns.add(col);
            }
        }
        dynamicCols = nodeDynamicColumns.toArray(new AttributeColumn[0]);
        if (dynamicCols.length > 0) {
            Graph graph = graphModel.getGraph();
            for (Edge e : graph.getEdges()) {
                Attributes attributeRow = e.getEdgeData().getAttributes();
                for (int i = 0; i < dynamicCols.length; i++) {
                    DynamicType<?> ti = (DynamicType) attributeRow.getValue(dynamicCols[i].getIndex());
                    if (ti != null) {
                        for (Interval interval : ti.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)) {
View Full Code Here

Examples of org.gephi.graph.api.Graph

    }

    private void filter(AbstractQueryImpl query) {
        FilterProcessor processor = new FilterProcessor();
        GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
        Graph result = processor.process((AbstractQueryImpl) query, graphModel);
//        System.out.println("#Nodes: " + result.getNodeCount());
//        System.out.println("#Edges: " + result.getEdgeCount());
        if (running) {
            GraphView view = result.getView();
            graphModel.setVisibleView(view);
            if (model.getCurrentResult() != null) {
                graphModel.destroyView(model.getCurrentResult());
            }
            model.setCurrentResult(view);
        } else {
            //destroy view
            graphModel.destroyView(result.getView());
        }
    }
View Full Code Here

Examples of org.gephi.graph.api.Graph

        Progress.setDisplayName(progressTicket, "MCL Clustering");

        HashMap<Integer, Node> nodeMap = new HashMap<Integer, Node>();
        HashMap<Node, Integer> intMap = new HashMap<Node, Integer>();

        Graph graph = graphModel.getGraphVisible();
        graph.readLock();

        //Load matrix
        SparseMatrix matrix = new SparseMatrix();
        int nodeId = 0;
        for (Edge e : graph.getEdges()) {
            Node source = e.getSource();
            Node target = e.getTarget();
            Integer sourceId;
            Integer targetId;
            if ((sourceId = intMap.get(source)) == null) {
                sourceId = nodeId++;
                intMap.put(source, sourceId);
                nodeMap.put(sourceId, source);
            }
            if ((targetId = intMap.get(target)) == null) {
                targetId = nodeId++;
                intMap.put(target, targetId);
                nodeMap.put(targetId, target);
            }
            double weight = e.getWeight();
            matrix.add(sourceId, targetId, weight);

            if (cancelled) {
                graph.readUnlockAll();
                return;
            }
        }

        graph.readUnlock();

        matrix = matrix.transpose();
        matrix = run(matrix, maxResidual, gammaExp, loopGain, zeroMax);

        if (cancelled) {
View Full Code Here

Examples of org.gephi.graph.api.Graph

        if (filter instanceof Operator) {
            return new OperatorQueryImpl((Operator) filter);
        }
        //Init filter
        if (filter instanceof NodeFilter || filter instanceof EdgeFilter) {
            Graph graph = null;
            if (model != null && model.getGraphModel() != null) {
                graph = model.getGraphModel().getGraph();
            } else {
                GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
                graph = graphModel.getGraph();
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.