| /** |
| * |
| * 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 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.infogrid.model.gridsource.style.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.infogrid.model.gridsource.style.CxGridEventTopicAble; |
| import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridPropIndicatorStyle; |
| import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridStylePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Cx Grid Prop Indicator Style</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropIndicatorStyleImpl#getEventTopic <em>Event Topic</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropIndicatorStyleImpl#getGreenStarts <em>Green Starts</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropIndicatorStyleImpl#getRedEnds <em>Red Ends</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CxGridPropIndicatorStyleImpl extends CxGridPropStyleImpl implements CxGridPropIndicatorStyle { |
| /** |
| * The default value of the '{@link #getEventTopic() <em>Event Topic</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEventTopic() |
| * @generated |
| * @ordered |
| */ |
| protected static final String EVENT_TOPIC_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getEventTopic() <em>Event Topic</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEventTopic() |
| * @generated |
| * @ordered |
| */ |
| protected String eventTopic = EVENT_TOPIC_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getGreenStarts() <em>Green Starts</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getGreenStarts() |
| * @generated |
| * @ordered |
| */ |
| protected static final double GREEN_STARTS_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getGreenStarts() <em>Green Starts</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getGreenStarts() |
| * @generated |
| * @ordered |
| */ |
| protected double greenStarts = GREEN_STARTS_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getRedEnds() <em>Red Ends</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRedEnds() |
| * @generated |
| * @ordered |
| */ |
| protected static final double RED_ENDS_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getRedEnds() <em>Red Ends</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRedEnds() |
| * @generated |
| * @ordered |
| */ |
| protected double redEnds = RED_ENDS_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CxGridPropIndicatorStyleImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CxGridStylePackage.Literals.CX_GRID_PROP_INDICATOR_STYLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getEventTopic() { |
| return eventTopic; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEventTopic(String newEventTopic) { |
| String oldEventTopic = eventTopic; |
| eventTopic = newEventTopic; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__EVENT_TOPIC, oldEventTopic, eventTopic)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public double getGreenStarts() { |
| return greenStarts; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setGreenStarts(double newGreenStarts) { |
| double oldGreenStarts = greenStarts; |
| greenStarts = newGreenStarts; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__GREEN_STARTS, oldGreenStarts, greenStarts)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public double getRedEnds() { |
| return redEnds; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRedEnds(double newRedEnds) { |
| double oldRedEnds = redEnds; |
| redEnds = newRedEnds; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__RED_ENDS, oldRedEnds, redEnds)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__EVENT_TOPIC: |
| return getEventTopic(); |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__GREEN_STARTS: |
| return getGreenStarts(); |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__RED_ENDS: |
| return getRedEnds(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__EVENT_TOPIC: |
| setEventTopic((String)newValue); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__GREEN_STARTS: |
| setGreenStarts((Double)newValue); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__RED_ENDS: |
| setRedEnds((Double)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__EVENT_TOPIC: |
| setEventTopic(EVENT_TOPIC_EDEFAULT); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__GREEN_STARTS: |
| setGreenStarts(GREEN_STARTS_EDEFAULT); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__RED_ENDS: |
| setRedEnds(RED_ENDS_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__EVENT_TOPIC: |
| return EVENT_TOPIC_EDEFAULT == null ? eventTopic != null : !EVENT_TOPIC_EDEFAULT.equals(eventTopic); |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__GREEN_STARTS: |
| return greenStarts != GREEN_STARTS_EDEFAULT; |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__RED_ENDS: |
| return redEnds != RED_ENDS_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == CxGridEventTopicAble.class) { |
| switch (derivedFeatureID) { |
| case CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__EVENT_TOPIC: return CxGridStylePackage.CX_GRID_EVENT_TOPIC_ABLE__EVENT_TOPIC; |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == CxGridEventTopicAble.class) { |
| switch (baseFeatureID) { |
| case CxGridStylePackage.CX_GRID_EVENT_TOPIC_ABLE__EVENT_TOPIC: return CxGridStylePackage.CX_GRID_PROP_INDICATOR_STYLE__EVENT_TOPIC; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (eventTopic: "); |
| result.append(eventTopic); |
| result.append(", greenStarts: "); |
| result.append(greenStarts); |
| result.append(", redEnds: "); |
| result.append(redEnds); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //CxGridPropIndicatorStyleImpl |