Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » zoomFit and ArrangeAll - problem when together (gmf post from 2007.02.13)
zoomFit and ArrangeAll - problem when together (gmf post from 2007.02.13) [message #230645] Wed, 14 February 2007 20:07 Go to next message
Wiktor is currently offline Wiktor
Messages: 55
Registered: July 2009
Member
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
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 Go to previous message
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
Previous Topic:Resizing children if parent gets resize
Next Topic:Flowlayout and childrens size
Goto Forum:
  


Current Time: Fri Oct 31 21:42:30 GMT 2014

Powered by FUDForum. Page generated in 0.02582 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software