Skip to main content



      Home
Home » Eclipse Projects » GEF » How to FIT_ALL for newly opened file?
How to FIT_ALL for newly opened file? [message #168712] Thu, 17 February 2005 17:24 Go to next message
Eclipse UserFriend
I'm using ScalableFreeformRootEditPart and I'd like to automatically do a
FIT_ALL when the editor is initially opened.

I've tried the following right after InitializeGraphicalViewer():

((ScalableFreeformRootEditPart)viewer.getRootEditPart()).get ZoomManager().se
tZoomAsText(ZoomManager.FIT_ALL);

but I end up with my graphics stuffed into a 36x36 square because that's how
big the client area claims to be.

If I don't do anything, the initial view will be zoomed in too close to be
meaningful. (My coordinates span values in the thousands both positive and
negative - so I'm depending on the ScalableFreeformRootEditPart to scale it
all to fit on the screen.)

Where's a better place for me to perform my initial FIT_ALL?

Thanks,

Jim
Re: How to FIT_ALL for newly opened file? [message #168765 is a reply to message #168712] Fri, 18 February 2005 13:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You probably need to wait until your editor's control has been resized.

"Jim Reed" <jim_reed@mentorg.com> escreveu na mensagem
news:cv35i0$bf0$1@www.eclipse.org...
> I'm using ScalableFreeformRootEditPart and I'd like to automatically do a
> FIT_ALL when the editor is initially opened.
>
> I've tried the following right after InitializeGraphicalViewer():
>
> ((ScalableFreeformRootEditPart)viewer.getRootEditPart()).get ZoomManager().se
> tZoomAsText(ZoomManager.FIT_ALL);
>
> but I end up with my graphics stuffed into a 36x36 square because that's
> how
> big the client area claims to be.
>
> If I don't do anything, the initial view will be zoomed in too close to be
> meaningful. (My coordinates span values in the thousands both positive
> and
> negative - so I'm depending on the ScalableFreeformRootEditPart to scale
> it
> all to fit on the screen.)
>
> Where's a better place for me to perform my initial FIT_ALL?
>
> Thanks,
>
> Jim
>
>
>
Re: How to FIT_ALL for newly opened file? [message #169308 is a reply to message #168712] Tue, 22 February 2005 12:01 Go to previous message
Eclipse UserFriend
I've solved my problem as follows:

In configureGraphicalViewer(), right after setting the root edit part for
the viewer, I call
root.getFigure().setVisible(false);
to ensure that none of the graphics will be drawn.

Then in my WorkbenchAdvisor.openEditor(), once my editor is opened, I get
the ZoomManager and perform the FIT_ALL, then I call setVisible(true) on the
root figure so that it will be displayed.

Jim
Previous Topic:Can i capture the snapshot of the editor in a JPEG file?
Next Topic:REQ_DELETE_DEPENDANT
Goto Forum:
  


Current Time: Fri Jun 13 09:06:29 EDT 2025

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

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

Back to the top