blob: 6db501ad51a122e7e200a2b899752b055725cd70 [file] [log] [blame]
/**
* *******************************************************************************
* * Copyright (c) 2012 INRIA. 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: Guillaume Doux - INRIA - Initial API and implementation
* *
* ******************************************************************************
*
*/
package org.eclipse.modisco.utils.chart.metamodel.internal.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.emf.ecore.impl.EObjectImpl;
import org.eclipse.modisco.utils.chart.metamodel.internal.chart.Axe;
import org.eclipse.modisco.utils.chart.metamodel.internal.chart.ChartPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Axe</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.modisco.utils.chart.metamodel.internal.chart.impl.AxeImpl#getLegend <em>Legend</em>}</li>
* <li>{@link org.eclipse.modisco.utils.chart.metamodel.internal.chart.impl.AxeImpl#getUnit <em>Unit</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AxeImpl extends EObjectImpl implements Axe {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "*******************************************************************************\r\n * Copyright (c) 2012 INRIA. All rights reserved. This program and the\r\n * accompanying materials are made available under the terms of the Eclipse\r\n * Public License v1.0 which accompanies this distribution, and is available at\r\n * http://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors: Guillaume Doux - INRIA - Initial API and implementation\r\n * \r\n ******************************************************************************\r\n";
/**
* The default value of the '{@link #getLegend() <em>Legend</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLegend()
* @generated
* @ordered
*/
protected static final String LEGEND_EDEFAULT = null;
/**
* The cached value of the '{@link #getLegend() <em>Legend</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLegend()
* @generated
* @ordered
*/
protected String legend = LEGEND_EDEFAULT;
/**
* The default value of the '{@link #getUnit() <em>Unit</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUnit()
* @generated
* @ordered
*/
protected static final String UNIT_EDEFAULT = null;
/**
* The cached value of the '{@link #getUnit() <em>Unit</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUnit()
* @generated
* @ordered
*/
protected String unit = UNIT_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AxeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ChartPackage.Literals.AXE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getLegend() {
return legend;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLegend(String newLegend) {
String oldLegend = legend;
legend = newLegend;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ChartPackage.AXE__LEGEND, oldLegend, legend));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getUnit() {
return unit;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setUnit(String newUnit) {
String oldUnit = unit;
unit = newUnit;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ChartPackage.AXE__UNIT, oldUnit, unit));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ChartPackage.AXE__LEGEND:
return getLegend();
case ChartPackage.AXE__UNIT:
return getUnit();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ChartPackage.AXE__LEGEND:
setLegend((String)newValue);
return;
case ChartPackage.AXE__UNIT:
setUnit((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ChartPackage.AXE__LEGEND:
setLegend(LEGEND_EDEFAULT);
return;
case ChartPackage.AXE__UNIT:
setUnit(UNIT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ChartPackage.AXE__LEGEND:
return LEGEND_EDEFAULT == null ? legend != null : !LEGEND_EDEFAULT.equals(legend);
case ChartPackage.AXE__UNIT:
return UNIT_EDEFAULT == null ? unit != null : !UNIT_EDEFAULT.equals(unit);
}
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(" (legend: ");
result.append(legend);
result.append(", unit: ");
result.append(unit);
result.append(')');
return result.toString();
}
} //AxeImpl