Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Draw2D zooming
Draw2D zooming [message #228792] Wed, 10 January 2007 10:24 Go to next message
Manuel Selva is currently offline Manuel SelvaFriend
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member
Hi all,

I a m trying to use the Zoom capability provided by draw2d. I found some
examples in the GEF examples plugin. It works fine but i still have a
problem. In these example no ScalabledLayerdPane are used. Instead of this
a ZoomContainerFigure is created and ovveride the paintClientArea method
to take into account a zoom factor using a scaled graphic.

I tried to use instead of this the provided class ScalableLayeredPane but
using this figure i can't get anything displayed.

Does anybody used it and have you a sample program showing how to use it ??

Thanks

Manu


Re: Draw2D zooming [message #228905 is a reply to message #228792] Thu, 11 January 2007 13:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: news.madlener.online.de

Hi Manu,

i found this in the LogicExample:

LogicEditor line 407:

[...]
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
ScrollingGraphicalViewer viewer =
(ScrollingGraphicalViewer)getGraphicalViewer();

ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();

List zoomLevels = new ArrayList(3);
zoomLevels.add(ZoomManager.FIT_ALL);
zoomLevels.add(ZoomManager.FIT_WIDTH);
zoomLevels.add(ZoomManager.FIT_HEIGHT);
root.getZoomManager().setZoomLevelContributions(zoomLevels);

IAction zoomIn = new ZoomInAction(root.getZoomManager());
IAction zoomOut = new ZoomOutAction(root.getZoomManager());
getActionRegistry().registerAction(zoomIn);
getActionRegistry().registerAction(zoomOut);
getSite().getKeyBindingService().registerAction(zoomIn);
getSite().getKeyBindingService().registerAction(zoomOut);
[...]

hope this is of any help to you ;)

cheers

Oliver


MaManu wrote:
> Hi all,
>
> I a m trying to use the Zoom capability provided by draw2d. I found some
> examples in the GEF examples plugin. It works fine but i still have a
> problem. In these example no ScalabledLayerdPane are used. Instead of
> this a ZoomContainerFigure is created and ovveride the paintClientArea
> method to take into account a zoom factor using a scaled graphic.
>
> I tried to use instead of this the provided class ScalableLayeredPane
> but using this figure i can't get anything displayed.
> Does anybody used it and have you a sample program showing how to use it ??
>
> Thanks
>
> Manu
>
Re: Draw2D zooming [message #228919 is a reply to message #228905] Thu, 11 January 2007 14:23 Go to previous messageGo to next message
Manuel Selva is currently offline Manuel SelvaFriend
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member
Thanks Oliver,

I also founded this piece of code in the logic Example this morning and
solved my problem.

Thanks

Manu


Re: Draw2D zooming [message #228927 is a reply to message #228919] Thu, 11 January 2007 14:49 Go to previous messageGo to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> manuel.selva@st.com (Manu):

> I also founded this piece of code in the logic Example this morning
> and solved my problem.

Is your zoom combo box enabled?

Mine isn't (I've also copied from the logic Example today).

But I did succeed in getting the zoom in and zoom out toolbuttons.
Re: Draw2D zooming [message #228943 is a reply to message #228927] Thu, 11 January 2007 15:10 Go to previous message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Steinar Bang <sb@dod.no>:

>>>>> manuel.selva@st.com (Manu):
>> I also founded this piece of code in the logic Example this morning
>> and solved my problem.

> Is your zoom combo box enabled?

> Mine isn't (I've also copied from the logic Example today).

> But I did succeed in getting the zoom in and zoom out toolbuttons.

I've now successfully enabled the zoom combo box.

I had to implement the ERDiagramEditor#getAdapter() method,
as defined in the IBM "Using the Graphical Editor Framework
and the Eclipse Modeling Framework", on page 146/147 (and in the
LogicEditor of the example, for that matter. But the redbook actually
_explains_ it...:-) ).

The redbook can be found at:
http://www.redbooks.ibm.com/redbooks/pdfs/sg246302.pdf
Previous Topic:No Draw2D docs for eclipse 3.2?
Next Topic:Memory leak - unable to dispose of PaletteEntry images
Goto Forum:
  


Current Time: Thu Dec 09 05:18:11 GMT 2021

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

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

Back to the top