Package org.gephi.graph.api

Examples of org.gephi.graph.api.GraphController


    public void setUp() {
        ProjectController pj = Lookup.getDefault().lookup(ProjectController.class);
        pj.newProject();
        AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
        ac.getModel();
        GraphController gc = Lookup.getDefault().lookup(GraphController.class);
        graphModel = gc.getModel();
        Graph graph = gc.getModel().getUndirectedGraph();
        rootGraph = graph;
    }
View Full Code Here


    private LinkedList<Node> hub_list;
    private LinkedList<Node> auth_list;
    private HashMap<Node, Integer> indicies;

    public Hits() {
        GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
        if (graphController != null && graphController.getModel() != null) {
            useUndirected = graphController.getModel().isUndirected();
        }
    }
View Full Code Here

    private double[] pageranks;
    /** */
    private boolean isDirected;

    public PageRank() {
        GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
        if (graphController != null && graphController.getModel() != null) {
            isDirected = graphController.getModel().isDirected();
        }
    }
View Full Code Here

    /** */
    private boolean isCanceled;
    private boolean isDirected;

    public EigenvectorCentrality() {
        GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
        if (graphController != null && graphController.getModel() != null) {
            isDirected = graphController.getModel().isDirected();
        }
    }
View Full Code Here

    public void testSerialization() {
        ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
        projectController.newProject();
        AttributeController attributeController = Lookup.getDefault().lookup(AttributeController.class);
        AttributeModel attributeModel = attributeController.getModel();
        GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
        GraphModel graphModel = graphController.getModel();

        StatisticsModelImpl model = new StatisticsModelImpl();

        ClusteringCoefficient clusteringCoefficient = new ClusteringCoefficient();
        ClusteringCoefficientUI clusteringCoefficientUI = new ClusteringCoefficientUI();
View Full Code Here

      return;
    }

    importController.process(container, new DefaultProcessor(), projectController.getCurrentWorkspace());

    GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
    graphModel = graphController.getModel();
  }
View Full Code Here

    private final FindToolUI ui = new FindToolUI();
   
    @Override
    public void select() {
        //Get current visible graph
        GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
        Graph graph = graphController.getModel().getGraphVisible();
       
        //Build the autocomplete data. A simple map from node's label
        graph.readLock();
        data = new HashMap<String, Node>();
        for (Node n : graph.getNodes()) {
View Full Code Here

                    new MouseClickEventListener() {

                        @Override
                        public void mouseClick(int[] positionViewport, float[] position3d) {
                            //Get current graph
                            GraphController gc = Lookup.getDefault().lookup(GraphController.class);
                            Graph graph = gc.getModel().getGraph();
                            GraphFactory factory = gc.getModel().factory();

                            //Add node
                            Node node = factory.newNode();
                            node.getNodeData().setX(position3d[0]);
                            node.getNodeData().setY(position3d[1]);
                            node.getNodeData().setSize(10f);
                            graph.addNode(node);
                        }
                    },
                    new NodeClickEventListener() {

                        @Override
                        public void clickNodes(Node[] nodes) {
                            //Get mouse position
                            float[] position3d = VizController.getInstance().getGraphIO().getMousePosition3d();

                            //Get current graph
                            GraphController gc = Lookup.getDefault().lookup(GraphController.class);
                            Graph graph = gc.getModel().getGraph();
                            GraphFactory factory = gc.getModel().factory();

                            //Add node
                            Node node = factory.newNode();
                            node.getNodeData().setX(position3d[0]);
                            node.getNodeData().setY(position3d[1]);
View Full Code Here

                statement.executeUpdate("drop table if exists edges");
                statement.executeUpdate("create table nodes (id string, label string)");
                statement.executeUpdate("create table edges (source string, target string, weight real)");

                //Get the current graph in the defined workspace
                GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
                GraphModel graphModel = graphController.getModel(workspace);
                Graph graph = graphModel.getGraphVisible();

                //Count the number of tasks (nodes + edges) and start the progress
                int tasks = graph.getNodeCount() + graph.getEdgeCount();
                Progress.start(progress, tasks);
View Full Code Here

public final class RemoveSelfLoopsAction implements ActionListener {

    @Override
    public void actionPerformed(ActionEvent e) {
        //Get the current graph model
        GraphController gc = Lookup.getDefault().lookup(GraphController.class);
        GraphModel graphModel = gc.getModel();
       
        if (graphModel != null) {
            //Remove self loops
            int removed = 0;
            Graph graph = graphModel.getGraph();
View Full Code Here

TOP

Related Classes of org.gephi.graph.api.GraphController

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.