|
Re: Shapes with non-rectangular boundaries [message #1295796 is a reply to message #1295726] |
Mon, 14 April 2014 15:44 |
|
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 |
Florian Dunz 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 #1333733 is a reply to message #1321360] |
Mon, 05 May 2014 07:44 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04565 seconds