blob: 62b19923320fead7d11a6fb771ffe07e99b2f89f [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 - initial API and implementation
*
* SPDX-License-Identifier: EPL-1.0
*
*******************************************************************************/
package org.eclipse.apogy.addons.ui.impl;
import javax.vecmath.Color3f;
import org.eclipse.apogy.addons.ApogyAddonsFactory;
import org.eclipse.apogy.addons.Ruler3DTool;
import org.eclipse.apogy.addons.ui.AbstractToolEClassSettings;
import org.eclipse.apogy.addons.ui.wizards.Ruler3DToolWizardPage;
import org.eclipse.apogy.common.emf.ui.EClassSettings;
import org.eclipse.apogy.common.math.ApogyCommonMathFacade;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.wizard.WizardPage;
public class Ruler3DToolWizardPagesProviderCustomImpl extends Ruler3DToolWizardPagesProviderImpl {
@Override
public EObject createEObject(EClass eClass, EClassSettings settings) {
Ruler3DTool tool = ApogyAddonsFactory.eINSTANCE.createRuler3DTool();
tool.setFromRelativePosition(ApogyCommonMathFacade.INSTANCE.createTuple3d(0, 0, 0));
tool.setToRelativePosition(ApogyCommonMathFacade.INSTANCE.createTuple3d(0, 0, 0));
tool.setMajorTickColor(new Color3f(0f, 1.0f, 0f));
tool.setMinorTickColor(new Color3f(0f, 1.0f, 0f));
tool.setRulerColor(new Color3f(0f, 1.0f, 0f));
if (settings instanceof AbstractToolEClassSettings) {
AbstractToolEClassSettings abstractToolEClassSettings = (AbstractToolEClassSettings) settings;
tool.setName(abstractToolEClassSettings.getName());
tool.setDescription(abstractToolEClassSettings.getDescription());
}
return tool;
}
@Override
public EList<WizardPage> instantiateWizardPages(EObject eObject, EClassSettings settings) {
EList<WizardPage> list = new BasicEList<>();
list.addAll(super.instantiateWizardPages(eObject, settings));
Ruler3DTool tool = (Ruler3DTool) eObject;
list.add(new Ruler3DToolWizardPage(tool));
return list;
}
} // Ruler3DToolWizardPagesProviderImpl