Unable to hide PolylineConnection [message #238049] |
Tue, 21 August 2007 17:27 |
Eclipse User |
|
|
|
Originally posted by: malnatij.lu.unisi.ch
Hi, I have a graph like:
A ---- B ---- C
Nodes are Figure while edges are PolylineConnection.
Now, when I hide a node I would like to hide also the incoming edge, the problem is that if I set the node with setVisible(false) it disappears, but if i do the same with the edge, the edge doesn't disappear.
Every node holds a reference to the incoming edge:
private void setConnectionBetween(Node currentNode, Node currentChild){
PolylineConnection c = new PolylineConnection();
DownAnchor sourceAnchor = new DownAnchor(currentNode);
UpAnchor targetAnchor = new UpAnchor(currentChild);
c.setSourceAnchor(sourceAnchor);
c.setTargetAnchor(targetAnchor);
connections.add(c);
// add the incoming connection to the node so that the node can hide it
currentChild.setIncomingConnection(c);
}
As you see every node has a reference to its incoming PolylineConnection.
public void setHiddenNode(){
if(incomingConnection != null){
incomingConnection.setVisible(false);
incomingConnection.repaint();
}
setVisible(false);
repaint();
}
and when I hide the node, the node gets hidden while the incomingConnection (that is a PolylineConnection) does not.. I've tried also setOpaque(false) or erase() but it keeps being there, visible.
Any idea? Thanks :D
|
|
|
|
Powered by
FUDForum. Page generated in 0.02280 seconds