blob: 3876917ac9f3b8da796cebc07774dbf74b6ee077 [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 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Joerg Riegel - 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.ChartDSLPackage;
import org.eclipse.osbp.xtext.chart.ChartHighlighter;
import org.eclipse.osbp.xtext.chart.TooltipLocationEnum;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Chart Highlighter</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartHighlighterImpl#getLocation <em>Location</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartHighlighterImpl#isTooltipAlways <em>Tooltip Always</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartHighlighterImpl#isInsideChart <em>Inside Chart</em>}</li>
* </ul>
*
* @generated
*/
public class ChartHighlighterImpl extends ChartLazyResolverImpl implements ChartHighlighter {
/**
* The default value of the '{@link #getLocation() <em>Location</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLocation()
* @generated
* @ordered
*/
protected static final TooltipLocationEnum LOCATION_EDEFAULT = TooltipLocationEnum.NORTH;
/**
* The cached value of the '{@link #getLocation() <em>Location</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLocation()
* @generated
* @ordered
*/
protected TooltipLocationEnum location = LOCATION_EDEFAULT;
/**
* The default value of the '{@link #isTooltipAlways() <em>Tooltip Always</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isTooltipAlways()
* @generated
* @ordered
*/
protected static final boolean TOOLTIP_ALWAYS_EDEFAULT = false;
/**
* The cached value of the '{@link #isTooltipAlways() <em>Tooltip Always</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isTooltipAlways()
* @generated
* @ordered
*/
protected boolean tooltipAlways = TOOLTIP_ALWAYS_EDEFAULT;
/**
* The default value of the '{@link #isInsideChart() <em>Inside Chart</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isInsideChart()
* @generated
* @ordered
*/
protected static final boolean INSIDE_CHART_EDEFAULT = false;
/**
* The cached value of the '{@link #isInsideChart() <em>Inside Chart</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isInsideChart()
* @generated
* @ordered
*/
protected boolean insideChart = INSIDE_CHART_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ChartHighlighterImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ChartDSLPackage.Literals.CHART_HIGHLIGHTER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TooltipLocationEnum getLocation() {
return location;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLocation(TooltipLocationEnum newLocation) {
TooltipLocationEnum oldLocation = location;
location = newLocation == null ? LOCATION_EDEFAULT : newLocation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_HIGHLIGHTER__LOCATION, oldLocation, location));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isTooltipAlways() {
return tooltipAlways;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTooltipAlways(boolean newTooltipAlways) {
boolean oldTooltipAlways = tooltipAlways;
tooltipAlways = newTooltipAlways;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_HIGHLIGHTER__TOOLTIP_ALWAYS, oldTooltipAlways, tooltipAlways));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isInsideChart() {
return insideChart;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInsideChart(boolean newInsideChart) {
boolean oldInsideChart = insideChart;
insideChart = newInsideChart;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_HIGHLIGHTER__INSIDE_CHART, oldInsideChart, insideChart));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ChartDSLPackage.CHART_HIGHLIGHTER__LOCATION:
return getLocation();
case ChartDSLPackage.CHART_HIGHLIGHTER__TOOLTIP_ALWAYS:
return isTooltipAlways();
case ChartDSLPackage.CHART_HIGHLIGHTER__INSIDE_CHART:
return isInsideChart();
}
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_HIGHLIGHTER__LOCATION:
setLocation((TooltipLocationEnum)newValue);
return;
case ChartDSLPackage.CHART_HIGHLIGHTER__TOOLTIP_ALWAYS:
setTooltipAlways((Boolean)newValue);
return;
case ChartDSLPackage.CHART_HIGHLIGHTER__INSIDE_CHART:
setInsideChart((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_HIGHLIGHTER__LOCATION:
setLocation(LOCATION_EDEFAULT);
return;
case ChartDSLPackage.CHART_HIGHLIGHTER__TOOLTIP_ALWAYS:
setTooltipAlways(TOOLTIP_ALWAYS_EDEFAULT);
return;
case ChartDSLPackage.CHART_HIGHLIGHTER__INSIDE_CHART:
setInsideChart(INSIDE_CHART_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ChartDSLPackage.CHART_HIGHLIGHTER__LOCATION:
return location != LOCATION_EDEFAULT;
case ChartDSLPackage.CHART_HIGHLIGHTER__TOOLTIP_ALWAYS:
return tooltipAlways != TOOLTIP_ALWAYS_EDEFAULT;
case ChartDSLPackage.CHART_HIGHLIGHTER__INSIDE_CHART:
return insideChart != INSIDE_CHART_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(" (location: ");
result.append(location);
result.append(", tooltipAlways: ");
result.append(tooltipAlways);
result.append(", insideChart: ");
result.append(insideChart);
result.append(')');
return result.toString();
}
} //ChartHighlighterImpl