Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Connection/Bendpoint problem during first creation
Connection/Bendpoint problem during first creation [message #220533] Tue, 01 August 2006 21:04 Go to next message
Andreas Herz is currently offline Andreas HerzFriend
Messages: 196
Registered: July 2009
Senior Member
Hi,

I create a ConnectionEditPart with the neccessary edit policies.

I open my model with the editor
=> the connections has no bendpoints.

I select one connection and DragDrop the handle in the middle
=> bendpoint will be created.

Now, I have a Bendpoint and I can DragDrop them around.

BUT it is impossible for me to add some initial bendpoints.
(see below for my current not working coding..)

----snipp----

public ConnectionFigure()
{
BendpointConnectionRouter router = new BendpointConnectionRouter();
setConnectionRouter(router);
List figureConstraint = new ArrayList();
AbsoluteBendpoint rbp = new AbsoluteBendpoint(new Point(100,100));
figureConstraint.add(rbp);
setRoutingConstraint(figureConstraint);
}
----snapp-----


I need a hint!!


Greetings

Andreas
Re: Connection/Bendpoint problem during first creation [message #220542 is a reply to message #220533] Tue, 01 August 2006 21:24 Go to previous message
Andreas Herz is currently offline Andreas HerzFriend
Messages: 196
Registered: July 2009
Senior Member
Hi,

I hate to response to my own questions ;-)

Solution:
========
I have add a router in my editor too => error
I think there is a conflict with the router of the
connection layer and the router of the figure.
I have removed the router in the initializeGraphicalViewer()
method.

greetings

Andreas

====================================================
public class MyEditor{
..
..
..
protected void initializeGraphicalViewer()
{
super.initializeGraphicalViewer();
GraphicalViewer viewer = getGraphicalViewer();
viewer.setContents(getModel()); // set the contents of this editor
// listen for dropped parts
viewer.addDropTargetListener(createTransferDropTargetListene r());


// ERROR ERROR Don't add a router in the connection figure
// and in the editor!!!!!!!)
//
ScalableFreeformRootEditPart root =
(ScalableFreeformRootEditPart)viewer.getRootEditPart();
ConnectionLayer connLayer =
(ConnectionLayer)root.getLayer(LayerConstants.CONNECTION_LAY ER);
GraphicalEditPart contentEditPart = (GraphicalEditPart)root.getContents();
BendpointConnectionRouter router = new BendpointConnectionRouter();
connLayer.setConnectionRouter(router);
// contentEditPart.getContentPane().addLayoutListener(spRouter. getLayoutListener());


}
Previous Topic:zoom & pictures
Next Topic:setting a viewport
Goto Forum:
  


Current Time: Tue Jan 21 18:41:57 GMT 2025

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

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

Back to the top