Question to a simple diagram modification

General discussions about code engineering

Moderator: Moderators

Question to a simple diagram modification

Postby cgomez » Tue Jun 26, 2012 8:13 am

Hi,
i simply want to accomplish per java that an element is contained within another element of the same diagram. Here is a visualization of the procedure I want to implement:

Image

Subsequently I want the diagram to be automatically displayed with a hierarchical layout like if I had chosen the option "Layout"->"Layout Hierarchic Style" from the diagram's context menu.

Can you please give me the code fragments which are necessary to achieve these tasks?

Thanks
cgomez
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Tue Jun 26, 2012 7:35 am

Re: Question to a simple diagram modification

Postby marlel » Wed Jun 27, 2012 12:56 am

Hello,

Unfortunately there is no OpenAPI to move the symbol. I will register the issue.

The layout code:
Code: Select all
diagramPresentationElement.layout(true, new HierarchicDiagramLayouter());
marlel
 
Posts Rating:

Re: Question to a simple diagram modification

Postby cgomez » Wed Jun 27, 2012 4:25 am

Thanks, that solves the problem with the layout.

I think I was unclear with the first task. I do not want to show this procedure graphically. The picture just show the initial state of my diagram, with an element not being included (graphically) in an package. After running the code (which i am looking for) the element should be contained in the package. Mark that i have already assigned the element to the package, but I want to show this in this diagram. So how do I achieve this final state of the diagram?
cgomez
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Tue Jun 26, 2012 7:35 am

Re: Question to a simple diagram modification

Postby marlel » Wed Jun 27, 2012 5:56 am

Hello,

The first task is pretty clear, and I understand it, so the answer is the same - currently there is no OpenAPI to do this.
marlel
 
Posts Rating:

Re: Question to a simple diagram modification

Postby cgomez » Wed Jun 27, 2012 10:48 am

Ok thank you
cgomez
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Tue Jun 26, 2012 7:35 am

Re: Question to a simple diagram modification

Postby mindaugas.genutis » Mon Jul 16, 2012 8:28 am

Hello,

In MagicDraw 17.0.2 sp1 we have added methods to the PresentationElementsManager to move single and multiple symbols to a different parent/different location. Using these methods it is possible to change:

1. Location of symbol(s).
2. Parent of symbol(s) (this may subsequently change the parent in the model). This method resembles manual symbol moving on the diagram to another symbol.

Yours Sincerely,

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


Return to Code engineering

Who is online

Users browsing this forum: No registered users and 0 guests

cron