Commit 564884b0 authored by Johannes Eder's avatar Johannes Eder
Browse files

YELLOW

* removed auto layout for automatos

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

Signed-off-by: Johannes Eder's avatarJohannes Eder <eder@fortiss.org>
parent 44949afd
ModeAutomatonControllerFactory.java aa768159a389d90522b275e4481fb2db78669a25 GREEN
ModeAutomatonControllerFactory.java 96edc6e4d6dd66b1ccaa0d24b2e542a2281be639 YELLOW
ModeAutomatonFXEditor.java 0e772da01045f7dc39c1005735c47e51d8b92a5b GREEN
ModeAutomatonFXEditorBinding.java d3503a20fc9fccc6a8805674bdabaa2135fd28c2 GREEN
ModeAutomatonModelFactory.java 90826e0ff88b73784e41cc71f473c11daa6bc36d GREEN
......
......@@ -19,9 +19,9 @@ import org.fortiss.af3.mode.model.Mode;
import org.fortiss.af3.mode.model.ModeAutomaton;
import org.fortiss.af3.mode.model.SwitchSegment;
import org.fortiss.af3.mode.model.SwitchSegmentConnector;
import org.fortiss.af3.state.ui.editor.fx.AutomatonFXController;
import org.fortiss.tooling.base.ui.editor.fx.controller.CurvedLinkLayoutedContentAnchorangeController;
import org.fortiss.tooling.base.ui.editor.fx.controller.CurvedLinkLayoutedDiagramAnchorangeController;
import org.fortiss.tooling.base.ui.editor.fx.controller.EObjectDiagramController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedCurveLinkBendPointController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedEllipticResizableContentController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IController;
......@@ -67,6 +67,6 @@ public class ModeAutomatonControllerFactory implements IControllerFactory {
/** {@inheritDoc} */
@Override
public IController createDiagramController(IDiagramMVCBundle diagramBundle) {
return new EObjectDiagramController<>(diagramBundle, Mode.class);
return new AutomatonFXController<>(diagramBundle, Mode.class);
}
}
......@@ -14,6 +14,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Vendor: fortiss GmbH
Export-Package: org.fortiss.af3.state.ui,
org.fortiss.af3.state.ui.editor,
org.fortiss.af3.state.ui.editor.fx,
org.fortiss.af3.state.ui.editpart,
org.fortiss.af3.state.ui.editpart.figure,
org.fortiss.af3.state.ui.examples,
......
AutomatonFXController.java a5696259be316d1d02f4bc46043c33d0330e880d YELLOW
DataStateFXEditor.java e64fcec84ea83e5ba99e48a6825063471e9ea70d GREEN
DataStateFXEditorBase.java 83655742fdcfdade31eabd7deafa88862f28ba22 GREEN
DataStateFXEditorBinding.java 46ab36b197a6fca102a5e2d75aa24b1fbba26b89 GREEN
DataStateFXEditorContentProvider.java 324cd24e2219ba2cf360b0f82e3628ca1b5dabba GREEN
DataStateFXEditorUIProvider.java 89217cdc9804f38b9eaf24a76f241bafcf8eba62 GREEN
StateAutomatonControllerFactory.java 67f7f7bbc318018080a4569d84e0f1830ce33bda GREEN
StateAutomatonControllerFactory.java 7bbb7f6e63c0ff094001ac6b4fdb1e43ce5d3ff6 YELLOW
StateAutomatonFXEditor.java eea88e496c873ec92f6b2a0735cbd3d542a3063f GREEN
StateAutomatonFXEditorBase.java 901e1ce52a2a53fb73c160b0af7fd7fbfc1e3044 GREEN
StateAutomatonFXEditorBinding.java 5fae7a8e04236c07d176a2b1ed22f7043e3a09fe GREEN
......
/*-------------------------------------------------------------------------+
| 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.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.
*
* @author eder
*/
public class AutomatonFXController<T extends EObject> extends EObjectDiagramController<T> {
/** Constructor. */
public AutomatonFXController(IMVCBundle mvcb, Class<T> modelType) {
super(mvcb, modelType);
}
/**
* {@inheritDoc}
* Does not include auto-layout feature. Despite, same implementation as in super class.
*/
@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;
}
}
......@@ -21,7 +21,6 @@ import org.fortiss.af3.state.model.TransitionSegment;
import org.fortiss.af3.state.model.TransitionSegmentConnector;
import org.fortiss.tooling.base.ui.editor.fx.controller.CurvedLinkLayoutedContentAnchorangeController;
import org.fortiss.tooling.base.ui.editor.fx.controller.CurvedLinkLayoutedDiagramAnchorangeController;
import org.fortiss.tooling.base.ui.editor.fx.controller.EObjectDiagramController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedCurveLinkBendPointController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedEllipticResizableContentController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IController;
......@@ -67,6 +66,6 @@ public class StateAutomatonControllerFactory implements IControllerFactory {
/** {@inheritDoc} */
@Override
public IController createDiagramController(IDiagramMVCBundle diagramBundle) {
return new EObjectDiagramController<>(diagramBundle, State.class);
return new AutomatonFXController<>(diagramBundle, State.class);
}
}
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