Adjusting CreateConnectionContext [message #915388] |
Mon, 17 September 2012 07:30 |
|
Adjusting CreateConnectionContext
Figure 1
As you can see on Figure 1, Creation Connection feedback shows negative mouse pointer to users.
Because, table can reference only tables, not columns.
In common sense, we know that user is not trying to connect table to column.
But ICreateConnectionContext is automatically populated, and there is no chance to adjust context.
I tried some hack(commented by Christian Brand - let some methods works against of column context) in isolated space(inside of CreateConnectionFeature) to walk around this problem, but there were several side effects in Feedback UI:
* When connection started from column, feedback seems to uses column PE's chopbox anchor, not table.
* Target table may be highlighted when mouse is over. But column will be highlighted because it is active PE.
I can use transformed context for canCreate, canStartConnection, create, but I can't handle automatically populated feedback UI. so, I think transforming context should have to be part of graphiti.
ToolBehaviorProvider provides a way to adjust location info for direct editing, I think it would be great what if there is some adjust method like ToolBehaviorProvider#getLocationInfo.
Each creatation of connection may have different sense, So I suggest that locate adjust method onto create connection feature.
|
|
|
|
Re: Adjusting CreateConnectionContext [message #916610 is a reply to message #916583] |
Wed, 19 September 2012 08:21 |
|
Quote:
IToolBehaviorProvider.getChopboxAnchorArea should be the hook you are
looking for.
Thanks!
IToolBehaviorProvider.getChopboxAnchorArea seems to let me can choose graphics algorithm for PE to use as chopbox anchor. So I tried some experiments and debugged.
But IAnchorContainerDelegate doesn't allow to use chopbox target as a GA which is not contained by PE.
It simply ignored what toolbarBehavior returned. I think it tries to find actual draw2d figure in child direction only.
So in my case, I can't delegate column PE's anchor to table PE's GA.
As a result, There was no change. (fall back algorithm was applied).
No matter whether IAnchorContainerDelegate allows none-contained GA as an anchor or not, There are still some problems remains:
* Each connection creation may have different nature and sense.
* Implementation of a CreateConnectionFeature easily get too complex.
|
|
|
|
Powered by
FUDForum. Page generated in 0.05371 seconds