Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Shape resize behaviour
Shape resize behaviour [message #1050620] Sat, 27 April 2013 13:23 Go to next message
Christian Pelster is currently offline Christian PelsterFriend
Messages: 23
Registered: January 2010
Junior Member
Hi all,

I have another question this time regarding the resize behaviour:

I'm following the tutorial and now have a EClass representation that looks like this:

-------------
| Classname |
|xxxxxxxxxxx|
|           |
|           |
|           |
------------


xxxxxxxx is a polyline. The problem is that the xxxxxx line does not get resized when the container does. Is there a way to get the line to take it's width from the container?
If not what is the best way to implement my own resize behaviour? Custom Shape Implementation, custom resize Feature, ...?

Regards,

Pelle
Re: Shape resize behaviour [message #1051657 is a reply to message #1050620] Mon, 29 April 2013 04:27 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 27.04.13 06.23, Christian Pelster wrote:
> Hi all,
>
> I have another question this time regarding the resize behaviour:
>
> I'm following the tutorial and now have a EClass representation that
> looks like this:
>
>
> -------------
> | Classname |
> |xxxxxxxxxxx|
> | |
> | |
> | |
> ------------
>
>
> xxxxxxxx is a polyline. The problem is that the xxxxxx line does not get
> resized when the container does. Is there a way to get the line to take
> it's width from the container?
> If not what is the best way to implement my own resize behaviour? Custom
> Shape Implementation, custom resize Feature, ...?

I think a custom layout feature is appropriate for this case.

Hallvard
Re: Shape resize behaviour [message #1051841 is a reply to message #1051657] Mon, 29 April 2013 09:18 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Christian,

what Hallvard wrote is correct. Probably you have just overlooked the
according lines in the layout feature described in the tutorial:
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.graphiti.doc%2Fresources%2Fdocu%2Fgfw%2Flayout-feature.htm&cp=30_1_3_6

if (graphicsAlgorithm instanceof Polyline) {
Polyline polyline = (Polyline) graphicsAlgorithm;
Point secondPoint = polyline.getPoints().get(1);
Point newSecondPoint =
gaService.createPoint(containerWidth, secondPoint.getY());
polyline.getPoints().set(1, newSecondPoint);
anythingChanged = true;

Cares about updating the length of the line.

Michael
Previous Topic:Getting the selected connection
Next Topic:Direct editing for connection decorators?
Goto Forum:
  


Current Time: Thu Apr 18 07:07:46 GMT 2024

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

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

Back to the top