blob: 7b968c6cc5c3c080416ba185b3d77706b9a8f7dd [file] [log] [blame]
/**
* 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 v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - 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.ChartBar;
import org.eclipse.osbp.xtext.chart.ChartDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Chart Bar</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartBarImpl#isShadow <em>Shadow</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartBarImpl#isAnimated <em>Animated</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartBarImpl#isSwapped <em>Swapped</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartBarImpl#isStacked <em>Stacked</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ChartBarImpl extends ChartLazyResolverImpl implements ChartBar {
/**
* The default value of the '{@link #isShadow() <em>Shadow</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isShadow()
* @generated
* @ordered
*/
protected static final boolean SHADOW_EDEFAULT = false;
/**
* The cached value of the '{@link #isShadow() <em>Shadow</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isShadow()
* @generated
* @ordered
*/
protected boolean shadow = SHADOW_EDEFAULT;
/**
* 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 #isSwapped() <em>Swapped</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSwapped()
* @generated
* @ordered
*/
protected static final boolean SWAPPED_EDEFAULT = false;
/**
* The cached value of the '{@link #isSwapped() <em>Swapped</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSwapped()
* @generated
* @ordered
*/
protected boolean swapped = SWAPPED_EDEFAULT;
/**
* The default value of the '{@link #isStacked() <em>Stacked</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isStacked()
* @generated
* @ordered
*/
protected static final boolean STACKED_EDEFAULT = false;
/**
* The cached value of the '{@link #isStacked() <em>Stacked</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isStacked()
* @generated
* @ordered
*/
protected boolean stacked = STACKED_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ChartBarImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ChartDSLPackage.Literals.CHART_BAR;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isShadow() {
return shadow;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setShadow(boolean newShadow) {
boolean oldShadow = shadow;
shadow = newShadow;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_BAR__SHADOW, oldShadow, shadow));
}
/**
* <!-- 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_BAR__ANIMATED, oldAnimated, animated));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSwapped() {
return swapped;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSwapped(boolean newSwapped) {
boolean oldSwapped = swapped;
swapped = newSwapped;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_BAR__SWAPPED, oldSwapped, swapped));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isStacked() {
return stacked;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStacked(boolean newStacked) {
boolean oldStacked = stacked;
stacked = newStacked;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_BAR__STACKED, oldStacked, stacked));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ChartDSLPackage.CHART_BAR__SHADOW:
return isShadow();
case ChartDSLPackage.CHART_BAR__ANIMATED:
return isAnimated();
case ChartDSLPackage.CHART_BAR__SWAPPED:
return isSwapped();
case ChartDSLPackage.CHART_BAR__STACKED:
return isStacked();
}
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_BAR__SHADOW:
setShadow((Boolean)newValue);
return;
case ChartDSLPackage.CHART_BAR__ANIMATED:
setAnimated((Boolean)newValue);
return;
case ChartDSLPackage.CHART_BAR__SWAPPED:
setSwapped((Boolean)newValue);
return;
case ChartDSLPackage.CHART_BAR__STACKED:
setStacked((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_BAR__SHADOW:
setShadow(SHADOW_EDEFAULT);
return;
case ChartDSLPackage.CHART_BAR__ANIMATED:
setAnimated(ANIMATED_EDEFAULT);
return;
case ChartDSLPackage.CHART_BAR__SWAPPED:
setSwapped(SWAPPED_EDEFAULT);
return;
case ChartDSLPackage.CHART_BAR__STACKED:
setStacked(STACKED_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ChartDSLPackage.CHART_BAR__SHADOW:
return shadow != SHADOW_EDEFAULT;
case ChartDSLPackage.CHART_BAR__ANIMATED:
return animated != ANIMATED_EDEFAULT;
case ChartDSLPackage.CHART_BAR__SWAPPED:
return swapped != SWAPPED_EDEFAULT;
case ChartDSLPackage.CHART_BAR__STACKED:
return stacked != STACKED_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(" (shadow: ");
result.append(shadow);
result.append(", animated: ");
result.append(animated);
result.append(", swapped: ");
result.append(swapped);
result.append(", stacked: ");
result.append(stacked);
result.append(')');
return result.toString();
}
} //ChartBarImpl