use of org.gephi.desktop.filters.query.QueryNode in project gephi by gephi.
the class CategoryNode method getDropType.
@Override
public PasteType getDropType(final Transferable t, int action, int index) {
if (category == null || !category.equals(FiltersExplorer.QUERIES)) {
return null;
}
final Node dropNode = NodeTransfer.node(t, DnDConstants.ACTION_COPY_OR_MOVE);
if (dropNode != null && dropNode instanceof QueryNode) {
return new PasteType() {
@Override
public Transferable paste() throws IOException {
QueryNode queryNode = (QueryNode) dropNode;
FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
FilterLibrary library = filterController.getModel().getLibrary();
library.saveQuery(queryNode.getQuery());
return null;
}
};
}
return null;
}
Aggregations