| /******************************************************************************* |
| * 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: |
| <<<<<<< HEAD |
| * Pierre Allard - initial API and implementation |
| * Regent L'Archeveque |
| * |
| ======= |
| * Pierre Allard, |
| * Regent L'Archeveque - initial API and implementation |
| * |
| >>>>>>> refs/heads/eclipse_pa |
| * SPDX-License-Identifier: EPL-1.0 |
| * |
| *******************************************************************************/ |
| package org.eclipse.apogy.addons.sensors.imaging.ui.converters; |
| |
| import org.eclipse.apogy.addons.sensors.imaging.ImageSnapshot; |
| import org.eclipse.apogy.common.converters.IConverter; |
| import org.eclipse.apogy.core.invocator.ReferenceResultValue; |
| |
| public class ReferenceResultValueToImageSnapshotConverter implements IConverter { |
| |
| @Override |
| public boolean canConvert(Object arg0) { |
| if (arg0 instanceof ReferenceResultValue) { |
| return (((ReferenceResultValue) arg0).getValue() != null |
| && ((ReferenceResultValue) arg0).getValue() instanceof ImageSnapshot); |
| } |
| return false; |
| } |
| |
| @Override |
| public Object convert(Object arg0) throws Exception { |
| return ((ReferenceResultValue) arg0).getValue(); |
| } |
| |
| @Override |
| public Class<?> getInputType() { |
| return ReferenceResultValue.class; |
| } |
| |
| @Override |
| public Class<?> getOutputType() { |
| return ImageSnapshot.class; |
| } |
| } |