Is there a "normal" way to Colorize the Nodes and Edges in the .ecore_diagram programaticaly?
My Code so far:
private static void saveDiagram(ResourceSet resourceSet,
EPackage epackage, String path) {
URI uri= URI.createFileURI(path);
Resource overlapResource = resourceSet.createResource(uri, "ecore");
overlapResource.getContents().add(epackage);
Diagram d = createDiagram(epackage);
URI diagUri = URI.createFileURI(path + "_diagram");
Resource diagramResource = resourceSet.createResource(diagUri, "ecore");
d.setName(diagUri.lastSegment());
diagramResource.getContents().add(d);
diagramResource.save(null); //In try catch block
overlapResource.save(null); //In try catch block
}
public static Diagram createDiagram(EObject object) {
Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL);
diagram.setElement(object);
diagram.setType("Ecore");
return diagram;
}
I have the ecore file, ecore_diagram file and the EPackage... I dont know.. should I go throw all EClasses and EReferences and ... what?
Thx for Help!
"ecore_diagram" files are no longer supported, you are probably on a very old version of Eclipse modeling...
My guess would be to first identify the feature you need to change in the ecore_diagram format. Open the file as a text file and find the node you want to modify, then find the property you need to change. Validate that it does what you want.
Then do the same, programatically. Navigate from your Diagram instance down to the elements holding the property you need to change, change that property's value and save the model.