| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Joerg Riegel - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.chart.impl; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EDataType; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EPackage; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.EFactoryImpl; |
| |
| import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| |
| import org.eclipse.osbp.xtext.chart.*; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Factory</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class ChartDSLFactoryImpl extends EFactoryImpl implements ChartDSLFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static ChartDSLFactory init() { |
| try { |
| ChartDSLFactory theChartDSLFactory = (ChartDSLFactory)EPackage.Registry.INSTANCE.getEFactory(ChartDSLPackage.eNS_URI); |
| if (theChartDSLFactory != null) { |
| return theChartDSLFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new ChartDSLFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartDSLFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case ChartDSLPackage.CHART_MODEL: return createChartModel(); |
| case ChartDSLPackage.CHART_LAZY_RESOLVER: return createChartLazyResolver(); |
| case ChartDSLPackage.CHART_BASE: return createChartBase(); |
| case ChartDSLPackage.CHART_PACKAGE: return createChartPackage(); |
| case ChartDSLPackage.SERIES_COLOR: return createSeriesColor(); |
| case ChartDSLPackage.TEXT_COLOR: return createTextColor(); |
| case ChartDSLPackage.CHART: return createChart(); |
| case ChartDSLPackage.CHART_BAR: return createChartBar(); |
| case ChartDSLPackage.CHART_LINE: return createChartLine(); |
| case ChartDSLPackage.CHART_PIE: return createChartPie(); |
| case ChartDSLPackage.CHART_DONUT: return createChartDonut(); |
| case ChartDSLPackage.CHART_BUBBLE: return createChartBubble(); |
| case ChartDSLPackage.CHART_GAUGE: return createChartGauge(); |
| case ChartDSLPackage.CHART_TREE: return createChartTree(); |
| case ChartDSLPackage.CHART_NUMBER_INTERVAL: return createChartNumberInterval(); |
| case ChartDSLPackage.CHART_DATAMART: return createChartDatamart(); |
| case ChartDSLPackage.CHART_LEGEND: return createChartLegend(); |
| case ChartDSLPackage.CHART_HIGHLIGHTER: return createChartHighlighter(); |
| case ChartDSLPackage.CHART_AXIS: return createChartAxis(); |
| case ChartDSLPackage.CHART_SEGMENT_COLOR: return createChartSegmentColor(); |
| default: |
| throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object createFromString(EDataType eDataType, String initialValue) { |
| switch (eDataType.getClassifierID()) { |
| case ChartDSLPackage.LEGEND_PLACEMENT_ENUM: |
| return createLegendPlacementEnumFromString(eDataType, initialValue); |
| case ChartDSLPackage.TOGGLE_TYPE_ENUM: |
| return createToggleTypeEnumFromString(eDataType, initialValue); |
| case ChartDSLPackage.TOOLTIP_LOCATION_ENUM: |
| return createTooltipLocationEnumFromString(eDataType, initialValue); |
| case ChartDSLPackage.RENDER_TYPE_ENUM: |
| return createRenderTypeEnumFromString(eDataType, initialValue); |
| case ChartDSLPackage.CANVAS_FONT_FAMILY_ENUM: |
| return createCanvasFontFamilyEnumFromString(eDataType, initialValue); |
| case ChartDSLPackage.INTERNAL_EOBJECT: |
| return createInternalEObjectFromString(eDataType, initialValue); |
| default: |
| throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String convertToString(EDataType eDataType, Object instanceValue) { |
| switch (eDataType.getClassifierID()) { |
| case ChartDSLPackage.LEGEND_PLACEMENT_ENUM: |
| return convertLegendPlacementEnumToString(eDataType, instanceValue); |
| case ChartDSLPackage.TOGGLE_TYPE_ENUM: |
| return convertToggleTypeEnumToString(eDataType, instanceValue); |
| case ChartDSLPackage.TOOLTIP_LOCATION_ENUM: |
| return convertTooltipLocationEnumToString(eDataType, instanceValue); |
| case ChartDSLPackage.RENDER_TYPE_ENUM: |
| return convertRenderTypeEnumToString(eDataType, instanceValue); |
| case ChartDSLPackage.CANVAS_FONT_FAMILY_ENUM: |
| return convertCanvasFontFamilyEnumToString(eDataType, instanceValue); |
| case ChartDSLPackage.INTERNAL_EOBJECT: |
| return convertInternalEObjectToString(eDataType, instanceValue); |
| default: |
| throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartModel createChartModel() { |
| ChartModelImpl chartModel = new ChartModelImpl(); |
| return chartModel; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartLazyResolver createChartLazyResolver() { |
| ChartLazyResolverImpl chartLazyResolver = new ChartLazyResolverImpl(); |
| return chartLazyResolver; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartBase createChartBase() { |
| ChartBaseImpl chartBase = new ChartBaseImpl(); |
| return chartBase; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartPackage createChartPackage() { |
| ChartPackageImpl chartPackage = new ChartPackageImpl(); |
| return chartPackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public SeriesColor createSeriesColor() { |
| SeriesColorImpl seriesColor = new SeriesColorImpl(); |
| return seriesColor; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public TextColor createTextColor() { |
| TextColorImpl textColor = new TextColorImpl(); |
| return textColor; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Chart createChart() { |
| ChartImpl chart = new ChartImpl(); |
| return chart; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartBar createChartBar() { |
| ChartBarImpl chartBar = new ChartBarImpl(); |
| return chartBar; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartLine createChartLine() { |
| ChartLineImpl chartLine = new ChartLineImpl(); |
| return chartLine; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartPie createChartPie() { |
| ChartPieImpl chartPie = new ChartPieImpl(); |
| return chartPie; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartDonut createChartDonut() { |
| ChartDonutImpl chartDonut = new ChartDonutImpl(); |
| return chartDonut; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartBubble createChartBubble() { |
| ChartBubbleImpl chartBubble = new ChartBubbleImpl(); |
| return chartBubble; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartGauge createChartGauge() { |
| ChartGaugeImpl chartGauge = new ChartGaugeImpl(); |
| return chartGauge; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartTree createChartTree() { |
| ChartTreeImpl chartTree = new ChartTreeImpl(); |
| return chartTree; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartNumberInterval createChartNumberInterval() { |
| ChartNumberIntervalImpl chartNumberInterval = new ChartNumberIntervalImpl(); |
| return chartNumberInterval; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartDatamart createChartDatamart() { |
| ChartDatamartImpl chartDatamart = new ChartDatamartImpl(); |
| return chartDatamart; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartLegend createChartLegend() { |
| ChartLegendImpl chartLegend = new ChartLegendImpl(); |
| return chartLegend; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartHighlighter createChartHighlighter() { |
| ChartHighlighterImpl chartHighlighter = new ChartHighlighterImpl(); |
| return chartHighlighter; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartAxis createChartAxis() { |
| ChartAxisImpl chartAxis = new ChartAxisImpl(); |
| return chartAxis; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartSegmentColor createChartSegmentColor() { |
| ChartSegmentColorImpl chartSegmentColor = new ChartSegmentColorImpl(); |
| return chartSegmentColor; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LegendPlacementEnum createLegendPlacementEnumFromString(EDataType eDataType, String initialValue) { |
| LegendPlacementEnum result = LegendPlacementEnum.get(initialValue); |
| if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
| return result; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertLegendPlacementEnumToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ToggleTypeEnum createToggleTypeEnumFromString(EDataType eDataType, String initialValue) { |
| ToggleTypeEnum result = ToggleTypeEnum.get(initialValue); |
| if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
| return result; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertToggleTypeEnumToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public TooltipLocationEnum createTooltipLocationEnumFromString(EDataType eDataType, String initialValue) { |
| TooltipLocationEnum result = TooltipLocationEnum.get(initialValue); |
| if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
| return result; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertTooltipLocationEnumToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public RenderTypeEnum createRenderTypeEnumFromString(EDataType eDataType, String initialValue) { |
| RenderTypeEnum result = RenderTypeEnum.get(initialValue); |
| if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
| return result; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertRenderTypeEnumToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CanvasFontFamilyEnum createCanvasFontFamilyEnumFromString(EDataType eDataType, String initialValue) { |
| CanvasFontFamilyEnum result = CanvasFontFamilyEnum.get(initialValue); |
| if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
| return result; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertCanvasFontFamilyEnumToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public InternalEObject createInternalEObjectFromString(EDataType eDataType, String initialValue) { |
| return (InternalEObject)super.createFromString(eDataType, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertInternalEObjectToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(eDataType, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ChartDSLPackage getChartDSLPackage() { |
| return (ChartDSLPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static ChartDSLPackage getPackage() { |
| return ChartDSLPackage.eINSTANCE; |
| } |
| |
| } //ChartDSLFactoryImpl |