blob: eed9abdd9b24e1f6b0d137b206a1147acb389fe2 [file] [log] [blame]
/*******************************************************************************
* 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,
* Sebastien Gemme - initial API and implementation
*
* SPDX-License-Identifier: EPL-1.0
*
*******************************************************************************/
package org.eclipse.apogy.common.topology.ui.impl;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.swt.graphics.RGB;
public class ApogyCommonTopologyUIFactoryCustomImpl extends ApogyCommonTopologyUIFactoryImpl {
public RGB createRGBFromString(EDataType eDataType, String initialValue) {
String[] values = initialValue.split(",");
return new RGB(Integer.parseInt(values[0]), Integer.parseInt(values[1]), Integer.parseInt(values[2]));
}
public String convertRGBToString(EDataType eDataType, Object instanceValue) {
RGB rgb = (RGB) instanceValue;
return Integer.toString(rgb.red) + "," + Integer.toString(rgb.green) + "," + Integer.toString(rgb.blue);
}
} // ApogyCommonTopologyUIFactoryImpl