Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Shapes with non-rectangular boundaries
Shapes with non-rectangular boundaries [message #1295726] Mon, 14 April 2014 14:33 Go to next message
Florian Dunz is currently offline Florian DunzFriend
Messages: 20
Registered: March 2014
Junior Member
Hi there,

I've taken a closer look at the shapes of containers and came across a little annoyance. As you can see in the picutre below the bounds of the parallelogram are always rectangular. Those bounds aren't visible till you click on the shape. If there's now a shape right behind this "invisible" boundary I'm not able to click on it.
Is there a way to change the rectanglar boundary to actually fit the parallelogram without any spaces?

index.php/fa/17922/0/

Thanks,
Florian
Re: Shapes with non-rectangular boundaries [message #1295796 is a reply to message #1295726] Mon, 14 April 2014 15:44 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 503
Registered: July 2009
Location: Nantes, France
Senior Member
Le 14/04/2014 16:33, Florian Dunz a écrit :
> Hi there,
Hi Florian,

>
> I've taken a closer look at the shapes of containers and came across a little annoyance. As you can see in the picutre below the bounds of the parallelogram are always rectangular. Those bounds aren't visible till you click on the shape. If there's now a shape right behind this "invisible" boundary I'm not able to click on it.
> Is there a way to change the rectanglar boundary to actually fit the parallelogram without any spaces?

Non rectangular shapes are currently considered rectangular for edges
connections, selection, ... Unfortunately there is no way to simply
change this.

If you provide your own figure to Sirius, you might try the following
tips, but this could have side effects and it could not be sufficient to
get other features work in a non rectangular way (resize, feedback,
handles, ...):
. It is possible to define a polygon on which the edges have to
be connected, see
org.eclipse.gmf.runtime.draw2d.ui.figures.IPolygonAnchorableFigure.getPolygonPoints()
and a tutorial [1]

. For the selection issue, an entry point is
org.eclipse.draw2d.IFigure.containsPoint().
Its base implementation (org.eclipse.draw2d.Figure) simply returns
getBounds.contains(x,y).


Thanks for your feedback, this looks like an interesting area to explore
for the Sirius shapes and styles. The team is aware of this but but have
no plans to work on it in the following weeks. That said this bug can
move forward if you provide a fix for it (see the Contributor Guide) or
you contact Obeo for sponsored work. "

>
>
>
> Thanks,
> Florian
>


Regards,

Maxime


[1] http://gmfsamples.tuxfamily.org/wiki/doku.php?id=gmf_tutorial4


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Shapes with non-rectangular boundaries [message #1298604 is a reply to message #1295796] Wed, 16 April 2014 11:27 Go to previous messageGo to next message
Florian Dunz is currently offline Florian DunzFriend
Messages: 20
Registered: March 2014
Junior Member
Maxime Porhel wrote on Mon, 14 April 2014 17:44

Hi Florian,

Non rectangular shapes are currently considered rectangular for edges
connections, selection, ... Unfortunately there is no way to simply
change this.

If you provide your own figure to Sirius, you might try the following
tips, but this could have side effects and it could not be sufficient to
get other features work in a non rectangular way (resize, feedback,
handles, ...):
. It is possible to define a polygon on which the edges have to
be connected, see
org.eclipse.gmf.runtime.draw2d.ui.figures.IPolygonAnchorableFigure.getPolygonPoints()
and a tutorial

. For the selection issue, an entry point is
org.eclipse.draw2d.IFigure.containsPoint().
Its base implementation (org.eclipse.draw2d.Figure) simply returns
getBounds.contains(x,y).


Thanks for your feedback, this looks like an interesting area to explore
for the Sirius shapes and styles. The team is aware of this but but have
no plans to work on it in the following weeks. That said this bug can
move forward if you provide a fix for it (see the Contributor Guide) or
you contact Obeo for sponsored work. "

Regards,

Maxime


Thanks for the quick reply!

Both tips were really helpful. I've achieved being able to click through the "invisible" areas to select an element behind it.
org.eclipse.draw2d.IFigure.containsPoint() was the right method to look at.

Florian
Re: Shapes with non-rectangular boundaries [message #1321360 is a reply to message #1295726] Tue, 29 April 2014 08:33 Go to previous messageGo to next message
Florian Dunz is currently offline Florian DunzFriend
Messages: 20
Registered: March 2014
Junior Member
Hi there,

previously I've been modifying your actual Sirius code and was able to create my required behaviour.
Now I've started using the provieded extension-points, in this case the
org.eclipse.gmf.runtime.diagram.ui.editpartProviders

However this comes with a problem, the containsPoint method seems to be ignored. Here's my rough setup:
I'm providing an editpart which extends AbstractNotSelectableShapeNodeEditPart and implements IStyleEditPart. This editpart creates a shape as its plate and its primaryShape, which extends AbstractGeoShapePolygonFigure and implements StyledFigure. The shape overrides the containsPoint method.

Now the way a shape is created and displayed it has a parent, in this case a DNode3EditPart. The nodeplate of this DNode3EditPart is an AirDefaultSizeNodeFigure which also has a containsPoint method.

If I click on the shape in the editor both containsPoint methods will be called but the method of AirDefaultSizeNodeFigure seems to be more important than mine inside the shape. It doesn't matter what the method in the shape returns.

How do I make the containsPoint method of the shape more "important"? I don't want to modify the Sirius code anymore and don't know how to get this to work.

Thanks,
Florian
Re: Shapes with non-rectangular boundaries [message #1333733 is a reply to message #1321360] Mon, 05 May 2014 07:44 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 564
Registered: July 2009
Senior Member
Le 29/04/2014 10:33, Florian Dunz a écrit :
> Hi there,

Hi.

> Here's my rough setup:
> I'm providing an editpart which extends
> AbstractNotSelectableShapeNodeEditPart and implements IStyleEditPart.
> This editpart creates a shape as its plate and its primaryShape, which
> extends AbstractGeoShapePolygonFigure and implements StyledFigure. The
> shape overrides the containsPoint method.
>
> Now the way a shape is created and displayed it has a parent, in this
> case a DNode3EditPart. The nodeplate of this DNode3EditPart is an
> AirDefaultSizeNodeFigure which also has a containsPoint method.
>
> If I click on the shape in the editor both containsPoint methods will be
> called but the method of AirDefaultSizeNodeFigure seems to be more
> important than mine inside the shape. It doesn't matter what the method
> in the shape returns.
>
> How do I make the containsPoint method of the shape more "important"? I
> don't want to modify the Sirius code anymore and don't know how to get
> this to work.

From what I read of your analysis it does not seem possible without
changing Sirius itself (I have not checked myself). Given the way Draw2D
hit testing works [1], the behavior you want would require changes in
the structure of our Draw2D figures and/or in their implementation of
containsPoint(). Feel free to open and enhancement request on the bugzilla.

Regards,
Pierre-Charles David

[1]
http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.draw2d.doc.isv%2Fguide%2Fhittest.html&cp=24_0_1_3


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:java.lang.IllegalStateException: Cannot modify resource set without a write transaction
Next Topic:RefreshRepresentationsCommand causes Sirius to freeze
Goto Forum:
  


Current Time: Wed Apr 21 04:30:23 GMT 2021

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

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

Back to the top