Search in sources :

Example 1 with ExtendedViewportAutoexposeHelper

use of com.archimatetool.editor.diagram.util.ExtendedViewportAutoexposeHelper in project archi by archimatetool.

the class CanvasEditor method createRootEditPart.

@Override
protected void createRootEditPart(GraphicalViewer viewer) {
    /*
         * We'll have a Zoom Manager using ScalableFreeformRootEditPart
         */
    RootEditPart rootPart = new ScalableFreeformRootEditPart() {

        @SuppressWarnings("rawtypes")
        @Override
        public Object getAdapter(Class adapter) {
            if (adapter == AutoexposeHelper.class) {
                return new ExtendedViewportAutoexposeHelper(this, new Insets(50), false);
            }
            return super.getAdapter(adapter);
        }
    };
    viewer.setRootEditPart(rootPart);
}
Also used : Insets(org.eclipse.draw2d.geometry.Insets) ExtendedViewportAutoexposeHelper(com.archimatetool.editor.diagram.util.ExtendedViewportAutoexposeHelper) ScalableFreeformRootEditPart(org.eclipse.gef.editparts.ScalableFreeformRootEditPart) RootEditPart(org.eclipse.gef.RootEditPart) ScalableFreeformRootEditPart(org.eclipse.gef.editparts.ScalableFreeformRootEditPart)

Aggregations

ExtendedViewportAutoexposeHelper (com.archimatetool.editor.diagram.util.ExtendedViewportAutoexposeHelper)1 Insets (org.eclipse.draw2d.geometry.Insets)1 RootEditPart (org.eclipse.gef.RootEditPart)1 ScalableFreeformRootEditPart (org.eclipse.gef.editparts.ScalableFreeformRootEditPart)1