...
 
Commits (6)
......@@ -144,6 +144,12 @@
modelElementClass="org.fortiss.af3.operatorpanel.model.OperatorPanelSpecification">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.operatorpanel.ui.editor.fx.OP3DDisplayFXEditorBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.operatorpanel.viewpanel.model.OP3DDisplay">
</modelElementClass>
</modelEditorBinding>
</extension>
<extension
point="org.fortiss.tooling.kernel.ui.editPartFactory">
......
AF3OperatorpanelUIActivator.java da62dfee6cd275c4ca9ecc60e945de6ee57dd74a GREEN
AF3OperatorpanelUIActivator.java a81b2456e732db25967cd69bdf44c522fa662006 GREEN
......@@ -16,6 +16,7 @@
package org.fortiss.af3.operatorpanel.ui;
import static org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin;
import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.getURIString;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.jface.resource.ImageDescriptor;
......@@ -57,4 +58,9 @@ public class AF3OperatorpanelUIActivator extends Plugin {
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
/** Returns the FX image URI for the given icon file. */
public static String getFXImageURI(String path) {
return getURIString(PLUGIN_ID, path);
}
}
OperatorPanelControllerFactory.java f952a43ebe7fdc3306e6ec500597c3c289bf07c9 YELLOW
OP3DDisplayFXEditor.java b4fabe39853ecc881d353c0bccecaf8c2b42ccfd GREEN
OP3DDisplayFXEditorBinding.java 2345cef0a2c163771f09126e8b7b3f9004c27713 GREEN
OP3DDisplayFXEditorContentProvider.java bf0eb313b06b4ace9cd74676cf1b7dd1ff344fe3 GREEN
OP3DDisplayFXEditorUIProvider.java 4258601c3b7de3b3bcef19a01fd38407286fd8c1 GREEN
OperatorPanelControllerFactory.java f952a43ebe7fdc3306e6ec500597c3c289bf07c9 GREEN
OperatorPanelFXEditor.java f3f4a848984763fafdc57e4499f0318829d27e47 GREEN
OperatorPanelFXEditorBinding.java ef731fdb72b7fdfe0d732f60f1fe4b65f6fd2347 YELLOW
OperatorPanelItemController.java c56be48244a1e8afc2ac508bf0a225cf155a8a3d YELLOW
OperatorPanelModelFactory.java 0aac651a3e24464e90064d25edf194b188fb473c YELLOW
OperatorPanelVisualFactory.java 972834b94f53efae21aeec2cc9cf47794c386a63 YELLOW
OperatorPanelFXEditorBinding.java ef731fdb72b7fdfe0d732f60f1fe4b65f6fd2347 GREEN
OperatorPanelItemController.java c56be48244a1e8afc2ac508bf0a225cf155a8a3d GREEN
OperatorPanelModelFactory.java 0aac651a3e24464e90064d25edf194b188fb473c GREEN
OperatorPanelVisualFactory.java 972834b94f53efae21aeec2cc9cf47794c386a63 GREEN
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.editor.fx;
import java.util.List;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.operatorpanel.viewpanel.model.OP3DDisplay;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.CompositeDisplayNode;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.RotationDisplayNode;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.ScalingDisplayNode;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.TranslationDisplayNode;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeContentProviderBase;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableUIProviderBase;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableViewer;
import org.fortiss.tooling.kernel.ui.extension.base.FXEditorBase;
import org.fortiss.tooling.kernel.utils.KernelServiceBasedModelListenerBase;
import javafx.scene.Parent;
/**
* Implementation of the {@link OP3DDisplay} model editor.
*
* @author hoelzl
*/
public class OP3DDisplayFXEditor extends FXEditorBase<OP3DDisplay> {
/** The tree-table viewer. */
private DynamicTreeTableViewer<Object> treeTableViewer;
/** The model listener. */
private KernelServiceBasedModelListenerBase<OP3DDisplay> modelListener;
/** {@inheritDoc} */
@Override
protected Parent createSceneRoot() {
OP3DDisplay display = getEditedObject();
modelListener = new KernelServiceBasedModelListenerBase<OP3DDisplay>(display) {
/** {@inheritDoc} */
@Override
public void updateComplete(List<Notification> notifications) {
treeTableViewer.update();
}
};
modelListener.register();
DynamicTreeContentProviderBase<Object> contentProvider =
new OP3DDisplayFXEditorContentProvider(this);
DynamicTreeTableUIProviderBase<Object> uiProvider = new OP3DDisplayFXEditorUIProvider(this);
treeTableViewer =
new DynamicTreeTableViewer<>(display, true, 2, contentProvider, uiProvider);
treeTableViewer.addColumn("Name", 200);
treeTableViewer.addColumn("Info", 280);
treeTableViewer.addColumn("Comment", 320);
return treeTableViewer.getControl();
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public Class<? extends EObject>[] getVisibleEObjectTypes() {
return new Class[] {editedObject.getClass(), TranslationDisplayNode.class,
ScalingDisplayNode.class, RotationDisplayNode.class, CompositeDisplayNode.class};
}
/** {@inheritDoc} */
@Override
public void dispose() {
modelListener.unregister();
super.dispose();
}
/** {@inheritDoc} */
@Override
public void setFocus() {
treeTableViewer.getControl().requestFocus();
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.editor.fx;
import org.eclipse.ui.IEditorPart;
import org.fortiss.af3.operatorpanel.viewpanel.model.OP3DDisplay;
import org.fortiss.tooling.kernel.ui.extension.base.ModelEditorBindingBase;
/**
* Editor binding for the data dictionary editor.
*
* @author hoelzl
*/
public final class OP3DDisplayFXEditorBinding extends ModelEditorBindingBase<OP3DDisplay> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass() {
return OP3DDisplayFXEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "3D Display Scene Editor (FX)";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return -100;
}
}
/*-------------------------------------------------------------------------+
| Copyright 2020 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.editor.fx;
import java.util.ArrayList;
import java.util.Collection;
import org.fortiss.af3.operatorpanel.viewpanel.model.OP3DDisplay;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.CompositeDisplayNode;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeContentProviderBase;
import org.fortiss.tooling.graphicsGL.model.mesh.Mesh3D;
import org.fortiss.tooling.graphicsGL.model.scene.Object3D;
/**
* Content provider for FX-based data dictionary editor.
*
* @author hoelzl
*/
final class OP3DDisplayFXEditorContentProvider extends DynamicTreeContentProviderBase<Object> {
/** The objects composite tree item used to put all {@link Object3D}s into one category. */
private static final String OBJECTS_TREE_ITEM = "Loaded Objects";
/** The editor. */
private final OP3DDisplayFXEditor editor;
/** Constructor. */
public OP3DDisplayFXEditorContentProvider(OP3DDisplayFXEditor editor) {
this.editor = editor;
}
/** {@inheritDoc} */
@Override
protected Collection<? extends Object> getChildren(Object parent) {
ArrayList<Object> result = new ArrayList<Object>();
if(parent instanceof CompositeDisplayNode) {
result.addAll(((CompositeDisplayNode)parent).getSubNodes());
} else if(parent instanceof OP3DDisplay) {
result.add(OBJECTS_TREE_ITEM);
result.add(((OP3DDisplay)parent).getScene());
} else if(parent instanceof String && parent.equals(OBJECTS_TREE_ITEM)) {
OP3DDisplay display = editor.getEditedObject();
result.addAll(display.getLoadedObjects());
} else if(parent instanceof Object3D) {
Mesh3D mesh = ((Object3D)parent).getMesh();
if(mesh != null) {
result.addAll(mesh.getMaterialGroups());
}
}
return result;
}
}
/*-------------------------------------------------------------------------+
| Copyright 2020 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.editor.fx;
import static org.fortiss.af3.operatorpanel.ui.handler.InfoUtils.getInfo;
import static org.fortiss.tooling.base.ui.editor.fx.controller.ContextMenuUtil.createPrototypeMenu;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.fortiss.af3.operatorpanel.viewpanel.model.OP3DDisplay;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.CameraDisplayNode;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.LightDisplayNode;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.ObjectDisplayNode;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.TransformDisplayNodeBase;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableUIProviderBase;
import org.fortiss.tooling.graphicsGL.model.mesh.MaterialGroup3D;
import org.fortiss.tooling.graphicsGL.model.scene.Object3D;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
import javafx.scene.Node;
import javafx.scene.control.ContextMenu;
/**
* UI provider for the FX-based data dictionary editor.
*
* @author hoelzl
*/
final class OP3DDisplayFXEditorUIProvider extends DynamicTreeTableUIProviderBase<Object> {
/** The editor used to post selection changes. */
private final OP3DDisplayFXEditor editor;
/** Constructor. */
public OP3DDisplayFXEditorUIProvider(OP3DDisplayFXEditor editor) {
this.editor = editor;
}
/** {@inheritDoc} */
@Override
public String getLabel(Object element, int column) {
if(column == 0) {
if(element instanceof EObject) {
return getModelElementHandlerName((EObject)element);
}
if(element instanceof String) {
return (String)element;
}
return "";
}
if(column == 1) {
if(element instanceof OP3DDisplay) {
return getInfo((OP3DDisplay)element);
} else if(element instanceof Object3D) {
return getInfo((Object3D)element);
} else if(element instanceof ObjectDisplayNode) {
return getInfo((ObjectDisplayNode)element);
} else if(element instanceof TransformDisplayNodeBase) {
return getInfo((TransformDisplayNodeBase)element);
} else if(element instanceof CameraDisplayNode) {
return getInfo((CameraDisplayNode)element);
} else if(element instanceof LightDisplayNode) {
return getInfo((LightDisplayNode)element);
} else if(element instanceof MaterialGroup3D) {
return getInfo((MaterialGroup3D)element);
}
return "";
}
if(column == 2) {
if(element instanceof INamedCommentedElement || element instanceof MaterialGroup3D) {
return getModelElementHandlerDescription((EObject)element);
}
}
return "";
}
/** {@inheritDoc} */
@Override
public Node getIconNode(Object element, int column) {
if(column == 0 && element instanceof EObject) {
return getModelElementHandlerIcon((EObject)element);
}
return null;
}
/** {@inheritDoc} */
@Override
public void select(Object oldValue, Object newValue) {
IStructuredSelection selection =
newValue == null ? StructuredSelection.EMPTY : new StructuredSelection(newValue);
editor.getSite().getSelectionProvider().setSelection(selection);
}
/** Returns the name returned by {@link IModelElementHandlerService}. */
private String getModelElementHandlerName(EObject eo) {
return IModelElementHandlerService.getInstance().getName(eo);
}
/** Returns the description returned by {@link IModelElementHandlerService}. */
private String getModelElementHandlerDescription(EObject eo) {
return IModelElementHandlerService.getInstance().getDescription(eo);
}
/** Returns the icon returned by the iMEHS. */
private Node getModelElementHandlerIcon(EObject eo) {
if(eo == null) {
return null;
}
return IModelElementHandlerService.getInstance().getFXIcon(eo);
}
/** {@inheritDoc} */
@Override
public ContextMenu createContextMenu(Object element, int column) {
if(element == null || !(element instanceof EObject) || column != 0) {
return null;
}
ContextMenu contextMenu = new ContextMenu();
contextMenu.getItems().addAll(createPrototypeMenu((EObject)element, null));
return contextMenu;
}
}
AreaInputVisual.java dd069b65cd92b0b4b57edd587c0166bb705202ff YELLOW
ButtonVisual.java 51da4d17861a50788933974fdcdbe0708676baeb YELLOW
ColorDisplayVisual.java b4b21c3bb8564c87ac6c38eef6e14715ef834e10 YELLOW
Display3DVisual.java 437d4545f653540b29b5304c23cc73d175c86f2d YELLOW
Graph2DVisual.java c5d37db44cd853b2422e300e71cede414eb3ef61 YELLOW
ITermInputVisual.java 78f73d951dc25b64d442f2ffc79f8544d67a3418 YELLOW
LabelVisual.java 59b852c765edb7e0743d72c3910afe1b6d86b594 YELLOW
OperatorPanelItemVisualBase.java 87042386b7b0edd902677d4a40e92e0b580ef6ee YELLOW
TextDisplayVisual.java f184d66e77f97ddd9387b396f3a86e21a7e70cb0 YELLOW
AreaInputVisual.java dd069b65cd92b0b4b57edd587c0166bb705202ff GREEN
ButtonVisual.java 51da4d17861a50788933974fdcdbe0708676baeb GREEN
ColorDisplayVisual.java b4b21c3bb8564c87ac6c38eef6e14715ef834e10 GREEN
Display3DVisual.java 437d4545f653540b29b5304c23cc73d175c86f2d GREEN
Graph2DVisual.java c5d37db44cd853b2422e300e71cede414eb3ef61 GREEN
ITermInputVisual.java 78f73d951dc25b64d442f2ffc79f8544d67a3418 GREEN
LabelVisual.java 59b852c765edb7e0743d72c3910afe1b6d86b594 GREEN
OperatorPanelItemVisualBase.java 87042386b7b0edd902677d4a40e92e0b580ef6ee GREEN
TextDisplayVisual.java f184d66e77f97ddd9387b396f3a86e21a7e70cb0 GREEN
CameraDisplayNodeHandler.java b97a3ab754dc8a99803f7c88e2dfc36ce789ca0a GREEN
CompositeDisplayNodeHandler.java 0eac8a42bdb25a3892c5ebbdc7235f97087cdd07 GREEN
DisplayNodeHandlerBase.java a3e527a41a7bea58909e7b1eb666b0e1c365d357 GREEN
CameraDisplayNodeHandler.java babc41556d6e3cc7cd9abfe7995994d892953e60 GREEN
CompositeDisplayNodeHandler.java 7e01c6d4d7530c32df28f2cf1d6e7c276b29dcbb GREEN
DisplayNodeHandlerBase.java 7e37907947125fb3860be62c3afe159e20ea3663 GREEN
InfoUtils.java 25058ec99fbdce4f9f4868d0b2b113599e5ce954 GREEN
LightDisplayNodeHandler.java baabe44a13b7344310c2df84a90b4ea28b1aa72e GREEN
MaterialGroup3DHandler.java 635f02d24a850f3d396097e08b3e65606e2f92fc GREEN
LightDisplayNodeHandler.java 793a169b3c7479252acfbfbf8f0ab7a0e26c9095 GREEN
MaterialGroup3DHandler.java bf8e949fcc163d0a89999580b239bce2d874af89 GREEN
OP2DGraphDisplayHandler.java 48b8e0a1bdd9c4471ae042744d8c46e97151c67a GREEN
OP3DDisplayHandler.java d3e8d0f6d33266dc3ffacf93171003494d53bace GREEN
OP3DDisplayHandler.java 03d2f10b98ea4912a339961314c177e03b5acdea GREEN
OPAreaInputHandler.java bcece79d54adfaeb99cba91d0b090fa5885ed12f GREEN
OPButtonHandler.java 155f9f023b2393281937eaf004ecdfe42196f4b7 GREEN
OPColorDisplayHandler.java add580ac51e93aa1c2c5f9da76f06553aebfcb10 GREEN
OPITermInputHandler.java e2c6d21cfccf6d2a06b4f9db40027ec6a63ae06e GREEN
OPLabelHandler.java 71cdacb3c73347a07b5ab2207d173cbe0dd55ad5 GREEN
OPTextDisplayHandler.java d4d2382d708fd9b02197f29170bb0bd5fa5ca6f9 GREEN
Object3DHandler.java 54b8e79f25857b5ef6ea5cddc220f604cc10f1d6 GREEN
ObjectDisplayNodeHandler.java b32249e24c2597b6845b4f84aa502147499e2f78 GREEN
Object3DHandler.java d75cb4e626e5b42651bcbcb9ed89bbfcc3def125 GREEN
ObjectDisplayNodeHandler.java eaee4b7ae8605d70753231dca9a5f3450ef055bd GREEN
OperatorPanelSpecificationHandler.java fdca4515a01d30b4caf8f1a0e800bd027aede07c GREEN
RotationDisplayNodeHandler.java a11bc8d5a8aa482fe17dde41646206a1b9578a22 GREEN
ScalingDisplayNodeHandler.java d4e46f9ef93eb6f4199b629e0489e7216cd5c4e3 GREEN
TranslationDisplayNodeHandler.java 327e3997db12b661fed7084bf2d83550d7cf12cf GREEN
RotationDisplayNodeHandler.java 89bb30cad735f135b167dd55f64cd63f467af207 GREEN
ScalingDisplayNodeHandler.java 840c0317255fd104e8f877823c007cb23a43901c GREEN
TranslationDisplayNodeHandler.java c204719a8e799248966021e2d655123380be306d GREEN
......@@ -15,9 +15,6 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.CameraDisplayNode;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
......@@ -29,7 +26,7 @@ import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
public class CameraDisplayNodeHandler extends DisplayNodeHandlerBase<CameraDisplayNode> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/camera.png");
protected String getIconPath() {
return "icons/camera.png";
}
}
......@@ -15,9 +15,6 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.CompositeDisplayNode;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
......@@ -29,7 +26,7 @@ import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
public class CompositeDisplayNodeHandler extends DisplayNodeHandlerBase<CompositeDisplayNode> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/scene.png");
protected String getIconPath() {
return "icons/scene.png";
}
}
......@@ -15,6 +15,10 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getFXImageURI;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
......@@ -27,6 +31,21 @@ import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHa
abstract class DisplayNodeHandlerBase<T extends INamedCommentedElement>
extends NamedCommentedModelElementHandlerBase<T> {
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor(getIconPath());
}
/** Returns the path for the icon relative to the plugin root. */
protected abstract String getIconPath();
/** {@inheritDoc} */
@Override
protected final String getFXIconURL(T element) {
return getFXImageURI(getIconPath());
}
/** {@inheritDoc} */
@Override
public boolean hiddenInNonExpertView() {
......
......@@ -15,9 +15,6 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.LightDisplayNode;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
......@@ -29,7 +26,7 @@ import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
public class LightDisplayNodeHandler extends DisplayNodeHandlerBase<LightDisplayNode> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/light.png");
protected String getIconPath() {
return "icons/light.png";
}
}
......@@ -15,6 +15,7 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getFXImageURI;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
......@@ -34,6 +35,12 @@ public class MaterialGroup3DHandler extends ModelElementHandlerBase<MaterialGrou
return getImageDescriptor("icons/material.png");
}
/** {@inheritDoc} */
@Override
protected String getFXIconURL(MaterialGroup3D element) {
return getFXImageURI("icons/material.png");
}
/** {@inheritDoc} */
@Override
public boolean hiddenInNonExpertView() {
......
......@@ -15,6 +15,7 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getFXImageURI;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
......@@ -34,6 +35,12 @@ public class OP3DDisplayHandler extends NamedCommentedModelElementHandlerBase<OP
return getImageDescriptor("icons/display3D.png");
}
/** {@inheritDoc} */
@Override
protected String getFXIconURL(OP3DDisplay element) {
return getFXImageURI("icons/display3D.png");
}
/** {@inheritDoc} */
@Override
public boolean hiddenInNonExpertView() {
......
......@@ -15,9 +15,6 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.tooling.graphicsGL.model.scene.Object3D;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
......@@ -29,7 +26,7 @@ import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
public class Object3DHandler extends DisplayNodeHandlerBase<Object3D> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/object.png");
protected String getIconPath() {
return "icons/object.png";
}
}
......@@ -15,9 +15,6 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.ObjectDisplayNode;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
......@@ -29,7 +26,7 @@ import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
public class ObjectDisplayNodeHandler extends DisplayNodeHandlerBase<ObjectDisplayNode> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/object_node.png");
protected String getIconPath() {
return "icons/object_node.png";
}
}
......@@ -15,9 +15,6 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.RotationDisplayNode;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
......@@ -29,7 +26,7 @@ import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
public class RotationDisplayNodeHandler extends DisplayNodeHandlerBase<RotationDisplayNode> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/rotation.png");
protected String getIconPath() {
return "icons/rotation.png";
}
}
......@@ -15,9 +15,6 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.ScalingDisplayNode;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
......@@ -29,7 +26,7 @@ import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
public class ScalingDisplayNodeHandler extends DisplayNodeHandlerBase<ScalingDisplayNode> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/scaling.png");
protected String getIconPath() {
return "icons/scaling.png";
}
}
......@@ -15,9 +15,6 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.operatorpanel.ui.handler;
import static org.fortiss.af3.operatorpanel.ui.AF3OperatorpanelUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.operatorpanel.viewpanel.model.node3D.TranslationDisplayNode;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
......@@ -29,7 +26,7 @@ import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
public class TranslationDisplayNodeHandler extends DisplayNodeHandlerBase<TranslationDisplayNode> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/translation.png");
protected String getIconPath() {
return "icons/translation.png";
}
}
......@@ -32,7 +32,6 @@ import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.fortiss.af3.safetycases.model.ArgumentElement;
import org.fortiss.af3.safetycases.model.ArgumentModule;
import org.fortiss.af3.safetycases.model.AwayContext;
import org.fortiss.af3.safetycases.model.AwayGoal;
......@@ -50,7 +49,6 @@ import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
* This class implements the action of automatically generating all the intra-module dependencies.
*
* @author carlan
* TODO(JE): remove warnings.
*/
public class GenerateModuleConnections implements IContextMenuContributor {
......@@ -197,8 +195,7 @@ public class GenerateModuleConnections implements IContextMenuContributor {
if(ele instanceof AwayContext) {
boolean refNotNull = ((AwayContext)ele).getPointsTo() != null;
if(refNotNull) {
list.add((ArgumentModule)((ArgumentElement)((AwayContext)ele).getPointsTo())
.getModule());
list.add((ArgumentModule)((AwayContext)ele).getPointsTo().getModule());
} else {
nulReferences = true;
}
......@@ -222,16 +219,14 @@ public class GenerateModuleConnections implements IContextMenuContributor {
if(ihe instanceof AwayGoal) {
boolean refNotNull = ((AwayGoal)ihe).getPointsTo() != null;
if(refNotNull) {
list.add((ArgumentModule)((ArgumentElement)((AwayGoal)ihe).getPointsTo())
.getModule());
list.add((ArgumentModule)((AwayGoal)ihe).getPointsTo().getModule());
} else {
nulReferences = true;
}
} else if(ihe instanceof AwaySolution) {
boolean refNotNull2 = ((AwaySolution)ihe).getPointsTo() != null;
if(refNotNull2) {
list.add((ArgumentModule)((ArgumentElement)((AwaySolution)ihe).getPointsTo())
.getModule());
list.add((ArgumentModule)((AwaySolution)ihe).getPointsTo().getModule());
} else {
nulReferences = true;
}
......