use of org.gephi.graph.api.Configuration in project gephi by gephi.
the class GraphControllerImpl method newGraphModel.
private GraphModel newGraphModel(Workspace workspace) {
Configuration config = new Configuration();
config.setTimeRepresentation(TimeRepresentation.INTERVAL);
GraphModel graphModelImpl = GraphModel.Factory.newInstance(config);
workspace.add(graphModelImpl);
return graphModelImpl;
}
use of org.gephi.graph.api.Configuration in project gephi by gephi.
the class LegacyMapHelper method getGraphModel.
protected static GraphModel getGraphModel(Workspace workspace) {
GraphModel gm = workspace.getLookup().lookup(GraphModel.class);
if (gm == null) {
Configuration configuration = new Configuration();
configuration.setTimeRepresentation(TimeRepresentation.INTERVAL);
gm = GraphModel.Factory.newInstance(configuration);
workspace.add(gm);
}
return gm;
}
use of org.gephi.graph.api.Configuration in project gephi by gephi.
the class DefaultProcessor method processConfiguration.
protected void processConfiguration(ContainerUnloader container, Workspace workspace) {
//Configuration
GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
Configuration configuration = new Configuration();
configuration.setTimeRepresentation(container.getTimeRepresentation());
if (container.getEdgeTypeLabelClass() != null) {
configuration.setEdgeLabelType(container.getEdgeTypeLabelClass());
}
configuration.setNodeIdType(container.getElementIdType().getTypeClass());
configuration.setEdgeIdType(container.getElementIdType().getTypeClass());
ColumnDraft weightColumn = container.getEdgeColumn("weight");
if (weightColumn != null && weightColumn.isDynamic()) {
if (container.getTimeRepresentation().equals(TimeRepresentation.INTERVAL)) {
configuration.setEdgeWeightType(IntervalDoubleMap.class);
} else {
configuration.setEdgeWeightType(TimestampDoubleMap.class);
}
}
graphController.getGraphModel(workspace).setConfiguration(configuration);
}
Aggregations