use of org.gephi.appearance.api.AppearanceModel in project gephi by gephi.
the class InterEdgesBuilder 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) {
InterEdgesFilterBuilder builder = new InterEdgesFilterBuilder(nodeCol, am);
builders.add(builder);
}
}
}
return builders.toArray(new FilterBuilder[0]);
}
use of org.gephi.appearance.api.AppearanceModel in project gephi by gephi.
the class PartitionCountBuilder 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) {
PartitionCountFilterBuilder builder = new PartitionCountFilterBuilder(nodeCol, am);
builders.add(builder);
}
}
}
for (Column edgeCol : gm.getEdgeTable()) {
if (!edgeCol.isProperty()) {
if (am.getEdgePartition(graph, edgeCol) != null) {
PartitionCountFilterBuilder builder = new PartitionCountFilterBuilder(edgeCol, am);
builders.add(builder);
}
}
}
return builders.toArray(new FilterBuilder[0]);
}
use of org.gephi.appearance.api.AppearanceModel 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]);
}
use of org.gephi.appearance.api.AppearanceModel 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]);
}
use of org.gephi.appearance.api.AppearanceModel in project gephi by gephi.
the class AppearanceUIController method getModel.
public AppearanceUIModel getModel(Workspace workspace) {
AppearanceUIModel m = workspace.getLookup().lookup(AppearanceUIModel.class);
if (m == null) {
AppearanceController ac = Lookup.getDefault().lookup(AppearanceController.class);
AppearanceModel appearanceModel = ac.getModel(workspace);
m = new AppearanceUIModel(this, appearanceModel);
workspace.add(m);
}
return m;
}
Aggregations