Package org.gephi.layout.plugin.forceAtlas

Examples of org.gephi.layout.plugin.forceAtlas.ForceAtlasLayout


                @Override
                public void actionPerformed(ActionEvent e) {
                    if (checkBox.isSelected()) {
                        //Run the ForceAtlas layout
                        //The layout doesn't stop by itself
                        ForceAtlasLayout layout = Lookup.getDefault().lookup(ForceAtlas.class).buildLayout();
                        layout.resetPropertiesValues();
                        layout.setAdjustSizes(true);
                        LayoutController layoutController = Lookup.getDefault().lookup(LayoutController.class);
                        layoutController.setLayout(layout);
                        layoutController.executeLayout();
                    } else {
                        //Stop layout
View Full Code Here


        model.getUniEdgeSupervisor().setArrowSize(15f);
        model.getUniEdgeSupervisor().setArrowAddedRadius(15f);
        model.getUniEdgeSupervisor().setColorizer((EdgeColorizer) colorizerFactory.createCustomColorMode(Color.BLACK));
        model.getNodeSupervisor().setBaseNodeLabelFont(model.getNodeSupervisor().getBaseNodeLabelFont().deriveFont(12));
        //set the layout of the graph
        ForceAtlasLayout layout = new ForceAtlasLayout(null);
        layout.setGraphModel(graphModel);
        layout.resetPropertiesValues();
        layout.setRepulsionStrength(60000.0);//for repulsion between nodes
        layout.setAttractionStrength(10.0);
        layout.setMaxDisplacement(10.0);
        layout.setGravity(3.0);
        layout.setAdjustSizes(Boolean.TRUE);
        layout.inertia = 0.1;
        layout.setSpeed(1.0);//layout.setConverged(Boolean.TRUE);
        layout.setFreezeStrength(80.0);
        layout.setFreezeInertia(0.2);
        layout.setOutboundAttractionDistribution(Boolean.TRUE);//incoming links tend to be at centre
        for (int i = 0; i < 100 && layout.canAlgo(); i++) {
            layout.goAlgo();

        }
        //export the graph
        ExportController ec = Lookup.getDefault().lookup(ExportController.class);
        PDFExporter exporter = (PDFExporter) ec.getExporter("pdf");
View Full Code Here

        model.getUniEdgeSupervisor().setCurvedFlag(false);
        model.getUniEdgeSupervisor().setArrowSize(15f);
        model.getUniEdgeSupervisor().setArrowAddedRadius(15f);
        model.getUniEdgeSupervisor().setColorizer((EdgeColorizer) colorizerFactory.createCustomColorMode(Color.BLACK));
        model.getNodeSupervisor().setBaseNodeLabelFont(model.getNodeSupervisor().getBaseNodeLabelFont().deriveFont(12));
        ForceAtlasLayout layout = new ForceAtlasLayout(null);
        layout.setGraphModel(graphModel);
        layout.resetPropertiesValues();
        layout.setRepulsionStrength(60000.0);
        layout.setAttractionStrength(10.0);
        layout.setMaxDisplacement(10.0);
        layout.setGravity(3.0);
        layout.setAdjustSizes(Boolean.TRUE);
        layout.inertia = 0.1;
        layout.setSpeed(1.0);//layout.setConverged(Boolean.TRUE);
        layout.setFreezeStrength(80.0);
        layout.setFreezeInertia(0.2);
        layout.setOutboundAttractionDistribution(Boolean.TRUE);
       
        for (int j = 0; j < 80 && layout.canAlgo(); j++) {
            layout.goAlgo();
        }
      

        System.out.println(H.getNodeCount() + " " + H.getEdgeCount());
        ExportController ec = Lookup.getDefault().lookup(ExportController.class);
View Full Code Here

TOP

Related Classes of org.gephi.layout.plugin.forceAtlas.ForceAtlasLayout

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.