Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Implement Rotate method for Pictogram Element(Implement Rotate method for Pictogram Element )
Implement Rotate method for Pictogram Element [message #771139] Mon, 26 December 2011 12:38 Go to next message
Vinod Kannur is currently offline Vinod KannurFriend
Messages: 7
Registered: October 2011
Junior Member
Hi All,

I am trying to implement rotate feature in custom feature provider for pictogram element(polygon). I am not sure how to achieve this. I have a tab strip with rotate for the pictogram element. I need to implement rotate functionality for the pictogram element.
Please find the attached image for clarity.

public class LaneSwitchDirectionCustomFeature extends AbstractPMCustomFeature{

	public LaneSwitchDirectionCustomFeature(ICustomContext context, IFeatureProvider fp) {
		super(context, fp);

	public String getImageId() {
		return PMToolSpecificImageProvider.IMG_ROTATE;
	public void execute(ICustomContext context) {
		execute((IContext) context);

public void execute(IContext context) {
		ContainerShape containerShape = null;
		if(context instanceof CustomContext){
			CustomContext cContext = (CustomContext) context;
				if(cContext.getInnerPictogramElement() instanceof ContainerShape){     
					containerShape = (ContainerShape) cContext.getInnerPictogramElement();
		else if(context instanceof PictogramElementContext){
			containerShape = (ContainerShape) ((PictogramElementContext) context).getPictogramElement();
			GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();

Graphics algorithm do not have built in rotate methods. Do we need to redraw the pictogram element by specifying coordinate points? Is there any best option to achieve this?Even after rotating the pictogram element the tab strip should appear.

Thanks in Advance.

Re: Implement Rotate method for Pictogram Element [message #771889 is a reply to message #771139] Wed, 28 December 2011 13:10 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1894
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hi Vinod,

Graphiti can only rotate Texts (and new MultiTexts) but not pictogram
elements in general. So you wil have to do the rotation by calculating and
setting appropriate coordinates for your polygon points.

Previous Topic:Collapse Feature: how to hide an element?
Next Topic:Other types of ConnectionRouter?
Goto Forum:

Current Time: Fri Jun 22 04:03:46 GMT 2018

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

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

Back to the top