Commit 2add2718 authored by Johannes Eder's avatar Johannes Eder
Browse files

YELLOW

* created protected method do enable/disable auto layout context menu in
diagram editors

Issue-Ref: 4012
Issue-Url: https://af3-developer.fortiss.org/issues/4012

Signed-off-by: Johannes Eder's avatarJohannes Eder <eder@fortiss.org>
parent 564884b0
AutomatonFXController.java a5696259be316d1d02f4bc46043c33d0330e880d YELLOW
AutomatonFXController.java 3465f628acfdd7e6d93e1510d2dad5d8d4c20acb YELLOW
DataStateFXEditor.java e64fcec84ea83e5ba99e48a6825063471e9ea70d GREEN
DataStateFXEditorBase.java 83655742fdcfdade31eabd7deafa88862f28ba22 GREEN
DataStateFXEditorBinding.java 46ab36b197a6fca102a5e2d75aa24b1fbba26b89 GREEN
......
......@@ -15,22 +15,9 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.state.ui.editor.fx;
import static java.lang.Math.max;
import static org.fortiss.tooling.base.ui.utils.ContextMenuUtils.createDisplayMenu;
import static org.fortiss.tooling.base.ui.utils.ContextMenuUtils.createElementCompositionContext;
import static org.fortiss.tooling.base.ui.utils.ContextMenuUtils.createPrototypeMenu;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.base.ui.editor.fx.controller.EObjectDiagramController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerFeatures;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import javafx.scene.Node;
import javafx.scene.control.MenuItem;
/**
* FX Diagram controller for automata.
......@@ -44,23 +31,10 @@ public class AutomatonFXController<T extends EObject> extends EObjectDiagramCont
super(mvcb, modelType);
}
/**
* {@inheritDoc}
* Does not include auto-layout feature. Despite, same implementation as in super class.
*/
/** {@inheritDoc} */
@Override
public List<MenuItem> contextMenuContributions(Node node, DiagramCoordinate diagramLocation) {
// outer-most grid areas of the diagram are inaccessible
DiagramViewerFeatures features = getViewer().getFeatures();
double x = max(features.getHorizontalSpacing(), diagramLocation.getX());
double y = max(features.getVerticalSpacing(), diagramLocation.getY());
// wild cast works: see constructor exception
T modelParent = getModelElement();
IElementCompositionContext edc = createElementCompositionContext(modelParent, x, y, true,
getViewer().getFeatures().getCurrentZoomFactor());
List<MenuItem> result = createPrototypeMenu(modelParent, edc);
result.add(createDisplayMenu(getViewer()));
return result;
protected boolean enableAutoLayout() {
// auto layout does not work for automata
return false;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment