Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359132 - Connection text decorator should not be allowed to move away far from connection
Summary: Connection text decorator should not be allowed to move away far from connection
Status: CLOSED WONTFIX
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-27 15:40 EDT by Shenxue Zhou CLA
Modified: 2011-09-29 07:14 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shenxue Zhou CLA 2011-09-27 15:40:36 EDT
If a text decorator is added to a connection, user can move the text decorator around. This is a nice feature. But it seems the user is given too much freedom here. The text decorator can be moved very far away from the connection and this could be misleading. If fact, the text decorator for one connection could be mis-regarded as another connection's decorator.

We should limit the text decorator movement so that it always stays close to the connection.
Comment 1 Michael Wenz CLA 2011-09-28 10:52:47 EDT
I would see a functionality like this rather at tool level. The tool developer can implement a restriction like this inside his own subclass of DefaultMoveBendpointFeature.
This is especially true if one considers that I would find it rather hard to define a general limit for the distance that is valid accross all tools, as it would be necessary if we implement this inside the Graphiti framework.
Just let me know if you have a different opinion on this.
Comment 2 Shenxue Zhou CLA 2011-09-28 11:51:21 EDT
(In reply to comment #1)
> I would see a functionality like this rather at tool level. The tool developer
> can implement a restriction like this inside his own subclass of
> DefaultMoveBendpointFeature.
> This is especially true if one considers that I would find it rather hard to
> define a general limit for the distance that is valid accross all tools, as it
> would be necessary if we implement this inside the Graphiti framework.
> Just let me know if you have a different opinion on this.

That's a reasonable approach. I just experimented with my move connection decorator feature and if I return "false" in canMoveConnectionDecorator method, then the decorator won't be moved.

How could I access the coordinates of the connection polyline?

Thanks!
Comment 3 Michael Wenz CLA 2011-09-29 07:14:26 EDT
The Polyline object has a list of its bendpoints (getPoints() method). Each point can be queried for its x and y coordinates.