Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Check if there is any PE at a given location in a Diagram?
Check if there is any PE at a given location in a Diagram? [message #898720] Fri, 27 July 2012 10:56 Go to next message
Surya Kathayat is currently offline Surya KathayatFriend
Messages: 44
Registered: July 2012
Member
Hi,

I have a reference to a Diagram and an AddContext.

I want to add a Node in the Diagram at the given location. But I want to make sure that no other element(node) is present in the diagram at the given location.

Is there any way/method available to check that?

Thank you.

BR
Surya
Re: Check if there is any PE at a given location in a Diagram? [message #898727 is a reply to message #898720] Fri, 27 July 2012 11:23 Go to previous message
Matthias Gorning is currently offline Matthias GorningFriend
Messages: 81
Registered: April 2010
Location: Germany
Member
You can ask the AddContext for the target container.

In your add feature you can do it in this way:

public boolean canAdd(IAddContext context) {
	if (context.getTargetContainer() instanceof Diagram){
		return true;
	}
	return false;
}



Currently there is no service in Graphiti with that you can ask the diagram whether there is a pictogram element at a given location or not.

BR,
Matthias
Previous Topic:Resize without resizing subshapes
Next Topic:Pallete icons don't show up
Goto Forum:
  


Current Time: Thu Nov 27 03:02:18 GMT 2014

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

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