Graph DeleteProvider has no effect on graph

i implemented the delete provider :
@Override
public DeleteProvider getDeleteProvider() {
return new DeleteProvider<CodeGraphNode, CodeGraphEdge>(){
public boolean canDeleteNode(@NotNull CodeGraphNode node) {
return true;
}

public boolean deleteNode(@NotNull CodeGraphNode node) {
return getDataModel().removeNode(node);
}

public boolean canDeleteEdge(@NotNull CodeGraphEdge edge) {
return true;
}

public boolean deleteEdge(@NotNull CodeGraphEdge edge) {
return getDataModel().removeEdge(edge);
}
};
}

i do get the delete option on tool bar and on popup menu
but when i use it the nodes/edged stay on the graph

3 comments

sorry for bumping

nobody can help me with this ?

0

Hi,

I think you have to invoke updateGraph() method.

public boolean deleteNode(@NotNull CodeGraphNode node) {
final boolean isDeleted = getDataModel().removeNode(node);
getGraphBulder().updateGraph();
return isDeleted;
}

ps.

As a rule, I add graph data model listener to update model synchronously.
It lets me forget about updateGraph() method.
for instance,

DomManager.getDomManager(myBuilder.getProject()).addDomEventListener(new
DomEventAdapter() {
public void eventOccured(final DomEvent event) {
if (isShowing()) {
myBuilder.queueUpdate();
}
}
}, this);


Serega.


0

updating on each node delete will take alot of time

that listener works on which changes ?

Message was edited by:
Aviram Segal

0

Please sign in to leave a comment.