Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Selection Behavior problems
Selection Behavior problems [message #1385365] Thu, 05 June 2014 20:27 Go to next message
Simone Di Cola is currently offline Simone Di ColaFriend
Messages: 55
Registered: February 2014
Member
Hi all,
I've a shape like this:

- invisible rectangle
- ellipse
- text

I want only the ellipse and text to be clickable. Following your tutorial http://help.eclipse.org/juno/topic/org.eclipse.graphiti.doc/resources/docu/gfw/selection-behavior.htm?cp=30_1_4_6 I've override the method getClickArea as below (this is just a test):

@Override
	public GraphicsAlgorithm[] getClickArea(PictogramElement pe) {
		if (pe instanceof ContainerShape) {
			GraphicsAlgorithm[] graphicsAlgorithmsList = new GraphicsAlgorithm[100];
			int i =0;
			for (Shape shape : ((ContainerShape) pe).getChildren()) {
				if(shape.getGraphicsAlgorithm().getLineVisible()){
				graphicsAlgorithmsList[i++]=shape.getGraphicsAlgorithm();
				}
			}
		return graphicsAlgorithmsList;
		}
		return super.getClickArea(pe);
	}



but even if this return the ellipse and text, I can still click on the invisible rectangle.

What I am doing wrong here?

Thanks for your help
Simone
Re: Selection Behavior problems [message #1385826 is a reply to message #1385365] Wed, 11 June 2014 12:31 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1635
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Simone,

have you checked if your coding is called at all? E.g. the method will only
be called for active shapes.

Michael
Re: Selection Behavior problems [message #1386445 is a reply to message #1385826] Tue, 17 June 2014 15:24 Go to previous message
Simone Di Cola is currently offline Simone Di ColaFriend
Messages: 55
Registered: February 2014
Member
Yes, I've cheked it.
Previous Topic:Complicated Shapes & Member Access
Next Topic:System in Cloud Modeler 0.1.0
Goto Forum:
  


Current Time: Fri Nov 28 08:52:02 GMT 2014

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

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