Search in sources :

Example 11 with FilterBuilder

use of org.gephi.filters.spi.FilterBuilder in project gephi by gephi.

the class IntraEdgesBuilder method getBuilders.

@Override
public FilterBuilder[] getBuilders(Workspace workspace) {
    List<FilterBuilder> builders = new ArrayList<>();
    GraphModel gm = Lookup.getDefault().lookup(GraphController.class).getGraphModel(workspace);
    Graph graph = gm.getGraph();
    AppearanceModel am = Lookup.getDefault().lookup(AppearanceController.class).getModel(workspace);
    //Force refresh
    am.getNodeFunctions(graph);
    for (Column nodeCol : gm.getNodeTable()) {
        if (!nodeCol.isProperty()) {
            if (am.getNodePartition(graph, nodeCol) != null) {
                IntraEdgesFilterBuilder builder = new IntraEdgesFilterBuilder(nodeCol, am);
                builders.add(builder);
            }
        }
    }
    return builders.toArray(new FilterBuilder[0]);
}
Also used : Graph(org.gephi.graph.api.Graph) AppearanceModel(org.gephi.appearance.api.AppearanceModel) Column(org.gephi.graph.api.Column) FilterBuilder(org.gephi.filters.spi.FilterBuilder) GraphModel(org.gephi.graph.api.GraphModel) ArrayList(java.util.ArrayList) AppearanceController(org.gephi.appearance.api.AppearanceController) GraphController(org.gephi.graph.api.GraphController)

Example 12 with FilterBuilder

use of org.gephi.filters.spi.FilterBuilder in project gephi by gephi.

the class PartitionBuilder method getBuilders.

@Override
public FilterBuilder[] getBuilders(Workspace workspace) {
    List<FilterBuilder> builders = new ArrayList<>();
    GraphModel gm = Lookup.getDefault().lookup(GraphController.class).getGraphModel(workspace);
    Graph graph = gm.getGraph();
    AppearanceModel am = Lookup.getDefault().lookup(AppearanceController.class).getModel(workspace);
    //Force refresh
    am.getNodeFunctions(graph);
    for (Column nodeCol : gm.getNodeTable()) {
        if (!nodeCol.isProperty()) {
            if (am.getNodePartition(graph, nodeCol) != null) {
                PartitionFilterBuilder builder = new PartitionFilterBuilder(nodeCol, am);
                builders.add(builder);
            }
        }
    }
    for (Column edgeCol : gm.getEdgeTable()) {
        if (!edgeCol.isProperty()) {
            if (am.getEdgePartition(graph, edgeCol) != null) {
                PartitionFilterBuilder builder = new PartitionFilterBuilder(edgeCol, am);
                builders.add(builder);
            }
        }
    }
    return builders.toArray(new FilterBuilder[0]);
}
Also used : Graph(org.gephi.graph.api.Graph) AppearanceModel(org.gephi.appearance.api.AppearanceModel) Column(org.gephi.graph.api.Column) FilterBuilder(org.gephi.filters.spi.FilterBuilder) GraphModel(org.gephi.graph.api.GraphModel) ArrayList(java.util.ArrayList) AppearanceController(org.gephi.appearance.api.AppearanceController) GraphController(org.gephi.graph.api.GraphController)

Example 13 with FilterBuilder

use of org.gephi.filters.spi.FilterBuilder in project gephi by gephi.

the class AttributeNonNullBuilder method getBuilders.

@Override
public FilterBuilder[] getBuilders(Workspace workspace) {
    List<FilterBuilder> builders = new ArrayList<>();
    GraphModel am = Lookup.getDefault().lookup(GraphController.class).getGraphModel(workspace);
    for (Column col : am.getNodeTable()) {
        if (!col.isProperty()) {
            AttributeNonNullFilterBuilder b = new AttributeNonNullFilterBuilder(col);
            builders.add(b);
        }
    }
    for (Column col : am.getEdgeTable()) {
        if (!col.isProperty()) {
            AttributeNonNullFilterBuilder b = new AttributeNonNullFilterBuilder(col);
            builders.add(b);
        }
    }
    return builders.toArray(new FilterBuilder[0]);
}
Also used : Column(org.gephi.graph.api.Column) FilterBuilder(org.gephi.filters.spi.FilterBuilder) AbstractAttributeFilterBuilder(org.gephi.filters.plugin.AbstractAttributeFilterBuilder) GraphModel(org.gephi.graph.api.GraphModel) ArrayList(java.util.ArrayList) GraphController(org.gephi.graph.api.GraphController)

Aggregations

FilterBuilder (org.gephi.filters.spi.FilterBuilder)13 ArrayList (java.util.ArrayList)6 Query (org.gephi.filters.api.Query)6 GraphController (org.gephi.graph.api.GraphController)6 GraphModel (org.gephi.graph.api.GraphModel)6 Column (org.gephi.graph.api.Column)5 AppearanceController (org.gephi.appearance.api.AppearanceController)3 AppearanceModel (org.gephi.appearance.api.AppearanceModel)3 FilterController (org.gephi.filters.api.FilterController)3 Graph (org.gephi.graph.api.Graph)3 Transferable (java.awt.datatransfer.Transferable)2 UnsupportedFlavorException (java.awt.datatransfer.UnsupportedFlavorException)2 IOException (java.io.IOException)2 FilterBuilderNode (org.gephi.desktop.filters.library.FilterBuilderNode)2 Filter (org.gephi.filters.spi.Filter)2 AbstractNode (org.openide.nodes.AbstractNode)2 Node (org.openide.nodes.Node)2 PasteType (org.openide.util.datatransfer.PasteType)2 Comparator (java.util.Comparator)1 SavedQueryNode (org.gephi.desktop.filters.library.SavedQueryNode)1