}
}
}
public void exportToColumn(String title, Query query) {
HierarchicalGraph result;
if (model.getCurrentQuery() == query) {
GraphView view = model.getCurrentResult();
if (view != null) {
return;
}
result = model.getGraphModel().getHierarchicalGraph(view);
} else {
FilterProcessor processor = new FilterProcessor();
GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
result = (HierarchicalGraph) processor.process((AbstractQueryImpl) query, graphModel);
}
AttributeModel am = Lookup.getDefault().lookup(AttributeController.class).getModel();
AttributeColumn nodeCol = am.getNodeTable().getColumn("filter_" + title);
if (nodeCol == null) {
nodeCol = am.getNodeTable().addColumn("filter_" + title, title, AttributeType.BOOLEAN, AttributeOrigin.COMPUTED, Boolean.FALSE);
}
AttributeColumn edgeCol = am.getEdgeTable().getColumn("filter_" + title);
if (edgeCol == null) {
edgeCol = am.getEdgeTable().addColumn("filter_" + title, title, AttributeType.BOOLEAN, AttributeOrigin.COMPUTED, Boolean.FALSE);
}
result.readLock();
for (Node n : result.getNodes()) {
n.getNodeData().getAttributes().setValue(nodeCol.getIndex(), Boolean.TRUE);
}
for (Edge e : result.getEdgesAndMetaEdges()) {
e.getEdgeData().getAttributes().setValue(edgeCol.getIndex(), Boolean.TRUE);
}
result.readUnlock();
//StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(FilterControllerImpl.class, "FilterController.exportToColumn.status", title));
}