| /** |
| * <copyright> |
| * |
| * Copyright (c) 2005, 2010 SAP AG. |
| * 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: |
| * SAP AG - initial API, implementation and documentation |
| * |
| * </copyright> |
| */ |
| package org.eclipse.graphiti.mm.algorithms.impl; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EPackage; |
| |
| import org.eclipse.emf.ecore.impl.EFactoryImpl; |
| |
| import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| |
| import org.eclipse.graphiti.mm.algorithms.*; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Factory</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class AlgorithmsFactoryImpl extends EFactoryImpl implements AlgorithmsFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static AlgorithmsFactory init() { |
| try { |
| AlgorithmsFactory theAlgorithmsFactory = (AlgorithmsFactory)EPackage.Registry.INSTANCE.getEFactory(AlgorithmsPackage.eNS_URI); |
| if (theAlgorithmsFactory != null) { |
| return theAlgorithmsFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new AlgorithmsFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public AlgorithmsFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case AlgorithmsPackage.POLYLINE: return createPolyline(); |
| case AlgorithmsPackage.ELLIPSE: return createEllipse(); |
| case AlgorithmsPackage.TEXT: return createText(); |
| case AlgorithmsPackage.POLYGON: return createPolygon(); |
| case AlgorithmsPackage.RECTANGLE: return createRectangle(); |
| case AlgorithmsPackage.ROUNDED_RECTANGLE: return createRoundedRectangle(); |
| case AlgorithmsPackage.IMAGE: return createImage(); |
| case AlgorithmsPackage.PLATFORM_GRAPHICS_ALGORITHM: return createPlatformGraphicsAlgorithm(); |
| case AlgorithmsPackage.MULTI_TEXT: return createMultiText(); |
| default: |
| throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Polyline createPolyline() { |
| PolylineImpl polyline = new PolylineImpl(); |
| return polyline; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Ellipse createEllipse() { |
| EllipseImpl ellipse = new EllipseImpl(); |
| return ellipse; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Text createText() { |
| TextImpl text = new TextImpl(); |
| return text; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Polygon createPolygon() { |
| PolygonImpl polygon = new PolygonImpl(); |
| return polygon; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Rectangle createRectangle() { |
| RectangleImpl rectangle = new RectangleImpl(); |
| return rectangle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public RoundedRectangle createRoundedRectangle() { |
| RoundedRectangleImpl roundedRectangle = new RoundedRectangleImpl(); |
| return roundedRectangle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Image createImage() { |
| ImageImpl image = new ImageImpl(); |
| return image; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PlatformGraphicsAlgorithm createPlatformGraphicsAlgorithm() { |
| PlatformGraphicsAlgorithmImpl platformGraphicsAlgorithm = new PlatformGraphicsAlgorithmImpl(); |
| return platformGraphicsAlgorithm; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public MultiText createMultiText() { |
| MultiTextImpl multiText = new MultiTextImpl(); |
| return multiText; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public AlgorithmsPackage getAlgorithmsPackage() { |
| return (AlgorithmsPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static AlgorithmsPackage getPackage() { |
| return AlgorithmsPackage.eINSTANCE; |
| } |
| |
| } //AlgorithmsFactoryImpl |