Search in sources :

Example 46 with ZoomManager

use of org.eclipse.gef.editparts.ZoomManager in project jbosstools-hibernate by jbosstools.

the class DiagramViewer method getFitWidthZoomValue.

public double getFitWidthZoomValue() {
    double res = 1.0;
    ZoomManager manager = (ZoomManager) getGraphicalViewer().getProperty(ZoomManager.class.toString());
    Method m = null;
    try {
        // $NON-NLS-1$
        m = manager.getClass().getDeclaredMethod("getFitWidthZoomLevel");
        m.setAccessible(true);
        res = (Double) m.invoke(manager);
    } catch (SecurityException e) {
    } catch (NoSuchMethodException e) {
    } catch (IllegalArgumentException e) {
    } catch (IllegalAccessException e) {
    } catch (InvocationTargetException e) {
    }
    return res;
}
Also used : ZoomManager(org.eclipse.gef.editparts.ZoomManager) Method(java.lang.reflect.Method) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

ZoomManager (org.eclipse.gef.editparts.ZoomManager)46 Point (org.eclipse.draw2d.geometry.Point)14 ArrayList (java.util.ArrayList)7 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)5 Dimension (org.eclipse.draw2d.geometry.Dimension)4 ScalableFreeformRootEditPart (org.eclipse.gef.editparts.ScalableFreeformRootEditPart)4 ZoomInAction (org.eclipse.gef.ui.actions.ZoomInAction)4 ZoomOutAction (org.eclipse.gef.ui.actions.ZoomOutAction)4 Iterator (java.util.Iterator)3 Rectangle (org.eclipse.draw2d.geometry.Rectangle)3 GraphicalViewer (org.eclipse.gef.GraphicalViewer)3 IAction (org.eclipse.jface.action.IAction)3 ConnectionContainerEditPart (org.knime.workbench.editor2.editparts.ConnectionContainerEditPart)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Method (java.lang.reflect.Method)2 AbsoluteBendpoint (org.eclipse.draw2d.AbsoluteBendpoint)2 Bendpoint (org.eclipse.draw2d.Bendpoint)2 FigureCanvas (org.eclipse.draw2d.FigureCanvas)2 Viewport (org.eclipse.draw2d.Viewport)2 KeyHandler (org.eclipse.gef.KeyHandler)2