blob: e9f572ce483390fa294d05fcc01a2ea3706e33cf [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.core.environment.surface.ui.impl;
import org.eclipse.apogy.common.emf.ui.EClassSettings;
import org.eclipse.apogy.core.environment.surface.ApogySurfaceEnvironmentFactory;
import org.eclipse.apogy.core.environment.surface.ImageMapLayerPresentation;
import org.eclipse.apogy.core.environment.surface.ui.MapLayerPresentationUISettings;
import org.eclipse.apogy.core.environment.surface.ui.wizards.ImageMapLayerPresentationWizardPage;
import org.eclipse.emf.common.command.CompoundCommand;
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.emf.edit.domain.EditingDomain;
import org.eclipse.jface.wizard.WizardPage;
public class ImageMapLayerPresentationWizardPagesProviderCustomImpl
extends ImageMapLayerPresentationWizardPagesProviderImpl {
@Override
public EObject createEObject(EClass eClass, EClassSettings settings) {
ImageMapLayerPresentation imageMapLayerPresentation = ApogySurfaceEnvironmentFactory.eINSTANCE
.createImageMapLayerPresentation();
imageMapLayerPresentation.setAlpha(1.0f);
imageMapLayerPresentation.setVisible(true);
MapLayerPresentationUISettings mapLayerPresentationUISettings = (MapLayerPresentationUISettings) settings;
mapLayerPresentationUISettings.setImageMapLayerPresentation(imageMapLayerPresentation);
imageMapLayerPresentation.setName(mapLayerPresentationUISettings.getName());
return imageMapLayerPresentation;
}
@Override
public EList<WizardPage> instantiateWizardPages(EObject eObject, EClassSettings settings) {
EList<WizardPage> list = new BasicEList<>();
list.addAll(super.instantiateWizardPages(eObject, settings));
MapLayerPresentationUISettings mapLayerPresentationUISettings = (MapLayerPresentationUISettings) settings;
list.add(new ImageMapLayerPresentationWizardPage(mapLayerPresentationUISettings));
return list;
}
@Override
public CompoundCommand getPerformFinishCommands(EObject eObject, EClassSettings settings,
EditingDomain editingDomain) {
MapLayerPresentationUISettings mapLayerPresentationUISettings = (MapLayerPresentationUISettings) settings;
ImageMapLayerPresentation imlp = (ImageMapLayerPresentation) eObject;
imlp.setMapLayer(mapLayerPresentationUISettings.getImageMapLayer());
return null;
}
} // ImageMapLayerPresentationWizardPagesProviderImpl