use of org.gephi.graph.api.Table in project gephi by gephi.
the class DynamicDegree method execute.
@Override
public void execute(GraphModel graphModel) {
this.graphModel = graphModel;
this.isDirected = graphModel.isDirected();
this.averages = new HashMap<>();
//Attributes cols
if (!averageOnly) {
TimeRepresentation tr = graphModel.getConfiguration().getTimeRepresentation();
Table nodeTable = graphModel.getNodeTable();
dynamicInDegreeColumn = nodeTable.getColumn(DYNAMIC_INDEGREE);
dynamicOutDegreeColumn = nodeTable.getColumn(DYNAMIC_OUTDEGREE);
dynamicDegreeColumn = nodeTable.getColumn(DYNAMIC_DEGREE);
if (isDirected) {
if (dynamicInDegreeColumn == null) {
dynamicInDegreeColumn = nodeTable.addColumn(DYNAMIC_INDEGREE, NbBundle.getMessage(DynamicDegree.class, "DynamicDegree.nodecolumn.InDegree"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalIntegerMap.class : TimestampIntegerMap.class, null);
}
if (dynamicOutDegreeColumn == null) {
dynamicOutDegreeColumn = nodeTable.addColumn(DYNAMIC_OUTDEGREE, NbBundle.getMessage(DynamicDegree.class, "DynamicDegree.nodecolumn.OutDegree"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalIntegerMap.class : TimestampIntegerMap.class, null);
}
}
if (dynamicDegreeColumn == null) {
dynamicDegreeColumn = nodeTable.addColumn(DYNAMIC_DEGREE, NbBundle.getMessage(DynamicDegree.class, "DynamicDegree.nodecolumn.Degree"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalIntegerMap.class : TimestampIntegerMap.class, null);
}
}
}
use of org.gephi.graph.api.Table in project gephi by gephi.
the class ConnectedComponents method initializeStronglyConnectedColumn.
private Column initializeStronglyConnectedColumn(GraphModel graphModel) {
Table nodeTable = graphModel.getNodeTable();
Column componentCol = nodeTable.getColumn(STRONG);
if (componentCol == null) {
componentCol = nodeTable.addColumn(STRONG, "Strongly-Connected ID", Integer.class, new Integer(0));
}
return componentCol;
}
use of org.gephi.graph.api.Table in project gephi by gephi.
the class EigenvectorCentrality method initializeAttributeColunms.
private Column initializeAttributeColunms(GraphModel graphModel) {
Table nodeTable = graphModel.getNodeTable();
Column eigenCol = nodeTable.getColumn(EIGENVECTOR);
if (eigenCol == null) {
eigenCol = nodeTable.addColumn(EIGENVECTOR, "Eigenvector Centrality", Double.class, new Double(0));
}
return eigenCol;
}
use of org.gephi.graph.api.Table in project gephi by gephi.
the class DataTableTopComponent method availableColumnsButtonActionPerformed.
//GEN-LAST:event_configurationButtonActionPerformed
private void availableColumnsButtonActionPerformed(java.awt.event.ActionEvent evt) {
//GEN-FIRST:event_availableColumnsButtonActionPerformed
Table table;
AvailableColumnsModel availableColumnsModel;
if (isShowingNodesTable()) {
table = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getNodeTable();
} else {
table = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getEdgeTable();
}
availableColumnsModel = getTableAvailableColumnsModel(table);
DialogDescriptor dd = new DialogDescriptor(new AvailableColumnsPanel(table, availableColumnsModel).getValidationPanel(), NbBundle.getMessage(DataTableTopComponent.class, "AvailableColumnsPanel.title"));
dd.setOptions(new Object[] { DialogDescriptor.OK_OPTION });
DialogDisplayer.getDefault().notify(dd);
refreshAllOnce();
}
use of org.gephi.graph.api.Table in project gephi by gephi.
the class MergeNodes method setup.
@Override
public void setup(Node[] nodes, Node clickedNode) {
this.nodes = nodes;
selectedNode = clickedNode != null ? clickedNode : nodes[0];
Table nodeTable = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getNodeTable();
List<Column> columnsList = new ArrayList<>();
for (Column column : nodeTable) {
if (!column.isReadOnly()) {
columnsList.add(column);
}
}
columns = columnsList.toArray(new Column[0]);
mergeStrategies = new AttributeRowsMergeStrategy[columns.length];
deleteMergedNodes = NbPreferences.forModule(MergeNodes.class).getBoolean(DELETE_MERGED_NODES_SAVED_PREFERENCES, true);
}
Aggregations