Search in sources :

Example 11 with GraphElementsController

use of org.gephi.datalab.api.GraphElementsController in project gephi by gephi.

the class MergeNodeDuplicates method execute.

@Override
public void execute() {
    Graph graph = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph();
    GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
    for (List<Node> nodes : duplicateGroups) {
        gec.mergeNodes(graph, nodes.toArray(new Node[0]), nodes.get(0), columns, mergeStrategies, deleteMergedNodes);
    }
    NbPreferences.forModule(MergeNodeDuplicates.class).putBoolean(DELETE_MERGED_NODES_SAVED_PREFERENCES, deleteMergedNodes);
    NbPreferences.forModule(MergeNodeDuplicates.class).putBoolean(CASE_SENSITIVE_SAVED_PREFERENCES, caseSensitive);
}
Also used : Graph(org.gephi.graph.api.Graph) GraphElementsController(org.gephi.datalab.api.GraphElementsController) Node(org.gephi.graph.api.Node)

Example 12 with GraphElementsController

use of org.gephi.datalab.api.GraphElementsController in project gephi by gephi.

the class LinkNodes method execute.

@Override
public void execute() {
    if (nodes.length > 1) {
        GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
        gec.createEdges(sourceNode, nodes, directed);
    } else {
        AddEdgeToGraph manipulator = new AddEdgeToGraph();
        manipulator.setSource(sourceNode);
        DataLaboratoryHelper.getDefault().executeManipulator(manipulator);
    }
}
Also used : GraphElementsController(org.gephi.datalab.api.GraphElementsController) AddEdgeToGraph(org.gephi.datalab.plugin.manipulators.general.AddEdgeToGraph)

Example 13 with GraphElementsController

use of org.gephi.datalab.api.GraphElementsController in project gephi by gephi.

the class Settle method execute.

@Override
public void execute() {
    GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
    gec.setNodesFixed(nodes, true);
    Lookup.getDefault().lookup(DataTablesController.class).refreshCurrentTable();
}
Also used : GraphElementsController(org.gephi.datalab.api.GraphElementsController) DataTablesController(org.gephi.datalab.api.datatables.DataTablesController)

Example 14 with GraphElementsController

use of org.gephi.datalab.api.GraphElementsController in project gephi by gephi.

the class Delete method execute.

@Override
public void execute() {
    NotifyDescriptor.Confirmation notifyDescriptor = new NotifyDescriptor.Confirmation(NbBundle.getMessage(Delete.class, "GraphContextMenu.Delete.message"), NbBundle.getMessage(Delete.class, "GraphContextMenu.Delete.message.title"), NotifyDescriptor.YES_NO_OPTION);
    if (DialogDisplayer.getDefault().notify(notifyDescriptor).equals(NotifyDescriptor.YES_OPTION)) {
        GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
        gec.deleteNodes(nodes);
    }
}
Also used : NotifyDescriptor(org.openide.NotifyDescriptor) GraphElementsController(org.gephi.datalab.api.GraphElementsController)

Example 15 with GraphElementsController

use of org.gephi.datalab.api.GraphElementsController in project gephi by gephi.

the class Free method execute.

@Override
public void execute() {
    GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
    gec.setNodesFixed(nodes, false);
}
Also used : GraphElementsController(org.gephi.datalab.api.GraphElementsController)

Aggregations

GraphElementsController (org.gephi.datalab.api.GraphElementsController)16 Node (org.gephi.graph.api.Node)5 Column (org.gephi.graph.api.Column)4 Table (org.gephi.graph.api.Table)4 DataTablesController (org.gephi.datalab.api.datatables.DataTablesController)3 Edge (org.gephi.graph.api.Edge)3 Graph (org.gephi.graph.api.Graph)3 CsvReader (com.csvreader.CsvReader)2 FileInputStream (java.io.FileInputStream)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 SearchResult (org.gephi.datalab.api.SearchReplaceController.SearchResult)2 TimeFormat (org.gephi.graph.api.TimeFormat)2 DateTimeZone (org.joda.time.DateTimeZone)2 ArrayList (java.util.ArrayList)1 AddEdgeToGraph (org.gephi.datalab.plugin.manipulators.general.AddEdgeToGraph)1 NotifyDescriptor (org.openide.NotifyDescriptor)1