Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » EditPolicies(Work together?!)
EditPolicies [message #500958] Mon, 30 November 2009 13:23 Go to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello,
I am working on n graphical editor with gef.
At the top of the Editor I have a simple DiagramElemen and its DiagramEditPart which only creates a white figure.
At runtime the user can add new Figures. Figure 1 can only be added at the DiagramEditPart, figure 2 only at figure 1.
So far everything is working fine.
Now I want the figures 1 and 2 to be movable and resizeable.
The problem is that I do not really understand how the edit policies are working together.
The following structure works fine:
DigramEditPart -> XYLayoutPolicy (subclassed)
FigureOneEditPart -> LayoutEditPolicy (subclassed)
FigureTwoEditPart -> ResizableEditPolicy (subclassed)

But I think the structure is not well-chosen. (BTW: I do not really know why the user can move and resize figure 1 because there is no EditPart for that??!)
FigureOne is movable and resizeable although uit has no ResizableEditPolicy.

So I tried to create a second EditPolicy fo FigureOne:
DigramEditPart -> XYLayoutPolicy (subclassed)
FigureOneEditPart -> LayoutEditPolicy (subclassed) + ResizableEditPolicy(subclassed)
FigureTwoEditPart -> ResizableEditPolicy (subclassed)

But now, if I am moving figure1, no shadow is visible?!

I would appreciate any help!

Best regards.
Alex

[Updated on: Mon, 30 November 2009 13:24]

Report message to a moderator

Re: EditPolicies [message #500966 is a reply to message #500958] Mon, 30 November 2009 14:00 Go to previous messageGo to next message
Thomas is currently offline ThomasFriend
Messages: 79
Registered: October 2009
Member
i have forgotten the most of gef right now, but i used this http://www.psykokwak.com/blog/images/gef/GEF_Tutorial.pdf tutorial. There should be some answers to some of your questions
Re: EditPolicies [message #502509 is a reply to message #500958] Tue, 08 December 2009 15:33 Go to previous message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
First of all: Thanks for your answer thomas.

I read many tutorials about GEF and the EditPolicies.
I was wondering because according to the following link you need 2 EditPolicies to Move-Resize-Reparent your EditParts:
http://dev.eclipse.org/viewcvs/index.cgi/www/gef/reference/i nteractions.html?root=Eclipse_Website&view=co

At the moment my EditParts only use an LayoutPolicy and an ResizeableEditPolicy.
But there are still problems left:

1. Creating a DiagramElement: There is no Rectangle-shadow shown if I create an element by dragging it to the size I want.
2. My RootRootEditPart is a FreeformLayer which is able to expand in all directions. Now the problem is that the x and y coordinates are not relative to the absolute zero-point but to the upper left corner of the editor. Is it possible to get the "scroll-distance" in x and y direction of the Freeform Layer.

I would really appreciate any help Smile

Thanks a lot

Best regards
Alex

[Updated on: Wed, 09 December 2009 06:50]

Report message to a moderator

Previous Topic:Connection basic
Next Topic:How to rotate draw2d figures ?
Goto Forum:
  


Current Time: Thu Apr 25 19:38:06 GMT 2024

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

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

Back to the top