| /******************************************************************************* |
| * 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.addons.impl; |
| |
| import javax.vecmath.Color3f; |
| |
| import org.eclipse.emf.ecore.EDataType; |
| |
| public class ApogyAddonsFactoryCustomImpl extends ApogyAddonsFactoryImpl { |
| |
| @Override |
| public Color3f createColor3fFromString(EDataType eDataType, String initialValue) { |
| Color3f color3f = new Color3f(); |
| |
| String[] values = initialValue.split(","); |
| |
| color3f.x = Float.parseFloat(values[0]); |
| color3f.y = Float.parseFloat(values[1]); |
| color3f.z = Float.parseFloat(values[2]); |
| |
| return color3f; |
| } |
| |
| @Override |
| public String convertColor3fToString(EDataType eDataType, Object instanceValue) { |
| Color3f color3f = (Color3f) instanceValue; |
| String string = color3f.x + "," + color3f.y + "," + color3f.z; |
| return string; |
| } |
| |
| } // ApogyAddonsFactoryImpl |