|
Re: Bend points and Graphical Editor scroll bars [message #919603 is a reply to message #919016] |
Sat, 22 September 2012 06:02 |
Igor Zapletnev Messages: 33 Registered: September 2012 |
Member |
|
|
Hi,
Viewport.class responsible for scrolls behaviour. For example, to move scrolls on x and y I am using next method:
private void doStep(final Point step) {
final Viewport viewport = findViewport(owner);
final Point location = new Point(viewport.getViewLocation());
viewport.setViewLocation(location.translate(step));
viewport.revalidate();
}
To implement custom behavoir for your case you need to define ViewportAutoexposeHelper. Your ScalableFreeformRootEditPart should be adapted to the AutoexposeHelper.class like this:
public Object getAdapter(final Class key) {
if (key == AutoexposeHelper.class)
return new YourAwareAutoexposeHelper();
return super.getAdapter(key);
}
But it is all only for content layer. To implement the same behaviour for connections layer I am defining my own connection creation tool (it also will use your autoexpose helper class). I have attached simple example of that.
[Updated on: Sat, 22 September 2012 06:05] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03695 seconds