blob: b17920936a762cbfeffb56be19a630ce05564572 [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.sensors.range.ui.impl;
import org.eclipse.apogy.addons.sensors.range.SimpleSonar;
import org.eclipse.apogy.addons.sensors.range.ui.ApogyAddonsSensorsRangeUIPackage;
import org.eclipse.apogy.addons.sensors.range.ui.scene_objects.SimpleSonarSceneObject;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.swt.graphics.RGB;
public class SimpleSonarPresentationCustomImpl extends SimpleSonarPresentationImpl {
public static final RGB DEFAULT_SIMPLE_SONAR_COLOR = new RGB(255, 255, 0);
@Override
protected void initialSceneObject() {
super.initialSceneObject();
SimpleSonarSceneObject j3DObject = (SimpleSonarSceneObject) this.sceneObject;
j3DObject.setDetectedRangeVisible(isDetectedRangeVisible());
j3DObject.setColor(this.getColor());
}
@Override
protected void updateSceneObject(Notification notification) {
if (this.sceneObject != null) {
SimpleSonarSceneObject j3DObject = (SimpleSonarSceneObject) this.sceneObject;
if (notification.getFeatureID(
SimpleSonar.class) == ApogyAddonsSensorsRangeUIPackage.SIMPLE_SONAR_PRESENTATION__DETECTED_RANGE_VISIBLE) {
j3DObject.setDetectedRangeVisible(notification.getNewBooleanValue());
}
}
super.updateSceneObject(notification);
}
} // SimpleSonarPresentationImpl