Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » How to change the Label of a extended featureContainer
How to change the Label of a extended featureContainer [message #1692456] Wed, 15 April 2015 21:49 Go to next message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 192
Registered: July 2009
Senior Member
Hi,

I played around with my extension of a CustomShapeFeatureContainer for a IntermediateCatchEventFeatureContainer.

What I try to do is to change the label displayed for the Event. This is normally the name of the business object.
So I override the method createFeatureContainer and added a getUpdateFeature where I added a UpdateLabelFeature. So my code looks like this:


public class ImixsFeatureContainerEvent extends CustomShapeFeatureContainer {
	....
	@Override
	protected IntermediateCatchEventFeatureContainer createFeatureContainer(
			IFeatureProvider fp) {
		return new IntermediateCatchEventFeatureContainer() {
			....
			@Override
			public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
				MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
				multiUpdate.addFeature(new UpdateIntermediateCatchEventFeature(
						fp) {
					@Override
					public boolean update(IUpdateContext context) {
						super.update(context);
						setFillColor((ContainerShape) context
								.getPictogramElement());
						return true;
					}
				});
				multiUpdate.addFeature(new UpdateLabelFeature(fp) {
					@Override
					protected String getLabelString(BaseElement element) {
						String l = super.getLabelString(element);
						// change the label string here!
						return l + " some extra information";
					}
				});
				return multiUpdate;
			}
			....
		};
	}
}


This works!.
But in the moment when I change the label string the color of the label becomes 'red'.
I guess this should be a warning to the user that the label has now exceed a precomputed length or something?

I tried a lot to change the forgroundColor of the label shape, but which no success.

So my question is: what's the right way to overwrite the label of a feature container?

===
Ralph
Re: How to change the Label of a extended featureContainer [message #1692585 is a reply to message #1692456] Thu, 16 April 2015 15:58 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Ralph,

The red color usually indicates that Graphiti has detected an update is required on a particular Pictogram Element. This means that your UpdateFeature.updateNeeded() method returns true, even after your update() has been called (i.e. the element is still considered "dirty" and needs refreshing).

Bob
Re: How to change the Label of a extended featureContainer [message #1693278 is a reply to message #1692585] Wed, 22 April 2015 20:06 Go to previous message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 192
Registered: July 2009
Senior Member
Hi Bob,

thanks for that hint. First I thought I would have understood the concept much better. But after many attempts at the end I did not managed to solve the problem.
My text modification was either displayed in red, or the modification was not adopted after all.

===
Ralph
Previous Topic:Documentation about extending the BPMN 2.0 Modeler
Next Topic:Adding default information for new process files
Goto Forum:
  


Current Time: Fri Apr 19 13:47:42 GMT 2024

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

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

Back to the top