blob: 42924ba3642f35f0540fdb8a1000d6fa37e40b34 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2012, 2020 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.rtm.ggplot.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.statet.rtm.ggplot.GGPlotPackage;
import org.eclipse.statet.rtm.ggplot.GeomPointLayer;
import org.eclipse.statet.rtm.ggplot.PropAlphaProvider;
import org.eclipse.statet.rtm.ggplot.PropColorProvider;
import org.eclipse.statet.rtm.ggplot.PropFillProvider;
import org.eclipse.statet.rtm.ggplot.PropShapeProvider;
import org.eclipse.statet.rtm.ggplot.PropSizeProvider;
import org.eclipse.statet.rtm.rtdata.RtDataFactory;
import org.eclipse.statet.rtm.rtdata.RtDataPackage;
import org.eclipse.statet.rtm.rtdata.types.RTypedExpr;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Geom Point Layer</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.statet.rtm.ggplot.impl.GeomPointLayerImpl#getShape <em>Shape</em>}</li>
* <li>{@link org.eclipse.statet.rtm.ggplot.impl.GeomPointLayerImpl#getSize <em>Size</em>}</li>
* <li>{@link org.eclipse.statet.rtm.ggplot.impl.GeomPointLayerImpl#getColor <em>Color</em>}</li>
* <li>{@link org.eclipse.statet.rtm.ggplot.impl.GeomPointLayerImpl#getFill <em>Fill</em>}</li>
* <li>{@link org.eclipse.statet.rtm.ggplot.impl.GeomPointLayerImpl#getAlpha <em>Alpha</em>}</li>
* <li>{@link org.eclipse.statet.rtm.ggplot.impl.GeomPointLayerImpl#getPositionXJitter <em>Position XJitter</em>}</li>
* <li>{@link org.eclipse.statet.rtm.ggplot.impl.GeomPointLayerImpl#getPositionYJitter <em>Position YJitter</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class GeomPointLayerImpl extends XYVarLayerImpl implements GeomPointLayer {
/**
* The default value of the '{@link #getShape() <em>Shape</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getShape()
* @generated
* @ordered
*/
protected static final RTypedExpr SHAPE_EDEFAULT= null;
/**
* The cached value of the '{@link #getShape() <em>Shape</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getShape()
* @generated
* @ordered
*/
protected RTypedExpr shape= SHAPE_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 RTypedExpr SIZE_EDEFAULT= null;
/**
* The cached value of the '{@link #getSize() <em>Size</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSize()
* @generated
* @ordered
*/
protected RTypedExpr size= SIZE_EDEFAULT;
/**
* The default value of the '{@link #getColor() <em>Color</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getColor()
* @generated
* @ordered
*/
protected static final RTypedExpr COLOR_EDEFAULT= (RTypedExpr)RtDataFactory.eINSTANCE.createFromString(RtDataPackage.eINSTANCE.getRColor(), ""); //$NON-NLS-1$
/**
* The cached value of the '{@link #getColor() <em>Color</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getColor()
* @generated
* @ordered
*/
protected RTypedExpr color= COLOR_EDEFAULT;
/**
* The default value of the '{@link #getFill() <em>Fill</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFill()
* @generated
* @ordered
*/
protected static final RTypedExpr FILL_EDEFAULT= (RTypedExpr)RtDataFactory.eINSTANCE.createFromString(RtDataPackage.eINSTANCE.getRColor(), "");
/**
* The cached value of the '{@link #getFill() <em>Fill</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFill()
* @generated
* @ordered
*/
protected RTypedExpr fill= FILL_EDEFAULT;
/**
* The default value of the '{@link #getAlpha() <em>Alpha</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAlpha()
* @generated
* @ordered
*/
protected static final RTypedExpr ALPHA_EDEFAULT= (RTypedExpr)RtDataFactory.eINSTANCE.createFromString(RtDataPackage.eINSTANCE.getRAlpha(), ""); //$NON-NLS-1$
/**
* The cached value of the '{@link #getAlpha() <em>Alpha</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAlpha()
* @generated
* @ordered
*/
protected RTypedExpr alpha= ALPHA_EDEFAULT;
/**
* The default value of the '{@link #getPositionXJitter() <em>Position XJitter</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPositionXJitter()
* @generated
* @ordered
*/
protected static final RTypedExpr POSITION_XJITTER_EDEFAULT= null;
/**
* The cached value of the '{@link #getPositionXJitter() <em>Position XJitter</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPositionXJitter()
* @generated
* @ordered
*/
protected RTypedExpr positionXJitter= POSITION_XJITTER_EDEFAULT;
/**
* The default value of the '{@link #getPositionYJitter() <em>Position YJitter</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPositionYJitter()
* @generated
* @ordered
*/
protected static final RTypedExpr POSITION_YJITTER_EDEFAULT= null;
/**
* The cached value of the '{@link #getPositionYJitter() <em>Position YJitter</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPositionYJitter()
* @generated
* @ordered
*/
protected RTypedExpr positionYJitter= POSITION_YJITTER_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GeomPointLayerImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return GGPlotPackage.Literals.GEOM_POINT_LAYER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public RTypedExpr getColor() {
return this.color;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setColor(final RTypedExpr newColor) {
final RTypedExpr oldColor= this.color;
this.color= newColor;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, GGPlotPackage.GEOM_POINT_LAYER__COLOR, oldColor, this.color));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public RTypedExpr getFill() {
return this.fill;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setFill(final RTypedExpr newFill) {
final RTypedExpr oldFill= this.fill;
this.fill= newFill;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, GGPlotPackage.GEOM_POINT_LAYER__FILL, oldFill, this.fill));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public RTypedExpr getAlpha() {
return this.alpha;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setAlpha(final RTypedExpr newAlpha) {
final RTypedExpr oldAlpha= this.alpha;
this.alpha= newAlpha;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, GGPlotPackage.GEOM_POINT_LAYER__ALPHA, oldAlpha, this.alpha));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public RTypedExpr getShape() {
return this.shape;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setShape(final RTypedExpr newShape) {
final RTypedExpr oldShape= this.shape;
this.shape= newShape;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, GGPlotPackage.GEOM_POINT_LAYER__SHAPE, oldShape, this.shape));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public RTypedExpr getSize() {
return this.size;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setSize(final RTypedExpr newSize) {
final RTypedExpr oldSize= this.size;
this.size= newSize;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, GGPlotPackage.GEOM_POINT_LAYER__SIZE, oldSize, this.size));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public RTypedExpr getPositionXJitter() {
return this.positionXJitter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setPositionXJitter(final RTypedExpr newPositionXJitter) {
final RTypedExpr oldPositionXJitter= this.positionXJitter;
this.positionXJitter= newPositionXJitter;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, GGPlotPackage.GEOM_POINT_LAYER__POSITION_XJITTER, oldPositionXJitter, this.positionXJitter));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public RTypedExpr getPositionYJitter() {
return this.positionYJitter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setPositionYJitter(final RTypedExpr newPositionYJitter) {
final RTypedExpr oldPositionYJitter= this.positionYJitter;
this.positionYJitter= newPositionYJitter;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, GGPlotPackage.GEOM_POINT_LAYER__POSITION_YJITTER, oldPositionYJitter, this.positionYJitter));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(final int featureID, final boolean resolve, final boolean coreType) {
switch (featureID) {
case GGPlotPackage.GEOM_POINT_LAYER__SHAPE:
return getShape();
case GGPlotPackage.GEOM_POINT_LAYER__SIZE:
return getSize();
case GGPlotPackage.GEOM_POINT_LAYER__COLOR:
return getColor();
case GGPlotPackage.GEOM_POINT_LAYER__FILL:
return getFill();
case GGPlotPackage.GEOM_POINT_LAYER__ALPHA:
return getAlpha();
case GGPlotPackage.GEOM_POINT_LAYER__POSITION_XJITTER:
return getPositionXJitter();
case GGPlotPackage.GEOM_POINT_LAYER__POSITION_YJITTER:
return getPositionYJitter();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(final int featureID, final Object newValue) {
switch (featureID) {
case GGPlotPackage.GEOM_POINT_LAYER__SHAPE:
setShape((RTypedExpr)newValue);
return;
case GGPlotPackage.GEOM_POINT_LAYER__SIZE:
setSize((RTypedExpr)newValue);
return;
case GGPlotPackage.GEOM_POINT_LAYER__COLOR:
setColor((RTypedExpr)newValue);
return;
case GGPlotPackage.GEOM_POINT_LAYER__FILL:
setFill((RTypedExpr)newValue);
return;
case GGPlotPackage.GEOM_POINT_LAYER__ALPHA:
setAlpha((RTypedExpr)newValue);
return;
case GGPlotPackage.GEOM_POINT_LAYER__POSITION_XJITTER:
setPositionXJitter((RTypedExpr)newValue);
return;
case GGPlotPackage.GEOM_POINT_LAYER__POSITION_YJITTER:
setPositionYJitter((RTypedExpr)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(final int featureID) {
switch (featureID) {
case GGPlotPackage.GEOM_POINT_LAYER__SHAPE:
setShape(SHAPE_EDEFAULT);
return;
case GGPlotPackage.GEOM_POINT_LAYER__SIZE:
setSize(SIZE_EDEFAULT);
return;
case GGPlotPackage.GEOM_POINT_LAYER__COLOR:
setColor(COLOR_EDEFAULT);
return;
case GGPlotPackage.GEOM_POINT_LAYER__FILL:
setFill(FILL_EDEFAULT);
return;
case GGPlotPackage.GEOM_POINT_LAYER__ALPHA:
setAlpha(ALPHA_EDEFAULT);
return;
case GGPlotPackage.GEOM_POINT_LAYER__POSITION_XJITTER:
setPositionXJitter(POSITION_XJITTER_EDEFAULT);
return;
case GGPlotPackage.GEOM_POINT_LAYER__POSITION_YJITTER:
setPositionYJitter(POSITION_YJITTER_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(final int featureID) {
switch (featureID) {
case GGPlotPackage.GEOM_POINT_LAYER__SHAPE:
return SHAPE_EDEFAULT == null ? this.shape != null : !SHAPE_EDEFAULT.equals(this.shape);
case GGPlotPackage.GEOM_POINT_LAYER__SIZE:
return SIZE_EDEFAULT == null ? this.size != null : !SIZE_EDEFAULT.equals(this.size);
case GGPlotPackage.GEOM_POINT_LAYER__COLOR:
return COLOR_EDEFAULT == null ? this.color != null : !COLOR_EDEFAULT.equals(this.color);
case GGPlotPackage.GEOM_POINT_LAYER__FILL:
return FILL_EDEFAULT == null ? this.fill != null : !FILL_EDEFAULT.equals(this.fill);
case GGPlotPackage.GEOM_POINT_LAYER__ALPHA:
return ALPHA_EDEFAULT == null ? this.alpha != null : !ALPHA_EDEFAULT.equals(this.alpha);
case GGPlotPackage.GEOM_POINT_LAYER__POSITION_XJITTER:
return POSITION_XJITTER_EDEFAULT == null ? this.positionXJitter != null : !POSITION_XJITTER_EDEFAULT.equals(this.positionXJitter);
case GGPlotPackage.GEOM_POINT_LAYER__POSITION_YJITTER:
return POSITION_YJITTER_EDEFAULT == null ? this.positionYJitter != null : !POSITION_YJITTER_EDEFAULT.equals(this.positionYJitter);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eBaseStructuralFeatureID(final int derivedFeatureID, final Class<?> baseClass) {
if (baseClass == PropShapeProvider.class) {
switch (derivedFeatureID) {
case GGPlotPackage.GEOM_POINT_LAYER__SHAPE: return GGPlotPackage.PROP_SHAPE_PROVIDER__SHAPE;
default: return -1;
}
}
if (baseClass == PropSizeProvider.class) {
switch (derivedFeatureID) {
case GGPlotPackage.GEOM_POINT_LAYER__SIZE: return GGPlotPackage.PROP_SIZE_PROVIDER__SIZE;
default: return -1;
}
}
if (baseClass == PropColorProvider.class) {
switch (derivedFeatureID) {
case GGPlotPackage.GEOM_POINT_LAYER__COLOR: return GGPlotPackage.PROP_COLOR_PROVIDER__COLOR;
default: return -1;
}
}
if (baseClass == PropFillProvider.class) {
switch (derivedFeatureID) {
case GGPlotPackage.GEOM_POINT_LAYER__FILL: return GGPlotPackage.PROP_FILL_PROVIDER__FILL;
default: return -1;
}
}
if (baseClass == PropAlphaProvider.class) {
switch (derivedFeatureID) {
case GGPlotPackage.GEOM_POINT_LAYER__ALPHA: return GGPlotPackage.PROP_ALPHA_PROVIDER__ALPHA;
default: return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(final int baseFeatureID, final Class<?> baseClass) {
if (baseClass == PropShapeProvider.class) {
switch (baseFeatureID) {
case GGPlotPackage.PROP_SHAPE_PROVIDER__SHAPE: return GGPlotPackage.GEOM_POINT_LAYER__SHAPE;
default: return -1;
}
}
if (baseClass == PropSizeProvider.class) {
switch (baseFeatureID) {
case GGPlotPackage.PROP_SIZE_PROVIDER__SIZE: return GGPlotPackage.GEOM_POINT_LAYER__SIZE;
default: return -1;
}
}
if (baseClass == PropColorProvider.class) {
switch (baseFeatureID) {
case GGPlotPackage.PROP_COLOR_PROVIDER__COLOR: return GGPlotPackage.GEOM_POINT_LAYER__COLOR;
default: return -1;
}
}
if (baseClass == PropFillProvider.class) {
switch (baseFeatureID) {
case GGPlotPackage.PROP_FILL_PROVIDER__FILL: return GGPlotPackage.GEOM_POINT_LAYER__FILL;
default: return -1;
}
}
if (baseClass == PropAlphaProvider.class) {
switch (baseFeatureID) {
case GGPlotPackage.PROP_ALPHA_PROVIDER__ALPHA: return GGPlotPackage.GEOM_POINT_LAYER__ALPHA;
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) {
return super.toString();
}
final StringBuffer result= new StringBuffer(super.toString());
result.append(" (shape: "); //$NON-NLS-1$
result.append(this.shape);
result.append(", size: "); //$NON-NLS-1$
result.append(this.size);
result.append(", color: "); //$NON-NLS-1$
result.append(this.color);
result.append(", fill: "); //$NON-NLS-1$
result.append(this.fill);
result.append(", alpha: "); //$NON-NLS-1$
result.append(this.alpha);
result.append(", positionXJitter: "); //$NON-NLS-1$
result.append(this.positionXJitter);
result.append(", positionYJitter: "); //$NON-NLS-1$
result.append(this.positionYJitter);
result.append(')');
return result.toString();
}
} //GeomPointLayerImpl