Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ZoomManager reference for Zest GraphViewer
ZoomManager reference for Zest GraphViewer [message #481490] Fri, 21 August 2009 05:15 Go to next message
sridhar is currently offline sridhar
Messages: 20
Registered: July 2009
Junior Member
Hi,
I am using Zest for visualization.I have a scenario where I need to
have zoom capabilities from toolbar of a editorpart.I have created form in
EditorPart.In the form I have created a toolbar for which I need zoom
capabilities.

Following is the code snippet:

viewer=new GraphViewer(parent,SWT.NONE);
viewer.setContentProvider(new MyContentProvider());
viewer.setLabelProvider(new MyLabelProvider());
viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED|Ze stStyles.CONNECTIONS_SOLID);
viewer.setLayoutAlgorithm(new
SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING)) ;
viewer.setInput(new Object());
toolbarZoomContributionViewItem = new ZoomContributionViewItem(this);
ToolBarManager tbMgr = new ToolBarManager();
tbMgr.add(toolbarZoomContributionViewItem );


Zoom options are working fine for contextmenu operations, but if I
want to get zoom options through toolbar by passing contribution item,its
not possible.

I found zoomTo() method in GraphViewer, but it do not work.
Is there any way to get the ZoomManager reference?
Re: ZoomManager reference for Zest GraphViewer [message #492284 is a reply to message #481490] Mon, 19 October 2009 14:43 Go to previous message
Casey Marshall is currently offline Casey Marshall
Messages: 15
Registered: July 2009
Junior Member
> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--B_3338805406_3394230
Content-type: text/plain;
charset="US-ASCII"
Content-transfer-encoding: 7bit

I ran into this exact same issue and fixed it in Zest. The contribution
item was not fetching the items from the zoom manager for managers other
than MenuManager, and also tool item control was not displaying correctly.
With this change, you won't need to get at the ZoomManager to make the
toolbar work.

Patch against Zest 1.1.0 attached.

Cheers,
Casey

On 8/21/09 4:15 AM, in article
95486b1b32480f00a238879b2c9a8580$1@www.eclipse.org, "sridhar"
<g_sridhar258@yahoo.co.in> wrote:

> Hi,
> I am using Zest for visualization.I have a scenario where I need to
> have zoom capabilities from toolbar of a editorpart.I have created form in
> EditorPart.In the form I have created a toolbar for which I need zoom
> capabilities.
>
> Following is the code snippet:
>
> viewer=new GraphViewer(parent,SWT.NONE);
> viewer.setContentProvider(new MyContentProvider());
> viewer.setLabelProvider(new MyLabelProvider());
> viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED|Ze stStyles.CONNECTIO
> NS_SOLID);
> viewer.setLayoutAlgorithm(new
> SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING)) ;
> viewer.setInput(new Object());
> toolbarZoomContributionViewItem = new ZoomContributionViewItem(this);
> ToolBarManager tbMgr = new ToolBarManager();
> tbMgr.add(toolbarZoomContributionViewItem );
>
>
> Zoom options are working fine for contextmenu operations, but if I
> want to get zoom options through toolbar by passing contribution item,its
> not possible.
>
> I found zoomTo() method in GraphViewer, but it do not work.
> Is there any way to get the ZoomManager reference?
>


--B_3338805406_3394230
Content-type: application/octet-stream; name="zest-toolbar-zoom.patch"
Content-disposition: attachment;
filename="zest-toolbar-zoom.patch"
Content-transfer-encoding: base64


ZGlmZiAtLWdpdCBvcmcuZWNsaXBzZS56ZXN0LmNvcmUvc3JjL29yZy9lY2xp cHNlL3plc3Qv
Y29yZS92aWV3ZXJzL1pvb21Db250cmlidXRpb25WaWV3SXRlbS5qYXZhIG9y Zy5lY2xpcHNl
Lnplc3QuY29yZS9zcmMvb3JnL2VjbGlwc2UvemVzdC9jb3JlL3ZpZXdlcnMv Wm9vbUNvbnRy
aWJ1dGlvblZpZXdJdGVtLmphdmEKaW5kZXggZjc5Mzg3Mi4uNjg3NGJjYyAx MDA2NDQKLS0t
IG9yZy5lY2xpcHNlLnplc3QuY29yZS9zcmMvb3JnL2VjbGlwc2UvemVzdC9j b3JlL3ZpZXdl
cnMvWm9vbUNvbnRyaWJ1dGlvblZpZXdJdGVtLmphdmEKKysrIG9yZy5lY2xp cHNlLnplc3Qu
Y29yZS9zcmMvb3Jn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WJvLmFk
ZFNlbGVjdGlvbkxpc3RlbmVyKG5ldyBTZWxlY3Rpb25BZGFwdGVyKCkgewog CQkJLyoKQEAg
LTEzNCw2ICsxMzgsNyBAQCBwdWJsaWMgY2xhc3MgWm9vbUNvbnRyaWJ1dGlv blZpZXdJdGVt
IGV4dGVuZHMgQ29udHJpYnV0aW9uSXRlbSBpbXBsZW1lbnRzIFpvb21MaQog CQkJCX0KIAkJ
CX0KIAkJfSk7CisJCWNvbWJvLnBhY2soKTsKIAkJcmV0dXJuIHRoaXMuY29t Ym87CiAJfQog
Cg==
--B_3338805406_3394230--
Previous Topic:Hook for GMF editor startup?
Next Topic:Highlighted border width
Goto Forum:
  


Current Time: Fri Aug 22 09:47:40 EDT 2014

Powered by FUDForum. Page generated in 0.01536 seconds