Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » intersecting elements
intersecting elements [message #213815] Tue, 11 April 2006 12:42
Steffen K is currently offline Steffen KFriend
Messages: 2
Registered: July 2009
Junior Member
Hello!

I am working on an editor representing a diagram. For that purpose I am
using GEF and draw2d.

Now I want to forbid intersection of elements (draw2d.Figures) in the
diagram.
How can I check if two figures are intersecting?

I created a command that inserts a new element on the mouse's position.
I should possibly forbid the insertion of a new intersecting Figure by
working on the canExecute method of the command.

My actual method looks like :


private NodeModelElement newNode;

private IContainerElement container;

private Rectangle bounds;

public boolean canExecute() {
return (newNode != null && container != null && bounds != null);
}


I have the position of the new Figure (bounds) but I have to check if
there is already an element on the clicked location. How can I verify that?
Or is there another way to avoid intersection of elements in GEF?

Thanks in advance,

Steffen
Previous Topic:How to make tools update their state when the active tool changes?
Next Topic:Rename label of delete Action
Goto Forum:
  


Current Time: Sun Dec 04 16:50:28 GMT 2022

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

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

Back to the top