|
|
|
|
Re: Scrolling / zooming programmatically [message #725592 is a reply to message #725245] |
Thu, 15 September 2011 09:54 |
Michael Wenz Messages: 1931 Registered: July 2009 Location: Walldorf, Germany |
Senior Member |
|
|
Andreas,
the selection method only uses the first element in the given array, that's
what GEF allows there. So this explains the behavior you have noticed.
Michael
"Andreas Graf" schrieb im Newsbeitrag news:j4q1dq$45e$1@news.eclipse.org...
Hi Jos,
here is my code:
public void execute(ICustomContext context) {
PictogramElement[] pes = context.getPictogramElements();
if (pes != null && pes.length == 1) {
PictogramElement pe = pes[0];
if(pe instanceof Connection)
{
Anchor sa = ((Connection) pe).getStart();
Anchor se = ((Connection) pe).getEnd();
getFeatureProvider().getDiagramTypeProvider().getDiagramEditor().selectPictogramElements(new
PictogramElement[] {
sa.getParent(),
se.getParent()
});
}
}
}
(I am selecting the peers of a connection).
However, there is no scrolling in this case. (see attached screenshot).
If I reverse the order of pictogram elements, (se.getParent(),
sa.getParent()) I see some scrolling. I guess it depends on primary /
secondary selection?.
Regards,
Andreas
|
|
|
|
Powered by
FUDForum. Page generated in 0.03160 seconds