use of org.gephi.graph.api.Table in project gephi by gephi.
the class SearchReplaceUI method createSearchOptions.
private void createSearchOptions() {
boolean onlyVisibleElements = Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible();
searchResult = null;
columnsToSearchComboBox.removeAllItems();
Table table;
if (mode == Mode.NODES_TABLE) {
Node[] nodes;
if (onlyVisibleElements) {
//Search on visible nodes:
nodes = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible().getNodes().toArray();
} else {
//Search on all nodes
nodes = new Node[0];
}
searchOptions = new SearchOptions(nodes, null);
table = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getNodeTable();
} else {
Edge[] edges;
if (onlyVisibleElements) {
//Search on visible edges:
edges = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible().getEdges().toArray();
} else {
//Search on all edges
edges = new Edge[0];
}
searchOptions = new SearchOptions(edges, null);
table = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getEdgeTable();
}
//Fill possible columns to search (first value is all columns):
columnsToSearchComboBox.addItem(NbBundle.getMessage(SearchReplaceUI.class, "SearchReplaceUI.allColumns"));
for (Column c : table) {
columnsToSearchComboBox.addItem(new ColumnWrapper(c));
}
}
use of org.gephi.graph.api.Table in project gephi by gephi.
the class ConnectedComponents method initializeWeeklyConnectedColumn.
private Column initializeWeeklyConnectedColumn(GraphModel graphModel) {
Table nodeTable = graphModel.getNodeTable();
Column componentCol = nodeTable.getColumn(WEAKLY);
if (componentCol == null) {
componentCol = nodeTable.addColumn(WEAKLY, "Component ID", Integer.class, new Integer(0));
}
return componentCol;
}
use of org.gephi.graph.api.Table in project gephi by gephi.
the class PageRank method initializeAttributeColunms.
private Column initializeAttributeColunms(GraphModel graphModel) {
Table nodeTable = graphModel.getNodeTable();
Column pagerankCol = nodeTable.getColumn(PAGERANK);
if (pagerankCol == null) {
pagerankCol = nodeTable.addColumn(PAGERANK, "PageRank", Double.class, new Double(0));
}
return pagerankCol;
}
Aggregations