+ public void setChunkSize(int chunkSize) {
+ this.chunkSize = chunkSize;
+ }
+
+ public void refreshUserFilters() throws DatabaseException{
+ // use user filters to set visible flags of changes.
+ // First, set all changes visible.
+ Deque<UpdateNode> stack = new ArrayDeque<>();
+ stack.push(updateTree.getRootNode());
+ while (!stack.isEmpty()) {
+ UpdateNode n = stack.pop();
+ n.setVisible(true);
+ stack.addAll(n.getChildren());
+ }
+ for (PropertyChange pc : updateList.getChanges()) {
+ pc.setVisible(true);
+ }
+ if (userFilters.size() > 0) {
+ if (changes2 != null && changes3 != null) {
+ getUpdateTree3();
+ }
+ getSession().syncRequest(new ReadRequest() {
+
+ @Override
+ public void run(ReadGraph graph) throws DatabaseException {
+ for (PropertyChange change : updateList.getChanges()) {
+ boolean visible = true;
+ for (ChangeFilter2 filter : userFilters) {
+ if (!filter.accept(graph, change)) {
+ visible = false;
+ break;
+ }
+ }
+ change.setVisible(visible);
+ }
+ if (updateTree3 != null) {
+ Deque<UpdateNode3> stack = new ArrayDeque<>();
+ stack.add(getUpdateNode3());
+ while (!stack.isEmpty()) {
+ UpdateNode3 n = stack.pop();
+ boolean visible = true;
+ for (ChangeFilter2 filter : userFilters) {
+ if (!filter.accept(graph, n)) {
+ visible = false;
+ break;
+ }
+ }
+ n.setVisible(visible);
+ for (UpdateNode3 c : n.getChildren())
+ stack.push(c);
+ }
+ } else {
+
+ Deque<UpdateNode> stack = new ArrayDeque<>();
+ stack.add(updateTree.getRootNode());
+ while (!stack.isEmpty()) {
+ UpdateNode n = stack.pop();
+ boolean visible = true;
+ for (ChangeFilter2 filter : userFilters) {
+ if (!filter.accept(graph, n)) {
+ visible = false;
+ break;
+ }
+ }
+ n.setVisible(visible);
+ for (UpdateNode c : n.getChildren())
+ stack.push(c);
+ }
+ }
+ }
+ });
+ }
+ }