|
Re: zoomFit and ArrangeAll - problem when together (gmf post from 2007.02.13) [message #230678 is a reply to message #230645] |
Wed, 14 February 2007 22:43 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Try setting the zoom in an asyncExec(), or force a performUpdate() on the
UpdateManager before invoking it.
BTW, why're you not executing the command in a command stack?
"Wiktor" <sssnake@wp.pl> wrote in message
news:eqvq56$6p1$1@utils.eclipse.org...
> Hi,
> I posted this problem on GMF group but with no answer. I hope someone here
> could help me.
>
>
> I have my tool on palet to adjust my whole diagram:
>
>
> public class ArrangeAllZoomFitTool extends AbstractTool {
>
> public void activate() {
> DiagramEditDomain domain = (DiagramEditDomain) getDomain();
> RenderedDiagramRootEditPart rootEditPart =
> (RenderedDiagramRootEditPart)
> domain.getDiagramEditorPart().getDiagramGraphicalViewer().ge tRootEditPart();
>
> ArrangeRequest request = new
> ArrangeRequest(ActionIds.ACTION_ARRANGE_ALL);
> Command arrangeCmd =
> rootEditPart.getContents().getCommand(request);
> arrangeCmd.execute();
> rootEditPart.refresh();
>
> rootEditPart.getZoomManager().setZoomAsText(ZoomManager.FIT_ ALL);
> super.deactivate();
> domain.setActiveTool(domain.getDefaultTool());
> }
>
> protected String getCommandName() {
> return "Arrange All ";
> }
> }
>
>
> ArrangeAll works correct (arranges all: new and old elements), but zoom
> does FIT_ALL but fits only to elements from before arrange.
> (e.g.
> 1. I have big zoom in and see one element, second element is far, far away
> and not on visible at this zoom
> 2. I execute arrangeZoomTool
> 3. I have two elements close together, but huge zoom out - as it would
> like to show this "far,far element" moved by arrangeAll)
>
>
> The same problem is also when I run very similar code after each
> operation.
>
>
> Where have I made a mistake?
> Do you have any ideas?
>
> Wiktor
|
|
|
Powered by
FUDForum. Page generated in 0.02311 seconds