Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Connection Selection Tolerance, Adjusting Connection Context, Automatic Layout
Connection Selection Tolerance, Adjusting Connection Context, Automatic Layout [message #911678] Wed, 12 September 2012 01:39 Go to next message
Jeeeyul Lee is currently offline Jeeeyul Lee
Messages: 108
Registered: July 2009
Location: Seoul
Senior Member

Polyline tolerance.

For me, clicking polyline consumes pretty much time. I want to give it some tolerance likes GEF does to let user can easily select connection. Can I do this on Graphiti?



Adjusting CreateConnectionContext

https://raw.github.com/jeeeyul/graphiti-overview/master/net.jeeeyul.erd.resource/connection-figure1.png
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 in isloated space(inside of CreateConnectionFeature) to walk around this problem, but there were several side effects.

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.



Automatic Call of layout feature
https://raw.github.com/jeeeyul/graphiti-overview/master/net.jeeeyul.erd.resource/auto-layout.png
Figure 2


When I removed a column from a table, there will be an empty space.
I can manually call layout feature for resolve this problem,
But I think structural change of PEs should have to call layout feature automatically.




Thanks to great inventors and challengers.

Re: Connection Selection Tolerance, Adjusting Connection Context, Automatic Layout [message #911701 is a reply to message #911678] Wed, 12 September 2012 02:46 Go to previous messageGo to next message
Christian Brand is currently offline Christian Brand
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
Jeeeyul Lee wrote on Wed, 12 September 2012 07:39
Automatic Call of layout feature
https://raw.github.com/jeeeyul/graphiti-overview/master/net.jeeeyul.erd.resource/auto-layout.png
Figure 2


When I removed a column from a table, there will be an empty space.
I can manually call layout feature for resolve this problem,
But I think structural change of PEs should have to call layout feature automatically.




Thanks to great inventors and challengers.



We discussed that topic of calling layout automatically in the first years of Graphiti development (years ago Wink). But if the framework should call the layout feature automatically, which layout feature should be called? That of the diagram? The one of the container? In our discussions we came to the point, that the framework cannot decide when and which layout feature to be called - with more technical exactness: framework decides about the layout context given to the feature provider.

Our recommendation is to call layoutPictogramElement(PictogramElement) - protected method in class AbstractFeature. No one knows better when to layout and what to layout than your tool - exactly: you, the tool designer/developer!

Best regards,
Christian


Christian Brand
SAP AG - Walldorf - Germany

[Updated on: Wed, 12 September 2012 02:59]

Report message to a moderator

Re: Connection Selection Tolerance, Adjusting Connection Context, Automatic Layout [message #911703 is a reply to message #911701] Wed, 12 September 2012 02:52 Go to previous messageGo to next message
Christian Brand is currently offline Christian Brand
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
What do you mean with Quote:
clicking polyline
?? Rolling Eyes


Christian Brand
SAP AG - Walldorf - Germany
Re: Connection Selection Tolerance, Adjusting Connection Context, Automatic Layout [message #911708 is a reply to message #911703] Wed, 12 September 2012 03:06 Go to previous messageGo to next message
Jeeeyul Lee is currently offline Jeeeyul Lee
Messages: 108
Registered: July 2009
Location: Seoul
Senior Member

It means selecting connection. I just want to allows user to select connection with loose accuracy.
Thanks, I can see the reason now for my 3rd question(Automatic Call of layout feature)
Re: Connection Selection Tolerance, Adjusting Connection Context, Automatic Layout [message #911710 is a reply to message #911678] Wed, 12 September 2012 03:10 Go to previous messageGo to next message
Christian Brand is currently offline Christian Brand
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
Jeeeyul Lee wrote on Wed, 12 September 2012 07:39
Adjusting CreateConnectionContext

https://raw.github.com/jeeeyul/graphiti-overview/master/net.jeeeyul.erd.resource/connection-figure1.png
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 in isloated space(inside of CreateConnectionFeature) to walk around this problem, but there were several side effects.

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.



Your case should be quite easy to realize. Just the two methods in your CreateConnectionFeature:
canCreate has to answer true if context's target is table or colum (isn't it a row?).
create has to do the stuff with the table - also the context's target is an inner column.


Christian Brand
SAP AG - Walldorf - Germany
Re: Connection Selection Tolerance, Adjusting Connection Context, Automatic Layout [message #911714 is a reply to message #911708] Wed, 12 September 2012 03:14 Go to previous messageGo to next message
Christian Brand is currently offline Christian Brand
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
Jeeeyul Lee wrote on Wed, 12 September 2012 09:06
It means selecting connection. I just want to allows user to select connection with loose accuracy.
Thanks, I can see the reason now for my 3rd question(Automatic Call of layout feature)

Ah okay now I understand. We are talking about the positioning tolerance of the mouse pointer, when trying to select a line. Is this behavior configurable in GEF? Or is there a better tolerance in GEF? Graphiti's interaction component technically is GEF. So if there are differences, we should investigate.


Christian Brand
SAP AG - Walldorf - Germany
Re: Connection Selection Tolerance, Adjusting Connection Context, Automatic Layout [message #911721 is a reply to message #911708] Wed, 12 September 2012 03:20 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1571
Registered: July 2009
Location: Walldorf, Germany
Senior Member
The hook you are looking for is
IToolBehaviorProvider.getLineSelectionWidth(Polyline).

Michael
Re: Connection Selection Tolerance, Adjusting Connection Context, Automatic Layout [message #911726 is a reply to message #911710] Wed, 12 September 2012 03:34 Go to previous messageGo to next message
Jeeeyul Lee is currently offline Jeeeyul Lee
Messages: 108
Registered: July 2009
Location: Seoul
Senior Member

Quote:
Your case should be quite easy to realize. Just the two methods in your CreateConnectionFeature:
canCreate has to answer true if context's target is table or colum (isn't it a row?).
create has to do the stuff with the table - also the context's target is an inner column.


I tried that, and it worked for result state.
But there were some side effects.
During user creating connection, wrong target & source feedback was provided:
* 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.
Re: Connection Selection Tolerance, Adjusting Connection Context, Automatic Layout [message #911730 is a reply to message #911721] Wed, 12 September 2012 03:44 Go to previous message
Jeeeyul Lee is currently offline Jeeeyul Lee
Messages: 108
Registered: July 2009
Location: Seoul
Senior Member

Quote:
The hook you are looking for is
IToolBehaviorProvider.getLineSelectionWidth(Polyline).

Michael


Thanks!
And sorry Sad

I can't understand why did I could not find this.

[Updated on: Wed, 12 September 2012 03:46]

Report message to a moderator

Previous Topic:Editor dirty handling
Next Topic:Handling business objects shared among different diagrams
Goto Forum:
  


Current Time: Thu Jul 24 11:38:08 EDT 2014

Powered by FUDForum. Page generated in 0.02700 seconds