In my application, i have used XYLayoutEditPolicy and i am moving the bend points when source or target of any connection is moved. On 100% zoom, every thing works fine but i change the zoom then the movement of bendpoints with source or target becomes problematic. I have also tried to scale the delta with zoom factor but still it is problematic. My question is how to handle the movement of bendspoints with source and target of connection?
I have the impression you might be missing some coordinate system translations (the movement of source and target has to be translated into the coordinate system, in which the bendpoint locations are interpreted) and using the scale seems to be a hack which only compensates this partially. Have you checked what happens when you scroll?
i have tried moving source/target of any connection to get the scroll going then all bend points move smoothy with source/target. Now the problem is to create new bend point. Newly created bend point ends up in wrong position when zoom is not 100%. Do you have any idea how to handle this situation?
Again, you will have to make sure all coordinates are interpreted in the same coordinate system (i.e. here in the one used by the connection). Its the same problem as with source and target (which you have up to now solved only with a dirty workaround, which will not cover all cases). Source and target nodes are located somewhere in the primary layer (probably within a parent that adds a local coordinate system), connections are located in the connection layer, the endpoint positions you use for creation are probably absolute (i.e. not affected by the scroll offset).
What you will have to do is to translate them all to be relative to the same coordinate system to be comparable. You can either use the absolute one for this, or the relative one of the connection (i.e. that of the connection layer). IFigure#translateToParent(), IFigure#translateFromParent(), IFigure#translateToAbsolute(), and IFigure#translateToRelative() are meant to accomplish this.