Skip to main content



      Home
Home » Modeling » Graphiti » Shape resize behaviour
Shape resize behaviour [message #1050620] Sat, 27 April 2013 09:23 Go to next message
Eclipse UserFriend
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 00:27 Go to previous messageGo to next message
Eclipse UserFriend
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 05:18 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 10:09:08 EDT 2025

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

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

Back to the top