EditPolicies [message #500958] |
Mon, 30 November 2009 08:23  |
Eclipse User |
|
|
|
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 08:24] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02861 seconds