package com.archimatetool.editor.diagram.policies.snaptogrid;

/**
 * snap-to-grid patch by Jean-Baptiste Sarrodie (aka Jaiguru)
 * 
 * This class has been extended to allow overriding
 * of class ExtendedConnectionBendpointTracker
 */

/*******************************************************************************
 * Copyright (c) 2000, 2010 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
//package org.eclipse.gef.handles;

import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.handles.BendpointCreationHandle;
// snap-to-grid patch
// Use alternate ConnectionBendpointTracker
//import org.eclipse.gef.tools.ConnectionBendpointTracker;

/**
 * A BendpointHandle that is used to create a new bendpoint.
 */
public class ExtendedBendpointCreationHandle extends BendpointCreationHandle {

	public ExtendedBendpointCreationHandle(ConnectionEditPart owner, int index, int locatorIndex) {
	    super(owner, index, locatorIndex);
    }

    /**
	 * Creates and returns a new {@link ExtendedConnectionBendpointTracker}.
	 * 
	 * @return the new ConnectionBendpointTracker
	 */
	@Override
    protected DragTracker createDragTracker() {
		ExtendedConnectionBendpointTracker tracker = new ExtendedConnectionBendpointTracker((ConnectionEditPart) getOwner(), getIndex());
		tracker.setType(RequestConstants.REQ_CREATE_BENDPOINT);
		tracker.setDefaultCursor(getCursor());
		return tracker;
	}

}


@@ -56,16 +56,63 @@
 ogrid;%0A%0A
+import org.eclipse.draw2d.geometry.Dimension;%0A%0A
 /**%0A * s
@@ -1442,16 +1442,151 @@
 Index);%0A
+%09    %0A%09    // Make the handle one pixel bigger%0A%09    setPreferredSize(new Dimension(DEFAULT_HANDLE_SIZE - 1, DEFAULT_HANDLE_SIZE - 1));%0A
     %7D%0A%0A 

Increase Bendpoint creation handle size