/*
 * Created on Oct 6, 2003
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package APStudio;

import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.CreationFactory;
import org.eclipse.gef.tools.ConnectionCreationTool;

import APStudio.models.ConstructionConnector;
import APStudio.models.commands.ConnectionCommand;

/**
 * @author Gong Jun
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class CConnectionCreationTool extends ConnectionCreationTool {

	public CConnectionCreationTool() {
		setUnloadWhenFinished(false);
	}


	public CConnectionCreationTool(CreationFactory factory) {
		setFactory(factory);
		setUnloadWhenFinished(false);
	}
	
	protected Command getCommand() {
		if (getTargetEditPart() == null)
			return null;
		ConnectionCommand cmd = (ConnectionCommand)getTargetEditPart().getCommand(getTargetRequest());
		cmd.setConnector(new ConstructionConnector());
		return cmd; 
	}

}
