Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » child shape inside parent shape
child shape inside parent shape [message #1060938] Wed, 29 May 2013 08:54 Go to next message
abdallah Q is currently offline abdallah Q
Messages: 14
Registered: May 2013
Junior Member
Hi all,

I'm workibng on a project using Graphiti. i've been searching to find any tutorial that can help me to deal with the containershape but i couldnt find anyone.

i'm trying to create a shape (which is the 'childShape' in the attached diagram) inside another shape (which is the 'ParentShape' in the attached diagram) and be able to connect two shapes of child type.

index.php/fa/15083/0/

is there any way to do it using graphiti?
Re: child shape inside parent shape [message #1061022 is a reply to message #1060938] Wed, 29 May 2013 14:31 Go to previous messageGo to next message
Vladimir D is currently offline Vladimir D
Messages: 13
Registered: January 2013
Junior Member
Hi Abdallah,

you can specify that your childShape can be created only inside a parentShape. You can do this by overriding canCreate() method of your childShape create feature, and it should be something like this:

public boolean canCreate(ICreateContext context) {
	return getBusinessObjectForPictogramElement(context.getTargetContainer()) instanceof ParentShape;
}


After that, by overriding create method, you can add your childShape to your parentShape in the business model.
Re: child shape inside parent shape [message #1062039 is a reply to message #1061022] Wed, 05 June 2013 14:21 Go to previous message
abdallah Q is currently offline abdallah Q
Messages: 14
Registered: May 2013
Junior Member
thank you Vladimir ,its working now Smile

[Updated on: Wed, 05 June 2013 14:22]

Report message to a moderator

Previous Topic:Removing old PE Decorators from diagram
Next Topic:Graphiti as RCP
Goto Forum:
  


Current Time: Tue Sep 23 14:33:02 GMT 2014

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

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