|
Re: Zoom funtion in a View? [message #558712 is a reply to message #558462] |
Tue, 14 September 2010 07:52 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
((ScalableRootEditPart) getGraphicalViewer().getRootEditPart()).getZoomManager()
or
((ScalableFreeFormRootEditPart) getGraphicalViewer().getRootEditPart()).getZoomManager()
reuse org.eclipse.gef.ui.actions.ZoomInAction and org.eclipse.gef.ui.actions.ZoomOutAction
also org.eclipse.gef.ui.actions.ZoomComboContributionItem
hope this helps
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
Re: Zoom funtion in a View? [message #558726 is a reply to message #558720] |
Tue, 14 September 2010 08:47 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
In view you can have view actions,add them using viewactions extention point or IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager(); in createPartControl method...
add the specified actions and contribution items by providing them with zoommanager from your specific edit part...
for example in createPartControl you can call this method
/**
* This method defines and adds all the actions required for UI functions required in the
* Graphical Viewer, to the Menu Manager.
*/
private final void appendActions()
{
IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
List<IAction> toolBarLayoutActions = new ArrayList<IAction>();
ZoomManager zoomManager = getZoomManager();
if (zoomManager != null)
{
zoomManager.setZoomLevels(new double[] { .1, .3, .5, .7, 1.0, 1.5, 3, 6, 10, 15 });
zoomInAction = new ZoomInAction(zoomManager);
// Set ActionDefinitionId to null to disable GEF action id which is the Key binding
zoomInAction.setActionDefinitionId(null);
toolBarLayoutActions.add(zoomInAction);
zoomOutAction = new ZoomOutAction(zoomManager);
// Set ActionDefinitionId to null to disable GEF action id which is the Key binding
zoomOutAction.setActionDefinitionId(null);
toolBarLayoutActions.add(zoomOutAction);
String[] zoomStrings = new String[] { ZoomManager.FIT_ALL, ZoomManager.FIT_HEIGHT,
ZoomManager.FIT_WIDTH };
zoomComboContributionItem = new ZoomComboContributionItem(this,
zoomStrings);
getViewSite().getActionBars().getToolBarManager().add(zoomComboContributionItem);
ArrayList<String> contributions = new ArrayList<String>();
contributions.add(ZoomManager.FIT_ALL);
contributions.add(ZoomManager.FIT_HEIGHT);
contributions.add(ZoomManager.FIT_WIDTH);
zoomManager.setZoomLevelContributions(contributions);
}
}
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
[Updated on: Tue, 14 September 2010 10:13] Report message to a moderator
|
|
|
|
Re: Zoom funtion in a View? [message #558834 is a reply to message #558794] |
Tue, 14 September 2010 15:03 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
show me your implementation of getZoomManager();
and also how are you drawing your diagrams using gefvieweer or plain draw2d???
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
|
Re: Zoom funtion in a View? [message #558851 is a reply to message #558839] |
Tue, 14 September 2010 15:33 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
What do you mean by "Then I created a View which shows the mindmap, but with pictures"
can you show me a screen shot of your view...???
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
Re: Zoom funtion in a View? [message #559134 is a reply to message #559114] |
Wed, 15 September 2010 17:26 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
as i suspected your view does not have GEF or GMF components,
probably only swt components,so may be this will help...
still you can post u r image here by uploading it in u r picasa album(gmail account) and pasting the link here...
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
|
|
Re: Zoom funtion in a View? [message #559164 is a reply to message #559158] |
Wed, 15 September 2010 19:53 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
that will not help Mikkel...
first u send me the screen shot then may be we can see what can be done....
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
Re: Zoom funtion in a View? [message #559739 is a reply to message #559727] |
Fri, 17 September 2010 19:17 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
Ya mikkel, i saw u r screen shot,
lets end this topic here n countinue on mail,
check u r mail..
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
Powered by
FUDForum. Page generated in 0.04046 seconds