/*
 * Created on Aug 12, 2003
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package APStudio.editparts;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import APStudio.models.*;
/**
 * @author srajagop
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class GraphicalPartFactory implements EditPartFactory {

	/* (non-Javadoc)
	 * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart, java.lang.Object)
	 */
	public EditPart createEditPart(EditPart context, Object model) {

		EditPart child = null;
		if (model instanceof ClassDiagramModel)
			child = new ClassEditPart();
		if (model instanceof ConstructionConnector)
			child = new ConnectorEditPart();
		if (model instanceof InheritanceConnector)
			child = new ConnectorEditPart();
		//Note that subclasses of LogicDiagram have already been matched above, like Circuit
		else if (model instanceof ClassGraphModel)
			child = new ClassGraphEditPart();
		child.setModel(model);
		return child;
	}

}
