Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » showing properties on diagram(showing the properties of a shape on diagram for more readability to users)
showing properties on diagram [message #1404523] Sat, 02 August 2014 23:45 Go to next message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
Hi Robert,
I'm wondering if I can show other properties of a shape on the diagram like the property "name".
assume that I created MyEventDefinition shape which has two properties named value and visibility, in the next step I want to show the values of these two properties above the shape, for example the instance of MyEventDefinition id="MyEventDefinition_1" value="1" visibility="true" presented on the diagram has to be accompanied with the values of its properties as follows (1,true).
according to graphiti docs, we should implement decoration method in AddFeature class, so I viewed an example of showing the property name in AddTaskFeature class presented below.
protected void decorateShape(IAddContext context, ContainerShape containerShape, T businessObject) {
		Shape textShape = peService.createShape(containerShape, false);
		MultiText text = gaService.createDefaultMultiText(getDiagram(), textShape, businessObject.getName());
		gaService.setLocationAndSize(text, 0, 0, context.getWidth(), context.getHeight());
		StyleUtil.applyStyle(text, businessObject);
		text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
		text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
//		text.setFont(gaService.manageFont(getDiagram(), GaServiceImpl.DEFAULT_FONT, 8, false, true));
		link(textShape, businessObject);
	}

at this level I deduced that I should put together the text formed by this kind of sequence: String s="("+businessObject.getValue()+","+businessObject.getVisibility()+")"
after that, I tried to implement decoration method in AddEventDefinitionFeature class, and unfortunately there is no decoration method to implement.
so I'm having two problems:
-how should I form the text, and here I insist on how do I get the value of a property ex:("businessObject.getValue()" should I do the cast to MyEventDefinition or what?)
-should I create a decoration method in AddEventDefinitionFeature or there is another alternative.
I hope that I was clear so you can get me.
if it doesn't disturb you Embarrassed , I'm asking you to develop a new shape that fit these needs.
waiting for your response. Smile
thank you very much.
Re: showing properties on diagram [message #1406916 is a reply to message #1404523] Mon, 11 August 2014 12:38 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 703
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Mhammad,

In your explanation you did not mention how or if you are extending the BPMN2 EventDefinition object. In the org.eclipse.bpmn2.modeler.examples.customtask plugin is an example that defines a MyEventDefinition which is a <customTask> extension (see plugin.xml).

You should be able to do something similar and then in your custom FeatureContainer provide an AddFeature which allows you to override decorateShape().

HTH,
Bob
icon5.gif  Re: showing properties on diagram [message #1406960 is a reply to message #1406916] Mon, 11 August 2014 14:15 Go to previous message
mhammad makni is currently offline mhammad makniFriend
Messages: 66
Registered: June 2013
Member
Hi Robert,
Indeed, I extended the BPMN2 EventDefinition object and I saw the org.eclipse.bpmn2.modeler.examples.customtask plugin example that defines MyEventDefinition, in consequences, I succeeded to create a group of shapes type EventDefinition. Smile
as I mentioned in my first post, I'm aiming to show the properties above the shape, so I tried a several time to develop an AddFeature in purpose to implement decorateShape() but I faced some problems Crying or Very Sad , for instance the definition of constructor's parameters and to override decorateShape() itself. Rolling Eyes
Embarrassed could you please show me how could I provide an AddFeature in order to override decorateShape(). Smile
please enlightening me.
waiting for your response
thank you very much. Smile
Previous Topic: creating pattern using bpmn2 extetion module
Next Topic:message-flow gives save error
Goto Forum:
  


Current Time: Thu Jul 30 14:20:51 GMT 2015

Powered by FUDForum. Page generated in 0.02531 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software