Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » SelectionBorder and Clickarea for polygon
SelectionBorder and Clickarea for polygon [message #727142] Tue, 20 September 2011 14:06 Go to next message
Christian B is currently offline Christian B
Messages: 68
Registered: August 2011
Member
Hi,

How do i get the Polygon as selectionBorder and clickarea and not that rectangle (I assume the rectangle is created graphiti-internal, because it is not from me)?

http://image-upload.de/image/q20fNQ/ad8bb82e6d.jpg

Here is the Code for creating the Polygon
IPeCreateService peCreateService = Graphiti.getPeCreateService();
        ContainerShape containerShape =
            peCreateService.createContainerShape(targetDiagram, true);
        
        int xy[] = new int[] { width / 2, 0, width, height / 2, width / 2,
				height, 0, height / 2 };
		Polygon polygon = gaService.createPolygon(containerShape, xy);


thanks!
Re: SelectionBorder and Clickarea for polygon [message #727147 is a reply to message #727142] Tue, 20 September 2011 14:13 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim Kaiser
Messages: 118
Registered: July 2009
Senior Member
Hi,

you might provide an implementation of
GraphicsAlgorithm getSelectionBorder(PictogramElement pe);
in your ToolBehaviorProvider.

Does it work?

Best, Tim
Re: SelectionBorder and Clickarea for polygon [message #727169 is a reply to message #727147] Tue, 20 September 2011 14:50 Go to previous messageGo to next message
Christian B is currently offline Christian B
Messages: 68
Registered: August 2011
Member
Thats what I tried, but it didn't work:
	public GraphicsAlgorithm getSelectionBorder(PictogramElement pe) {
		IFeatureProvider featureProvider = getFeatureProvider();
		Object bo = featureProvider.getBusinessObjectForPictogramElement(pe);
		...
		} else if (bo instanceof Branch) {
			GraphicsAlgorithm ga = pe.getGraphicsAlgorithm();
			return ga;
		}

		return super.getSelectionBorder(pe);
	}

the GA of the PE is the polygon, so i don't know what else to return in this method...

Where does the rectangle come from?

Re: SelectionBorder and Clickarea for polygon [message #727469 is a reply to message #727169] Wed, 21 September 2011 11:51 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim Kaiser
Messages: 118
Registered: July 2009
Senior Member
Hi,

the issue was raised already:
http://www.eclipse.org/forums/index.php?t=msg&th=206874&start=0&S=7d2c51e325f3fed7874ce866437a3651

and we have a corresponding enhancement request:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=341837

Best, Tim
Re: SelectionBorder and Clickarea for polygon [message #727470 is a reply to message #727169] Wed, 21 September 2011 11:52 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim Kaiser
Messages: 118
Registered: July 2009
Senior Member
ps: The rectangle comes from GFSurroundingHandle...
Re: SelectionBorder and Clickarea for polygon [message #727477 is a reply to message #727470] Wed, 21 September 2011 12:08 Go to previous message
Christian B is currently offline Christian B
Messages: 68
Registered: August 2011
Member
thanks and sry that i missed that!
Previous Topic:BorderDecorator
Next Topic:How to embed a Graphiti-based editor into a multipage editor?
Goto Forum:
  


Current Time: Thu Oct 23 17:52:47 GMT 2014

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

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