Selecting/moving a Figure within a Figure [message #162100] |
Sun, 19 December 2004 20:26  |
Eclipse User |
|
|
|
Originally posted by: bandrews.nospam_bphnx.com
Hi All,
It seems like it should be possible, but I can't quite figure this out.
Is there way to create an EditPart that allows selection/moving of
Figures that it contains. I guess the EditPart would act as the
ContentsEditPart, just like what you set on the viewer. So, maybe like a
ContentsEditPart within a ContentsEditPart? Hopefully this makes sense.
If anyone could point me in the right direction, it would be greatly
appreciated!
many thanks,
B
|
|
|
Re: Selecting/moving a Figure within a Figure [message #162120 is a reply to message #162100] |
Sun, 19 December 2004 21:01  |
Eclipse User |
|
|
|
> It seems like it should be possible, but I can't quite figure this out. Is
> there way to create an EditPart that allows selection/moving of Figures
> that it contains.
I will pull a tried-and-true for this group and refer you to the logic
example.
org.eclipse.gef.examples.logicdesigner.edit.LogicContainerEd itPart
which is used for the circuit, flow container, and diagram components (all
of which are containers) should give you enough to go on.
The thing to keep in mind is that the root contents that you provide to your
editor -is- a container. If you have a figure that you are able to move
around the diagram and understand how it works then you already everything
that you need. This concept can be extended (just as CircuitEditPart,
LogicFlowContainerEditPart, and LogicDiagramEditPart extend
LogicContainerEditPart) for any part.
The main difference between a standard component and a container is the
ContainerEditPolicy installed as a EditPolicy.CONTAINER_ROLE and you'll need
a EditPolicy.LAYOUT_ROLE (again, just look at LogicContainerEditPart). Of
course there are all of the Commands that need to be plumbed in the
EditPolicy. Oh, the one tricky thing that I always forget about is
LayoutEditPolicy.createChildEditPolicy(). If you don't return an EditPolicy
that is similar to ResizableEditPolicy (or at least SelectionEditPolicy)
then the children of the container wont be selectable, movable, resizable,
etc.
I hope this is helpful.
--
Rob Grzywinski
|
|
|
Powered by
FUDForum. Page generated in 0.03764 seconds