Problem to modify diagram element in Java Class [message #1499561] |
Fri, 05 December 2014 08:18 |
Didier Cormier Messages: 6 Registered: October 2014 |
Junior Member |
|
|
Hi all,
I create a representation (graph) in a Java External Class. The representation has a NodeContainer with a WorkspaceImage style.
For the creation of the new diagram I'm using:
DRepresentation newrepresentation = DialectManager.INSTANCE
.createRepresentation(myDiagramName, myObject ,description, session, new NullProgressMonitor());
After creation, I try to change the path of the image used for the node container
List<DDiagramElement> contents =((DSemanticDiagram)newrepresentation).getDiagramElements();
ListIterator<DDiagramElement> elts = contents.listIterator();
while (elts.hasNext()) {
DDiagramElement elt = elts.next();
if (elt instanceof DNodeContainer) {
Style style = elt.getStyle();
if ( style instanceof WorkspaceImage ) {
// try to modify the path of Image used by ContainerNode
((WorkspaceImage)style).setWorkspacePath( myNewPath );
}
}
}
DialectUIManager.INSTANCE.openEditor(session, newrepresentation, new NullProgressMonitor());
In debug mode, the new path is well modified but in the diagram opened : the node use the default path (not the path I try to dynamicaly inject)
If someone has a solution ?
[Updated on: Fri, 05 December 2014 09:17] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07095 seconds