blob: 9d0d6ff19746e5011432d80a7369dec3d9b11ee8 [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.common.geometry.data3d.ui.impl;
import org.eclipse.apogy.common.geometry.data3d.ui.ApogyCommonGeometryData3DUIPackage;
import org.eclipse.apogy.common.geometry.data3d.ui.scene_objects.ColoredCartesianTriangularMeshSceneObject;
import org.eclipse.apogy.common.topology.ui.SceneObject;
import org.eclipse.emf.common.notify.Notification;
public class ColoredTriangularMeshPresentationCustomImpl extends ColoredTriangularMeshPresentationImpl {
@Override
public void setSceneObject(SceneObject newSceneObject) {
if (newSceneObject != null && !(newSceneObject instanceof ColoredCartesianTriangularMeshSceneObject)) {
throw new IllegalArgumentException();
}
super.setSceneObject(newSceneObject);
}
@Override
protected void updateSceneObject(Notification notification) {
if (this.sceneObject != null) {
ColoredCartesianTriangularMeshSceneObject coloredCartesianCoordinatesSetSceneObject = (ColoredCartesianTriangularMeshSceneObject) this.sceneObject;
if (notification.getNotifier() instanceof ColoredTriangularMeshPresentationCustomImpl) {
int featureID = notification.getFeatureID(ColoredTriangularMeshPresentationCustomImpl.class);
switch (featureID) {
case ApogyCommonGeometryData3DUIPackage.COLORED_TRIANGULAR_MESH_PRESENTATION__OVERRIDE_COLOR:
boolean newOverrideColor = notification.getNewBooleanValue();
coloredCartesianCoordinatesSetSceneObject.setOverrideColor(newOverrideColor);
break;
default:
break;
}
}
}
super.updateSceneObject(notification);
}
@Override
protected void initialSceneObject() {
ColoredCartesianTriangularMeshSceneObject meshSceneObject = (ColoredCartesianTriangularMeshSceneObject) this.sceneObject;
meshSceneObject.setOverrideColor(isOverrideColor());
super.initialSceneObject();
}
@Override
protected void applyPreferences() {
// TODO
super.applyPreferences();
}
} // ColoredTriangularMeshPresentationImpl