Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Unable to hide PolylineConnection
Unable to hide PolylineConnection [message #238049] Tue, 21 August 2007 17:27 Go to next message
Eclipse UserFriend
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
Re: Unable to hide PolylineConnection [message #238054 is a reply to message #238049] Tue, 21 August 2007 17:56 Go to previous message
Eclipse UserFriend
Originally posted by: malnatij.lu.unisi.ch

MY BAD, MY BAD

DOH!!!!

I was stupid enough to add multiple instances of the same edge.. setVisible(false) works as it should :D
Previous Topic:PropertyPage and the use of FileDialog
Next Topic:FlowLayout question
Goto Forum:
  


Current Time: Fri Apr 19 07:54:08 GMT 2024

Powered by FUDForum. Page generated in 0.02280 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top