Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problems with scrolling
Problems with scrolling [message #238126] Tue, 28 August 2007 12:46 Go to next message
René is currently offline René
Messages: 45
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------050805010500000902080701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

i use a editor sub classed from the GraphicalEditorWithPalette (with a
XYLayout). It works mostly like the shapes editor example. The diagram
have components and between these are connections. For the connections i
use a ShortesPathConnectionRouter.
Everything with these things are ok until you have to scroll. If this
happened the connection make crazy things. Now they are totally
displaced (shot1.png). But it is not a problem only with the
connections. When i scroll a bit and try to paint a new connection the
dashed pre-connection-line will be also displaced (shot2.png).

It seems to me that there is something wrong with the anchors (I use
XYAnchors) ?! But why? Everything is fine when I dont scroll?

Has anybody an idea? Im very thankful for any hint!


Best regards,
Ren
Re: Problems with scrolling [message #238202 is a reply to message #238126] Fri, 31 August 2007 10:55 Go to previous messageGo to next message
René is currently offline René
Messages: 45
Registered: July 2009
Member
Hi all,

I had searched the internet a bit more and get some new ideas about my
problem. I think it is really a problem with the anchors positions.
There a exist a relative and absolute coordinate system. Until yet I
only use the relative system. The trick is to translate these relative
coords into world coords. But with this I still have trouble:

Im not sure which figure in my diagram i have to use to translate the
coords to world coords. I had tried to use the my component-figure (the
componeten figure has-subfigures connectors which have the XYAnchors)
but unsuccessful. Maybe somebody had an idea which figure I have to use
for to correct translation.

Thanks!

Regards,
René





René schrieb:
> Hi,
>
> i use a editor sub classed from the GraphicalEditorWithPalette (with a
> XYLayout). It works mostly like the shapes editor example. The diagram
> have components and between these are connections. For the connections i
> use a ShortesPathConnectionRouter.
> Everything with these things are ok until you have to scroll. If this
> happened the connection make crazy things. Now they are totally
> displaced (shot1.png). But it is not a problem only with the
> connections. When i scroll a bit and try to paint a new connection the
> dashed pre-connection-line will be also displaced (shot2.png).
>
> It seems to me that there is something wrong with the anchors (I use
> XYAnchors) ?! But why? Everything is fine when I dont scroll?
>
> Has anybody an idea? Im very thankful for any hint!
>
>
> Best regards,
> René
>
> ------------------------------------------------------------ ------------
>
>
> ------------------------------------------------------------ ------------
>
Re: Problems with scrolling [message #238362 is a reply to message #238202] Fri, 07 September 2007 12:36 Go to previous message
René is currently offline René
Messages: 45
Registered: July 2009
Member
Hi guys,

I had solved the problem. The solution is to implement a class derived
from the AbstractConnectionAnchor. For this anchor type you can specify
a owner figure and on every move or resize of this figure the location
will be updated by itself. To do this you have to implement the
AbstractConnectionAnchor#getLocation() method. This is also the point
where you have to translate the relative coordinates into world
coordinates (getOwner().translateToWorld(p)). For example have a look at
the FixedConnectionAnchor class in the logic example.

I had seen that this is one of the common gef/draw2d mistakes
(http://wiki.eclipse.org/index.php/GEF_Troubleshooting_Guide). Dont
worry when you got the same :)

best regards,
René



René wrote:
> Hi all,
>
> I had searched the internet a bit more and get some new ideas about my
> problem. I think it is really a problem with the anchors positions.
> There a exist a relative and absolute coordinate system. Until yet I
> only use the relative system. The trick is to translate these relative
> coords into world coords. But with this I still have trouble:
>
> Im not sure which figure in my diagram i have to use to translate the
> coords to world coords. I had tried to use the my component-figure (the
> componeten figure has-subfigures connectors which have the XYAnchors)
> but unsuccessful. Maybe somebody had an idea which figure I have to use
> for to correct translation.
>
> Thanks!
>
> Regards,
> René
>
>
>
>
>
> René schrieb:
>> Hi,
>>
>> i use a editor sub classed from the GraphicalEditorWithPalette (with a
>> XYLayout). It works mostly like the shapes editor example. The diagram
>> have components and between these are connections. For the connections
>> i use a ShortesPathConnectionRouter.
>> Everything with these things are ok until you have to scroll. If this
>> happened the connection make crazy things. Now they are totally
>> displaced (shot1.png). But it is not a problem only with the
>> connections. When i scroll a bit and try to paint a new connection the
>> dashed pre-connection-line will be also displaced (shot2.png).
>>
>> It seems to me that there is something wrong with the anchors (I use
>> XYAnchors) ?! But why? Everything is fine when I dont scroll?
>>
>> Has anybody an idea? Im very thankful for any hint!
>>
>>
>> Best regards,
>> René
>>
>> ------------------------------------------------------------ ------------
>>
>>
>> ------------------------------------------------------------ ------------
>>
Previous Topic:how to programmably add nodes and edges
Next Topic:Problem related to connection ..
Goto Forum:
  


Current Time: Wed Sep 17 05:53:58 GMT 2014

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

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