Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Connections over Nodes Zest(The Nodes must not hide the Connections)
Connections over Nodes Zest [message #897559] Tue, 24 July 2012 13:48 Go to next message
Alex D is currently offline Alex D
Messages: 5
Registered: July 2012
Junior Member
Hi everyone,

I've been looking for a solution for some hours now Sad

I'm trying to create a blog diagram where some nodes are inside of
some huge Nodes. Thats no problem so far.

The problem is, the smaller Nodes are connected to each other. Thus my
connections are hidden behind the large nodes...



Some additional information:

-I'm using custom nodes, LayoutAlgorithm and ConnectionRouter

-All nodes are highlighted and unhighlighted after mouse up/down, so
the smaller nodes wont be hidden behind the large ones after drag


I hope you can help me out Wink
Re: Connections over Nodes Zest [message #897614 is a reply to message #897559] Tue, 24 July 2012 18:37 Go to previous messageGo to next message
Jan Krakora is currently offline Jan Krakora
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
I don't know the Zest framework, but you have to put the connections in a higher layer (the draw2d's ConnectionLayer is designed for connections) in a layered pane (hope it use one).
Re: Connections over Nodes Zest [message #897784 is a reply to message #897614] Wed, 25 July 2012 09:01 Go to previous messageGo to next message
Alex D is currently offline Alex D
Messages: 5
Registered: July 2012
Junior Member
Than you for your hint, but i couldn't find a way to take influence on the layers...

The classes Graph, GraphConnection, LayoutAlgorithm and Router seem to have no methods that have something to do with the layer.

Do you have a hint what else i could try?

I found the this link (German, draw2d), but its not of much help
with zest.

htt p://it-republik.de/jaxenter/artikel/Diagramme-selbst-gemalt-0756.html
Re: Connections over Nodes Zest [message #903970 is a reply to message #897784] Mon, 27 August 2012 13:16 Go to previous messageGo to next message
Alex D is currently offline Alex D
Messages: 5
Registered: July 2012
Junior Member
Hi,

is still couldn't find a solution.
Can someone give me a hint how to take influence in the Layers in ZEST?
Re: Connections over Nodes Zest [message #922776 is a reply to message #897559] Tue, 25 September 2012 10:21 Go to previous messageGo to next message
Alex D is currently offline Alex D
Messages: 5
Registered: July 2012
Junior Member
push
Re: Connections over Nodes Zest [message #923000 is a reply to message #897559] Tue, 25 September 2012 14:26 Go to previous message
Alex D is currently offline Alex D
Messages: 5
Registered: July 2012
Junior Member
I've found a solution.

I had to resort the Figures in a Layer. (Connections and Nodes are in the same Layer)

I added the following functions in my LayoutAlgrithm:

private void sortLayer()
	{
	
		GraphConnection  gctmp = (GraphConnection)relationships[0].getLayoutRelationship().getGraphData();
		
		Graph graph = gctmp.getGraphModel();
		
		ZestRootLayer tst = (ZestRootLayer)graph.getRootLayer().getChildren().get(0);
		
		
		Collections.sort(tst.getChildren(), new Comparator<Object>() {

			@Override
			public int compare(Object o1, Object o2) {
				return getNodeWeight(o2) - getNodeWeight(o1);
			}
		});
		
	}


The getNodeWeight() method looks like this atm. (short version):
//Weight in Layer. low weight-> show on top
	private int getNodeWeight(Object oj)
	{
		int weight = 100;

		if(oj instanceof PolylineConnection)
			weight = 1;
		else
		{

		}
		
		return weight;
	}


the 'sortLayer()' method is used after the Layout was computed and when a Node is selected.

Hope this will help someone else

Closed.
Previous Topic:Bend points and Graphical Editor scroll bars
Next Topic:Viewport is continuously layouting
Goto Forum:
  


Current Time: Thu Oct 23 02:26:24 GMT 2014

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

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