How to set properties of an object automatically when it is created in the diagram? [message #758877] |
Thu, 24 November 2011 21:54 |
Hoang Messages: 45 Registered: September 2011 Location: Milan |
Member |
|
|
Hi all,
I have this situation. When I select an object from the Palette, and add it into the diagram. I want to automatically set its properties. Which places can I look at to do that?
Specifically, I have a compartment as follow: Object A contains object B, object B contains object C, object C contains object D. Then when user selects object D and drop it into the diagram, I want to set its properties, as example: property fullPath = A.B.C
Besides that, I want to create some files in the folder structure. Where is the right place to do so?
Is it in the EditPart of the diagram?
Thanks,
Hoang
|
|
|
Re: How to set properties of an object automatically when it is created in the diagram? [message #758984 is a reply to message #758877] |
Fri, 25 November 2011 13:28 |
|
On 24/11/2011 22:54, Hoang wrote:
> Hi all,
>
> I have this situation. When I select an object from the Palette, and add
> it into the diagram. I want to automatically set its properties. Which
> places can I look at to do that?
>
> Specifically, I have a compartment as follow: Object A contains object
> B, object B contains object C, object C contains object D. Then when
> user selects object D and drop it into the diagram, I want to set its
> properties, as example: property fullPath = A.B.C
I think the best place to do so is the FeatureSeqInitializer on a
NodeMapping in gmfmap.
If this is not enough for you, have a look at the code that is generated
from the FeatureSeqInitializer, this will be an interesting entry point
to find out what you need to customization.
> > Besides that, I want to create some files in the folder structure. Where
> is the right place to do so?
> Is it in the EditPart of the diagram?
This could be a nice use-case for the DiagramEventBrocker. You can
listen to changes in your diagram and react to them without modifying
its code.
--
http://mickaelistria.wordpress.com
http://twitter.com/#!/mickaelistria
http://www.petalslink.com
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03525 seconds