| /******************************************************************************* |
| * Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency |
| * 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: |
| * Pierre Allard, |
| * Regent L'Archeveque - initial API and implementation |
| * |
| * SPDX-License-Identifier: EPL-1.0 |
| *******************************************************************************/ |
| package org.eclipse.apogy.examples.antenna.impl; |
| |
| import org.eclipse.apogy.examples.antenna.ApogyExamplesAntennaFactory; |
| import org.eclipse.apogy.examples.antenna.PTUDishAntenna; |
| import org.eclipse.apogy.examples.antenna.PTUDishAntennaSimulated; |
| import org.eclipse.apogy.examples.antenna.PTUDishAntennaStub; |
| |
| public class ApogyExamplesAntennaFacadeCustomImpl extends ApogyExamplesAntennaFacadeImpl { |
| @Override |
| public PTUDishAntenna makePTUDishAntennaSameType(PTUDishAntenna ptuDishAntenna) { |
| // Used to store the resulting PTU dish antenna |
| PTUDishAntenna newPtuDishAntenna = null; |
| |
| // If the given PTU dish antenna is a stub implementation |
| if (ptuDishAntenna instanceof PTUDishAntennaSimulated) { |
| // Create a simulated implementation instance accordingly |
| newPtuDishAntenna = ApogyExamplesAntennaFactory.eINSTANCE.createPTUDishAntennaSimulated(); |
| } |
| // If the given PTU dish antenna is a stub implementation |
| else if (ptuDishAntenna instanceof PTUDishAntennaStub) { |
| // Create a stub implementation instance accordingly |
| newPtuDishAntenna = ApogyExamplesAntennaFactory.eINSTANCE.createPTUDishAntennaStub(); |
| } |
| |
| // Return the new instance |
| return newPtuDishAntenna; |
| } |
| } |