Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Move existing Shapes to new ContainerShape
Move existing Shapes to new ContainerShape [message #1407283] Tue, 12 August 2014 08:48 Go to next message
Lukas E is currently offline Lukas EFriend
Messages: 3
Registered: August 2014
Junior Member
Hey there,

I am quite new to Graphiti and have some problems with the following task:

I would like to take existing Shapes (representing e.g. a process) and create a new ContainerShape which hold these as child elements
(representing e.g. a new subprocess consisting of the processes selected earlier)

My current approach:
1. use a copyFeature to copy the elements to the clipboard
2. remove all selected elements from the diagram
3. create a new containerShape ("parent") inside the diagram
4. add a new inactive shape inside "parent" for all elements currently on the clipboard
5. create a deap copy of all the clipboard elements to one of the newly created shapes
(since I haven't found a way to assign the original elements here)
6. use an addFeature to put the parent onto the diagram

Is there an easier way to do this? The result should look something like this:

index.php/fa/18846/0/
  • Attachment: example.png
    (Size: 6.05KB, Downloaded 314 times)
Re: Move existing Shapes to new ContainerShape [message #1407439 is a reply to message #1407283] Tue, 12 August 2014 15:50 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

That sounds like an awful lot of work Wink Why can't you just:
1. create the new container
2. use a MoveShapeFeature to move the children to their new container parent
Re: Move existing Shapes to new ContainerShape [message #1407676 is a reply to message #1407439] Wed, 13 August 2014 07:33 Go to previous messageGo to next message
Lukas E is currently offline Lukas EFriend
Messages: 3
Registered: August 2014
Junior Member
Hey Robert,

thanks for your answer.

The MoveFeature is also one of the features I wanted to implement anyway.

But my aim is to provide a CustomFeature, which can create this parent shape and move the selected shapes and connections inside.

Btw: Is there a way to gather all Connections associated with selected shapes?

Re: Move existing Shapes to new ContainerShape [message #1407768 is a reply to message #1407676] Wed, 13 August 2014 12:09 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

You can still invoke your Move Feature from within the Custom Feature.
To collect all connections of a shape, you can use Graphiti.getPeService().getAllConnections(AnchorContainer)
Re: Move existing Shapes to new ContainerShape [message #1407818 is a reply to message #1407768] Wed, 13 August 2014 14:20 Go to previous message
Lukas E is currently offline Lukas EFriend
Messages: 3
Registered: August 2014
Junior Member
Thanks again for your help Smile .

I will try to realize my CustomFeature using a MoveFeature.

If I have to face further difficulties, I will post here again.

Previous Topic:How to get FeatureProvider from a PE
Next Topic:Add a selection listener to the BPMN2 Diagram editor
Goto Forum:
  


Current Time: Tue Mar 19 14:04:14 GMT 2024

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

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

Back to the top