Adding Association and Dependency to BDD Programmatically [message #1807284] |
Mon, 27 May 2019 09:17  |
Eclipse User |
|
|
|
Hi everyone,
I am working on a project which requires to add associations and dependencies between Blocks in a BDD programmatically.
Here is what I already have:
- Existing BDD
- List of information about elements to add:
(Starting block, Ending block, type[Dependency or Association])
I tried to create an association manually than I got the diagram content and tried to perform reverse engineering on it in order to understand how it is made, but I can't figure out a way to generate one programmatically
UPDATES: 28/05/2019
I figured out how to create a Dependency but I can't actually display it into my existing diagram... I tried to do something similar to adding blocks as following
CompoundCommand completeCmd = new CompoundCommand("Show Elements Command");
final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(diagram);
domain.getCommandStack().execute(new GEFtoEMFCommandWrapper(completeCmd));
.... //Adding Blocks here
completeCmd = new CompoundCommand("Show Elements Command");
// Third loop to draw Dependencies FIXME
for (Element element : packageChildren) {
if (element instanceof Dependency) {
final Command cmd = showElementIn(element, diagramEP, 1);
if (cmd != null && cmd.canExecute()) {
completeCmd.add(cmd);
}
}
}
// Execute the commands
domain.getCommandStack().execute(new GEFtoEMFCommandWrapper(completeCmd));
Actually I still can't find a way to create associations...
END UPDATE
can someone provide me a way to do that?
thank you
Dylan
[Updated on: Tue, 28 May 2019 08:49] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02864 seconds