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);
}
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);
}
}
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();
}
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);
}
}
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);
}
Aggregations