| /** |
| * 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.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.chart.ChartDSLPackage; |
| import org.eclipse.osbp.xtext.chart.ChartLine; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Chart Line</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartLineImpl#isAnimated <em>Animated</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartLineImpl#isShowMarker <em>Show Marker</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartLineImpl#isTrendLine <em>Trend Line</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartLineImpl#isZoom <em>Zoom</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartLineImpl#isCursor <em>Cursor</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartLineImpl#isTooltip <em>Tooltip</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartLineImpl#isFillToZero <em>Fill To Zero</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartLineImpl#isFillArea <em>Fill Area</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ChartLineImpl extends ChartLazyResolverImpl implements ChartLine { |
| /** |
| * The default value of the '{@link #isAnimated() <em>Animated</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isAnimated() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean ANIMATED_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isAnimated() <em>Animated</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isAnimated() |
| * @generated |
| * @ordered |
| */ |
| protected boolean animated = ANIMATED_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isShowMarker() <em>Show Marker</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isShowMarker() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean SHOW_MARKER_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isShowMarker() <em>Show Marker</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isShowMarker() |
| * @generated |
| * @ordered |
| */ |
| protected boolean showMarker = SHOW_MARKER_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isTrendLine() <em>Trend Line</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isTrendLine() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean TREND_LINE_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isTrendLine() <em>Trend Line</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isTrendLine() |
| * @generated |
| * @ordered |
| */ |
| protected boolean trendLine = TREND_LINE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isZoom() <em>Zoom</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isZoom() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean ZOOM_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isZoom() <em>Zoom</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isZoom() |
| * @generated |
| * @ordered |
| */ |
| protected boolean zoom = ZOOM_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isCursor() <em>Cursor</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isCursor() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean CURSOR_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isCursor() <em>Cursor</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isCursor() |
| * @generated |
| * @ordered |
| */ |
| protected boolean cursor = CURSOR_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isTooltip() <em>Tooltip</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isTooltip() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean TOOLTIP_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isTooltip() <em>Tooltip</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isTooltip() |
| * @generated |
| * @ordered |
| */ |
| protected boolean tooltip = TOOLTIP_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isFillToZero() <em>Fill To Zero</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isFillToZero() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean FILL_TO_ZERO_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isFillToZero() <em>Fill To Zero</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isFillToZero() |
| * @generated |
| * @ordered |
| */ |
| protected boolean fillToZero = FILL_TO_ZERO_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isFillArea() <em>Fill Area</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isFillArea() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean FILL_AREA_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isFillArea() <em>Fill Area</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isFillArea() |
| * @generated |
| * @ordered |
| */ |
| protected boolean fillArea = FILL_AREA_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ChartLineImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ChartDSLPackage.Literals.CHART_LINE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isAnimated() { |
| return animated; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAnimated(boolean newAnimated) { |
| boolean oldAnimated = animated; |
| animated = newAnimated; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_LINE__ANIMATED, oldAnimated, animated)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isShowMarker() { |
| return showMarker; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setShowMarker(boolean newShowMarker) { |
| boolean oldShowMarker = showMarker; |
| showMarker = newShowMarker; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_LINE__SHOW_MARKER, oldShowMarker, showMarker)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isTrendLine() { |
| return trendLine; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTrendLine(boolean newTrendLine) { |
| boolean oldTrendLine = trendLine; |
| trendLine = newTrendLine; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_LINE__TREND_LINE, oldTrendLine, trendLine)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isZoom() { |
| return zoom; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setZoom(boolean newZoom) { |
| boolean oldZoom = zoom; |
| zoom = newZoom; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_LINE__ZOOM, oldZoom, zoom)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isCursor() { |
| return cursor; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCursor(boolean newCursor) { |
| boolean oldCursor = cursor; |
| cursor = newCursor; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_LINE__CURSOR, oldCursor, cursor)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isTooltip() { |
| return tooltip; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTooltip(boolean newTooltip) { |
| boolean oldTooltip = tooltip; |
| tooltip = newTooltip; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_LINE__TOOLTIP, oldTooltip, tooltip)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isFillToZero() { |
| return fillToZero; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFillToZero(boolean newFillToZero) { |
| boolean oldFillToZero = fillToZero; |
| fillToZero = newFillToZero; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_LINE__FILL_TO_ZERO, oldFillToZero, fillToZero)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isFillArea() { |
| return fillArea; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFillArea(boolean newFillArea) { |
| boolean oldFillArea = fillArea; |
| fillArea = newFillArea; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_LINE__FILL_AREA, oldFillArea, fillArea)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ChartDSLPackage.CHART_LINE__ANIMATED: |
| return isAnimated(); |
| case ChartDSLPackage.CHART_LINE__SHOW_MARKER: |
| return isShowMarker(); |
| case ChartDSLPackage.CHART_LINE__TREND_LINE: |
| return isTrendLine(); |
| case ChartDSLPackage.CHART_LINE__ZOOM: |
| return isZoom(); |
| case ChartDSLPackage.CHART_LINE__CURSOR: |
| return isCursor(); |
| case ChartDSLPackage.CHART_LINE__TOOLTIP: |
| return isTooltip(); |
| case ChartDSLPackage.CHART_LINE__FILL_TO_ZERO: |
| return isFillToZero(); |
| case ChartDSLPackage.CHART_LINE__FILL_AREA: |
| return isFillArea(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ChartDSLPackage.CHART_LINE__ANIMATED: |
| setAnimated((Boolean)newValue); |
| return; |
| case ChartDSLPackage.CHART_LINE__SHOW_MARKER: |
| setShowMarker((Boolean)newValue); |
| return; |
| case ChartDSLPackage.CHART_LINE__TREND_LINE: |
| setTrendLine((Boolean)newValue); |
| return; |
| case ChartDSLPackage.CHART_LINE__ZOOM: |
| setZoom((Boolean)newValue); |
| return; |
| case ChartDSLPackage.CHART_LINE__CURSOR: |
| setCursor((Boolean)newValue); |
| return; |
| case ChartDSLPackage.CHART_LINE__TOOLTIP: |
| setTooltip((Boolean)newValue); |
| return; |
| case ChartDSLPackage.CHART_LINE__FILL_TO_ZERO: |
| setFillToZero((Boolean)newValue); |
| return; |
| case ChartDSLPackage.CHART_LINE__FILL_AREA: |
| setFillArea((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ChartDSLPackage.CHART_LINE__ANIMATED: |
| setAnimated(ANIMATED_EDEFAULT); |
| return; |
| case ChartDSLPackage.CHART_LINE__SHOW_MARKER: |
| setShowMarker(SHOW_MARKER_EDEFAULT); |
| return; |
| case ChartDSLPackage.CHART_LINE__TREND_LINE: |
| setTrendLine(TREND_LINE_EDEFAULT); |
| return; |
| case ChartDSLPackage.CHART_LINE__ZOOM: |
| setZoom(ZOOM_EDEFAULT); |
| return; |
| case ChartDSLPackage.CHART_LINE__CURSOR: |
| setCursor(CURSOR_EDEFAULT); |
| return; |
| case ChartDSLPackage.CHART_LINE__TOOLTIP: |
| setTooltip(TOOLTIP_EDEFAULT); |
| return; |
| case ChartDSLPackage.CHART_LINE__FILL_TO_ZERO: |
| setFillToZero(FILL_TO_ZERO_EDEFAULT); |
| return; |
| case ChartDSLPackage.CHART_LINE__FILL_AREA: |
| setFillArea(FILL_AREA_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ChartDSLPackage.CHART_LINE__ANIMATED: |
| return animated != ANIMATED_EDEFAULT; |
| case ChartDSLPackage.CHART_LINE__SHOW_MARKER: |
| return showMarker != SHOW_MARKER_EDEFAULT; |
| case ChartDSLPackage.CHART_LINE__TREND_LINE: |
| return trendLine != TREND_LINE_EDEFAULT; |
| case ChartDSLPackage.CHART_LINE__ZOOM: |
| return zoom != ZOOM_EDEFAULT; |
| case ChartDSLPackage.CHART_LINE__CURSOR: |
| return cursor != CURSOR_EDEFAULT; |
| case ChartDSLPackage.CHART_LINE__TOOLTIP: |
| return tooltip != TOOLTIP_EDEFAULT; |
| case ChartDSLPackage.CHART_LINE__FILL_TO_ZERO: |
| return fillToZero != FILL_TO_ZERO_EDEFAULT; |
| case ChartDSLPackage.CHART_LINE__FILL_AREA: |
| return fillArea != FILL_AREA_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (animated: "); |
| result.append(animated); |
| result.append(", showMarker: "); |
| result.append(showMarker); |
| result.append(", trendLine: "); |
| result.append(trendLine); |
| result.append(", zoom: "); |
| result.append(zoom); |
| result.append(", cursor: "); |
| result.append(cursor); |
| result.append(", tooltip: "); |
| result.append(tooltip); |
| result.append(", fillToZero: "); |
| result.append(fillToZero); |
| result.append(", fillArea: "); |
| result.append(fillArea); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ChartLineImpl |