| /** |
| * Copyright (c) 2016 CEA LIST. |
| * |
| * 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 |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| */ |
| package org.eclipse.papyrus.moka.xygraph.model.xygraph.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.MinimalEObjectImpl; |
| |
| import org.eclipse.papyrus.moka.xygraph.model.xygraph.FontDescriptor; |
| import org.eclipse.papyrus.moka.xygraph.model.xygraph.XYGraphPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Font Descriptor</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.moka.xygraph.model.xygraph.impl.FontDescriptorImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.papyrus.moka.xygraph.model.xygraph.impl.FontDescriptorImpl#getSize <em>Size</em>}</li> |
| * <li>{@link org.eclipse.papyrus.moka.xygraph.model.xygraph.impl.FontDescriptorImpl#getStyle <em>Style</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class FontDescriptorImpl extends MinimalEObjectImpl.Container implements FontDescriptor { |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = "Arial"; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getSize() <em>Size</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSize() |
| * @generated |
| * @ordered |
| */ |
| protected static final int SIZE_EDEFAULT = 12; |
| |
| /** |
| * The cached value of the '{@link #getSize() <em>Size</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSize() |
| * @generated |
| * @ordered |
| */ |
| protected int size = SIZE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getStyle() <em>Style</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getStyle() |
| * @generated |
| * @ordered |
| */ |
| protected static final int STYLE_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getStyle() <em>Style</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getStyle() |
| * @generated |
| * @ordered |
| */ |
| protected int style = STYLE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected FontDescriptorImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return XYGraphPackage.Literals.FONT_DESCRIPTOR; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XYGraphPackage.FONT_DESCRIPTOR__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getSize() { |
| return size; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSize(int newSize) { |
| int oldSize = size; |
| size = newSize; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XYGraphPackage.FONT_DESCRIPTOR__SIZE, oldSize, size)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getStyle() { |
| return style; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setStyle(int newStyle) { |
| int oldStyle = style; |
| style = newStyle; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XYGraphPackage.FONT_DESCRIPTOR__STYLE, oldStyle, style)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case XYGraphPackage.FONT_DESCRIPTOR__NAME: |
| return getName(); |
| case XYGraphPackage.FONT_DESCRIPTOR__SIZE: |
| return getSize(); |
| case XYGraphPackage.FONT_DESCRIPTOR__STYLE: |
| return getStyle(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case XYGraphPackage.FONT_DESCRIPTOR__NAME: |
| setName((String)newValue); |
| return; |
| case XYGraphPackage.FONT_DESCRIPTOR__SIZE: |
| setSize((Integer)newValue); |
| return; |
| case XYGraphPackage.FONT_DESCRIPTOR__STYLE: |
| setStyle((Integer)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case XYGraphPackage.FONT_DESCRIPTOR__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case XYGraphPackage.FONT_DESCRIPTOR__SIZE: |
| setSize(SIZE_EDEFAULT); |
| return; |
| case XYGraphPackage.FONT_DESCRIPTOR__STYLE: |
| setStyle(STYLE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case XYGraphPackage.FONT_DESCRIPTOR__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case XYGraphPackage.FONT_DESCRIPTOR__SIZE: |
| return size != SIZE_EDEFAULT; |
| case XYGraphPackage.FONT_DESCRIPTOR__STYLE: |
| return style != STYLE_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (name: "); |
| result.append(name); |
| result.append(", size: "); |
| result.append(size); |
| result.append(", style: "); |
| result.append(style); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //FontDescriptorImpl |