Skip to main content



      Home
Home » Modeling » Graphiti » Move existing Shapes to new ContainerShape
Move existing Shapes to new ContainerShape [message #1407283] Tue, 12 August 2014 04:48 Go to next message
Eclipse UserFriend
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 368 times)
Re: Move existing Shapes to new ContainerShape [message #1407439 is a reply to message #1407283] Tue, 12 August 2014 11:50 Go to previous messageGo to next message
Eclipse UserFriend
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 03:33 Go to previous messageGo to next message
Eclipse UserFriend
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 08:09 Go to previous messageGo to next message
Eclipse UserFriend
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 10:20 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 13:22:58 EDT 2025

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

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

Back to the top