/*
 * Created on Aug 10, 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.models;

import org.eclipse.gef.requests.CreationFactory;

/**
 * @author rajags
 *
 * 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 APElementFactory implements CreationFactory {

	private String template;
	
	public APElementFactory(String str) {
		template = str;
	}
	
	protected void connect(BasicSubpart part1, String conn1, BasicSubpart part2, String conn2) {
/*		Connector wire = new Connector(true);
		wire.setSource(part1);
		wire.setSourceTerminal(conn1);
		wire.setTarget(part2);
		wire.setTargetTerminal(conn2);
		wire.attachSource();
		wire.attachTarget();*/
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.gef.requests.CreationFactory#getNewObject()
	 */
	public Object getNewObject() {
		if (template.equals("ClassDiagram Template"))
					return new ClassDiagramModel();
		return null;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.requests.CreationFactory#getObjectType()
	 */
	public Object getObjectType() {
		return template;
	}

}
