blob: 57a5f8ebd85319ade9f863b44762ced80b44b961 [file] [log] [blame]
/**
* <copyright>
*
* Copyright (c) 2005, 2010 SAP AG.
* 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:
* SAP AG - initial API, implementation and documentation
*
* </copyright>
*/
package org.eclipse.graphiti.mm.algorithms.styles.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.graphiti.mm.StyleContainer;
import org.eclipse.graphiti.mm.algorithms.styles.*;
import org.eclipse.graphiti.mm.algorithms.styles.AbstractStyle;
import org.eclipse.graphiti.mm.algorithms.styles.AdaptedGradientColoredAreas;
import org.eclipse.graphiti.mm.algorithms.styles.Color;
import org.eclipse.graphiti.mm.algorithms.styles.Font;
import org.eclipse.graphiti.mm.algorithms.styles.GradientColoredArea;
import org.eclipse.graphiti.mm.algorithms.styles.GradientColoredAreas;
import org.eclipse.graphiti.mm.algorithms.styles.GradientColoredLocation;
import org.eclipse.graphiti.mm.algorithms.styles.Point;
import org.eclipse.graphiti.mm.algorithms.styles.PrecisionPoint;
import org.eclipse.graphiti.mm.algorithms.styles.RenderingStyle;
import org.eclipse.graphiti.mm.algorithms.styles.Style;
import org.eclipse.graphiti.mm.algorithms.styles.StylesPackage;
import org.eclipse.graphiti.mm.algorithms.styles.TextStyle;
import org.eclipse.graphiti.mm.algorithms.styles.TextStyleRegion;
/**
* <!-- begin-user-doc -->
* The <b>Switch</b> for the model's inheritance hierarchy.
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
* to invoke the <code>caseXXX</code> method for each class of the model,
* starting with the actual class of the object
* and proceeding up the inheritance hierarchy
* until a non-null result is returned,
* which is the result of the switch.
* <!-- end-user-doc -->
* @see org.eclipse.graphiti.mm.algorithms.styles.StylesPackage
* @generated
*/
public class StylesSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static StylesPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StylesSwitch() {
if (modelPackage == null) {
modelPackage = StylesPackage.eINSTANCE;
}
}
/**
* Checks whether this is a switch for the given package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @parameter ePackage the package in question.
* @return whether this is a switch for the given package.
* @generated
*/
@Override
protected boolean isSwitchFor(EPackage ePackage) {
return ePackage == modelPackage;
}
/**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
@Override
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case StylesPackage.RENDERING_STYLE: {
RenderingStyle renderingStyle = (RenderingStyle)theEObject;
T result = caseRenderingStyle(renderingStyle);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.STYLE: {
Style style = (Style)theEObject;
T result = caseStyle(style);
if (result == null) result = caseStyleContainer(style);
if (result == null) result = caseAbstractStyle(style);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.ABSTRACT_STYLE: {
AbstractStyle abstractStyle = (AbstractStyle)theEObject;
T result = caseAbstractStyle(abstractStyle);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.GRADIENT_COLORED_LOCATION: {
GradientColoredLocation gradientColoredLocation = (GradientColoredLocation)theEObject;
T result = caseGradientColoredLocation(gradientColoredLocation);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.GRADIENT_COLORED_AREA: {
GradientColoredArea gradientColoredArea = (GradientColoredArea)theEObject;
T result = caseGradientColoredArea(gradientColoredArea);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.GRADIENT_COLORED_AREAS: {
GradientColoredAreas gradientColoredAreas = (GradientColoredAreas)theEObject;
T result = caseGradientColoredAreas(gradientColoredAreas);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.ADAPTED_GRADIENT_COLORED_AREAS: {
AdaptedGradientColoredAreas adaptedGradientColoredAreas = (AdaptedGradientColoredAreas)theEObject;
T result = caseAdaptedGradientColoredAreas(adaptedGradientColoredAreas);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.FONT: {
Font font = (Font)theEObject;
T result = caseFont(font);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.POINT: {
Point point = (Point)theEObject;
T result = casePoint(point);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.COLOR: {
Color color = (Color)theEObject;
T result = caseColor(color);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.PRECISION_POINT: {
PrecisionPoint precisionPoint = (PrecisionPoint)theEObject;
T result = casePrecisionPoint(precisionPoint);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.TEXT_STYLE: {
TextStyle textStyle = (TextStyle)theEObject;
T result = caseTextStyle(textStyle);
if (result == null) result = defaultCase(theEObject);
return result;
}
case StylesPackage.TEXT_STYLE_REGION: {
TextStyleRegion textStyleRegion = (TextStyleRegion)theEObject;
T result = caseTextStyleRegion(textStyleRegion);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Rendering Style</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Rendering Style</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRenderingStyle(RenderingStyle object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Style</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Style</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseStyle(Style object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Abstract Style</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Abstract Style</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAbstractStyle(AbstractStyle object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Gradient Colored Location</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Gradient Colored Location</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGradientColoredLocation(GradientColoredLocation object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Gradient Colored Area</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Gradient Colored Area</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGradientColoredArea(GradientColoredArea object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Gradient Colored Areas</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Gradient Colored Areas</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGradientColoredAreas(GradientColoredAreas object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Adapted Gradient Colored Areas</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Adapted Gradient Colored Areas</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAdaptedGradientColoredAreas(AdaptedGradientColoredAreas object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Font</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Font</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFont(Font object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Point</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Point</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePoint(Point object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Color</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Color</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseColor(Color object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Precision Point</em>'.
* <!-- begin-user-doc --> This implementation
* returns null; returning a non-null result will terminate the switch.
*
* @since 0.9 <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Precision Point</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePrecisionPoint(PrecisionPoint object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Text Style</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* @since 0.10
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Text Style</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTextStyle(TextStyle object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Text Style Region</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* @since 0.10
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Text Style Region</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTextStyleRegion(TextStyleRegion object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Style Container</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Style Container</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseStyleContainer(StyleContainer object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch, but this is the last case anyway.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
@Override
public T defaultCase(EObject object) {
return null;
}
} //StylesSwitch