Search in sources :

Example 1 with Configuration

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;
}
Also used : Configuration(org.gephi.graph.api.Configuration) GraphModel(org.gephi.graph.api.GraphModel)

Example 2 with Configuration

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;
}
Also used : Configuration(org.gephi.graph.api.Configuration) GraphModel(org.gephi.graph.api.GraphModel)

Example 3 with Configuration

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);
}
Also used : ColumnDraft(org.gephi.io.importer.api.ColumnDraft) Configuration(org.gephi.graph.api.Configuration) GraphController(org.gephi.graph.api.GraphController)

Aggregations

Configuration (org.gephi.graph.api.Configuration)3 GraphModel (org.gephi.graph.api.GraphModel)2 GraphController (org.gephi.graph.api.GraphController)1 ColumnDraft (org.gephi.io.importer.api.ColumnDraft)1