Diagram properties [message #714086] |
Tue, 09 August 2011 15:06  |
Eclipse User |
|
|
|
I didn't find any docs/samples about how to set the diagram properties (at creation time; both for setting some global default values for a particular diagram type, and/or by letting the user change it) or by seeing/changing the values for a created diagram: gridsize, snaptogrid, etc.
|
|
|
|
|
Re: Diagram properties [message #714464 is a reply to message #714393] |
Wed, 10 August 2011 11:01   |
Eclipse User |
|
|
|
Ok, I see, changes to the diagram must be transactional (EMF-wise), so something like this works :
final TransactionalEditingDomain ed = TransactionUtil.getEditingDomain(diagram);
ed.getCommandStack().execute(new RecordingCommand(ed) {
protected void doExecute() {
diagram.setGridUnit(myGridUnit);
}
});
This could be used to change the gridsize from some menu (in a Handler). But I don't think this should go inside a DiagramTypeProvider.init() : it would set the property each time a diagram was opened, which is not one would normally want (and besides, it would cause the editor to open always dirty).
To set a diagram property at creation time, i.e., where/how to invoke Graphiti.getPeCreateService().createDiagram(), seems to fit into a bigger task: customize a diagram creation (including, perhaps, a creation Wizard). I have not seen docs about this (perhaps it's not very much Graphiti specific?). I'll take a look into BPMN2DiagramCreator.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07616 seconds