| /******************************************************************************* |
| * 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, |
| <<<<<<< HEAD |
| * Sebastien Gemme |
| * |
| ======= |
| * Sebastien Gemme - initial API and implementation |
| * |
| >>>>>>> refs/heads/eclipse_pa |
| * SPDX-License-Identifier: EPL-1.0 |
| * |
| *******************************************************************************/ |
| package org.eclipse.apogy.common.topology.ui.adapters; |
| |
| import org.eclipse.apogy.common.topology.Node; |
| import org.eclipse.apogy.common.topology.RotationNode; |
| import org.eclipse.apogy.common.topology.ui.ApogyCommonTopologyUIFactory; |
| import org.eclipse.apogy.common.topology.ui.NodePresentation; |
| import org.eclipse.apogy.common.topology.ui.NodePresentationAdapter; |
| |
| public class RotationNodePresentationAdapter implements NodePresentationAdapter { |
| |
| public RotationNodePresentationAdapter() { |
| } |
| |
| @Override |
| public Class<?> getAdaptedClass() { |
| return RotationNode.class; |
| } |
| |
| @Override |
| public NodePresentation getAdapter(Node obj, Object context) { |
| NodePresentation nodePresentation = null; |
| |
| if (isAdapterFor(obj)) { |
| nodePresentation = ApogyCommonTopologyUIFactory.eINSTANCE.createRotationNodePresentation(); |
| nodePresentation.setNode(obj); |
| } |
| return nodePresentation; |
| } |
| |
| @Override |
| public boolean isAdapterFor(Node obj) { |
| return obj instanceof RotationNode; |
| } |
| |
| } |