Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363796 - Make setting of selection width of connections public
Summary: Make setting of selection width of connections public
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.9.0   Edit
Assignee: Michael Wenz CLA
QA Contact:
URL:
Whiteboard: Juno M5 Theme_round_offs
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-15 06:01 EST by Christian B CLA
Modified: 2012-06-29 04:17 EDT (History)
2 users (show)

See Also:
michael.wenz: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian B CLA 2011-11-15 06:01:20 EST
Build Identifier: 

The minimum selection width is set to 5 per default in org.eclipse.graphiti.ui.internal.figures.GFPolyline. There is a public setter for this attribute:
/**
* Sets the selection tolerance. This is the minimum line-width, which is
* still considered to be a selection of the polyline, independent from the
* real line-width. For a small line-width this makes it easier to select
* the polyline.
* 
* @param minimumSelectionLineWidth
*            The new minimum selection line-width to set.
*/
public void setMinimumSelectionLineWidth(int minimumSelectionLineWidth) {
	this.minimumSelectionLineWidth = minimumSelectionLineWidth;
}

This setter is never used. The minimum selection width should be settable by the user in the OTXToolBehaviourProvider. This should either be in a separate method (all connections have the same settable minimum selection width) or it could be included to the method "public ISelectionInfo getSelectionInfoForConnection(Connection connection)". The minimum selection width could be added to SelectionInfoImpl, then connections could have different minum selection widths.

This is the forum thread, where this this topic arised:
http://www.eclipse.org/forums/index.php/t/242502/

Reproducible: Always
Comment 1 Michael Wenz CLA 2011-12-30 09:55:18 EST
The selection width is not only relevant for connections but also for shapes being represented as line (e.g. Polyline); clients may want to influence the selection width for those objects as well.
ISelectionInfo and the according method targets something a little different than what we have here: it is called _after_ the selection has taken place.

I have added a method getLineSelectionWidth(Polyline polyline) to the tool behavior provider that is called the when the line shape is drawn (on creation of a new Polyline or on opening the diagram), where clients can return an individual selection width. Default return value is 5 as before.

Checked-in to head and pushed to Eclipse:
commit 30ef7ca66f8b1751bdbeeacd4b700477ea2c4c74
Author: mwenz <michael.wenz@sap.com> 2011-12-30 15:36:48
Committer: mwenz <michael.wenz@sap.com> 2011-12-30 15:36:48
Parent: a4dc363edfbadb61ea8897069fe9683ab3af0289 (Bug 324556 - Hide Shapes - enable simple collapse/expand by preventing an IllegalStateException when trying to select an invisible shape)
Branches: origin/master, master
Comment 2 Michael Wenz CLA 2012-04-11 10:50:34 EDT
Bookkeeping: Set target release
Comment 3 Michael Wenz CLA 2012-06-29 04:17:28 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)