custom digram template

Discussions about Domain Specific Language customizations

Moderator: Moderators

custom digram template

Postby rashmiprakashdas@hotmail.com » Mon Dec 05, 2016 11:23 pm

Is there any way to create a template for custom diagrams.
I mean we can create a template for our project.so in a similar way when we create a custom diagram instead of showing a blank space it will show some default element in the drawing area.for example in case of an activity diagram it will show one initial node,one activity and one activity final. 8-)

Thanks
rashmiprakashdas@hotmail.com
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Mon Dec 05, 2016 11:17 pm

Re: custom digram template

Postby mindaugas.genutis » Tue Dec 06, 2016 9:01 am

Hello,

We do not have diagram templates. Here is a possible way to approach this:

a) create a project template with predefined diagrams,
b) create a plugin in java which listens when a particular type of diagram is created and appends necessary predefined symbols to the created diagram.

Yours Sincerely,

-- Mindaugas Genutis
User avatar
mindaugas.genutis
Customer Support
Customer Support
 
Posts: 457
Posts Rating:25
Joined: Thu Feb 04, 2010 1:57 am
Location: Kaunas

Re: custom digram template

Postby rashmiprakashdas@hotmail.com » Wed Dec 07, 2016 6:00 am

Hi,
Thanks for the conformation.
So as far as listener is concerned is it "PropertyChangeListener"?
Can you please give a brief idea how exactly this listener will work when you are creating a diagram .

Thanks
rashmiprakashdas@hotmail.com
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Mon Dec 05, 2016 11:17 pm

Re: custom digram template

Postby mindaugas.genutis » Wed Dec 07, 2016 8:22 am

Hello,

You should add a project event listener to the project and listen to ExtendedPropertyNames.DIAGRAM_CREATED event. Please have a look at CustomDiagramPainter example among our examples, it has a project event listener example.

-- Mindaugas Genutis
User avatar
mindaugas.genutis
Customer Support
Customer Support
 
Posts: 457
Posts Rating:25
Joined: Thu Feb 04, 2010 1:57 am
Location: Kaunas

Re: custom digram template

Postby rashmiprakashdas@hotmail.com » Mon Dec 12, 2016 1:26 am

Hi,

Thanks for the suggesstion.

For creating elements in the diagram i am using createShapeElement method.
But i need to fetch all the elements visible in the diagram toolbar for a particular diagram.So i can choose the element from the toolbar and pass it into createShapeElement method.

My question is how i can fetch the elements visible in the diagram toolbar.
i tried getUsedModelElements(true),getPresentationElements()..etc..
But all are returned only the diagram.not the allowed elements for that diagram.

So how can i get all those elements.

Thanks
prakash
rashmiprakashdas@hotmail.com
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Mon Dec 05, 2016 11:17 pm

Re: custom digram template

Postby mindaugas.genutis » Mon Dec 12, 2016 4:56 am

Dear Prakash,

We don't provide Open API to get all possible elements from the diagram toolbar.

Yours Sincerely,

-- Mindaugas Genutis
User avatar
mindaugas.genutis
Customer Support
Customer Support
 
Posts: 457
Posts Rating:25
Joined: Thu Feb 04, 2010 1:57 am
Location: Kaunas


Return to DSL

Who is online

Users browsing this forum: No registered users and 0 guests