Search in sources :

Example 1 with ZoomManager

use of org.eclipse.gef4.zest.core.widgets.zooming.ZoomManager in project netxms by netxms.

the class ExtendedGraphViewer method createZoomActions.

/**
 * Create zoom actions
 * @return
 */
public Action[] createZoomActions(IHandlerService handlerService) {
    final ZoomManager zoomManager = getZoomManager();
    final Action[] actions = new Action[zoomLevels.length];
    for (int i = 0; i < zoomLevels.length; i++) {
        actions[i] = new ZoomAction(zoomLevels[i], zoomManager);
        if (zoomLevels[i] == 1.00) {
            actions[i].setChecked(true);
            // $NON-NLS-1$
            actions[i].setId("org.netxms.ui.eclipse.networkmaps.localActions.AbstractMap.Zoom100Pct");
            // $NON-NLS-1$
            actions[i].setActionDefinitionId("org.netxms.ui.eclipse.networkmaps.localCommands.AbstractMap.Zoom100Pct");
            handlerService.activateHandler(actions[i].getActionDefinitionId(), new ActionHandler(actions[i]));
        }
    }
    return actions;
}
Also used : Action(org.eclipse.jface.action.Action) ZoomManager(org.eclipse.gef4.zest.core.widgets.zooming.ZoomManager) ActionHandler(org.eclipse.jface.commands.ActionHandler) Point(org.eclipse.swt.graphics.Point)

Aggregations

ZoomManager (org.eclipse.gef4.zest.core.widgets.zooming.ZoomManager)1 Action (org.eclipse.jface.action.Action)1 ActionHandler (org.eclipse.jface.commands.ActionHandler)1 Point (org.eclipse.swt.graphics.Point)1