Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » SnapToHelper problems.
SnapToHelper problems. [message #127396] Thu, 15 April 2004 07:42 Go to next message
Eclipse UserFriend
Originally posted by: eostroukhov.hotmail.com

SnapToHelper is built around Visitor GOF pattern so it inherits major
weekness of that pattern - whenever you need to add a new request type you
have to add respective methods to each SnapToHelper implementation.

In our project we have several requests that would enjoy snapping to the
grid/guides/whatever bat they are not direct siblings of the move, resize or
create requests. I.e., we have a special "table" element that fills its
parent horizontaly so it should only have its left and right margins
snapped. The problem is that I don't see how can I derive the request from
the three snapable requests.

What I want to offer is to discuss some general interfaces for the requests
that can be snapped. In our project I see following request types:
1. Rectangular request - it's similar to ChangeBoundsRequest
2. Point request - i.e. like DropRequest implementation.

Maybe it is possible to define the request types and special interfaces so
new tools developers will be able to leverage the reuse of the snapping to
their custom requests? I can start implementing snapping in existing
strategies as soon as the interfaces will be agreed.

Best regards,
Eugene
Re: SnapToHelper problems. [message #127402 is a reply to message #127396] Thu, 15 April 2004 08:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eostroukhov.hotmail.com

To make my point clear - I've added method int
snapLocationRequest(LocationRequest request, int snapOrientation); and
implemented it for the SnapToGuides - this allows me to snap column resize
request, drag line end request, can allow to snap when dragging bend points,
etc.

So I guess, if we will define correct request types there will be some 2-5
generic methods instead of snapCreation..., snapResize..., snapMove... (I
consider them too narrow for the broad range of the products to be developed
using GEF)

Eugene

"Eugene Ostroukhov" <eostroukhov@hotmail.com> wrote in message
news:c5lduv$1mr$1@eclipse.org...
> SnapToHelper is built around Visitor GOF pattern so it inherits major
> weekness of that pattern - whenever you need to add a new request type you
> have to add respective methods to each SnapToHelper implementation.
>
> In our project we have several requests that would enjoy snapping to the
> grid/guides/whatever bat they are not direct siblings of the move, resize
or
> create requests. I.e., we have a special "table" element that fills its
> parent horizontaly so it should only have its left and right margins
> snapped. The problem is that I don't see how can I derive the request from
> the three snapable requests.
>
> What I want to offer is to discuss some general interfaces for the
requests
> that can be snapped. In our project I see following request types:
> 1. Rectangular request - it's similar to ChangeBoundsRequest
> 2. Point request - i.e. like DropRequest implementation.
>
> Maybe it is possible to define the request types and special interfaces so
> new tools developers will be able to leverage the reuse of the snapping to
> their custom requests? I can start implementing snapping in existing
> strategies as soon as the interfaces will be agreed.
>
> Best regards,
> Eugene
>
>
Re: SnapToHelper problems. [message #127533 is a reply to message #127396] Thu, 15 April 2004 19:26 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> SnapToHelper is built around Visitor GOF pattern so it inherits major
Oh. I didn't even realize that.
> weekness of that pattern - whenever you need to add a new request type you
> have to add respective methods to each SnapToHelper implementation.

There are several issues involved with the primary types of snapping we
wanted to support. We should definitely try to make the included methods as
generic as possible, and even consider adding generic methods which aren't
used but would be useful in the cases you describe. Open a bugzilla and
attach any code you have. Thanks!! Be sure to pay attention to zooming
complexities, and also use of HandleBounds instead of bounds.

> In our project we have several requests that would enjoy snapping to the
> grid/guides/whatever bat they are not direct siblings of the move, resize
or
> create requests. I.e., we have a special "table" element that fills its
> parent horizontaly so it should only have its left and right margins
> snapped. The problem is that I don't see how can I derive the request from
> the three snapable requests.
>
> What I want to offer is to discuss some general interfaces for the
requests
> that can be snapped. In our project I see following request types:
> 1. Rectangular request - it's similar to ChangeBoundsRequest
> 2. Point request - i.e. like DropRequest implementation.
>
> Maybe it is possible to define the request types and special interfaces so
> new tools developers will be able to leverage the reuse of the snapping to
> their custom requests? I can start implementing snapping in existing
> strategies as soon as the interfaces will be agreed.
>
> Best regards,
> Eugene
>
>
Previous Topic:Decorators in GEF
Next Topic:NullPointerException in GraphicalEditor
Goto Forum:
  


Current Time: Thu Apr 25 19:16:35 GMT 2024

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

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

Back to the top