Commit 659e45e7 authored by Simon Barner's avatar Simon Barner
Browse files

Avoid unneeded explicity controller classes

* Use LayoutedRectangularResizableContentController directly
* TBD: Change default implementation of
       <sf>.lwfxef.controller.base.ControllerBase::allowLink()

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

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent 1158780f
ComponentControllerFactory.java debf3bb80cb56197d4dd0c84f38e466f99da9a34 GREEN
ComponentControllerFactory.java 4995e5cc92b2ce5c3d178f7c047e76bf05844c44 YELLOW
ComponentModelFactory.java 7e58831949f50a9887bcbf31959f887a87f703cb GREEN
ComponentStructureFXEditor.java d662863a84c9e3f24e46de19dad1d750a1462cd3 GREEN
ComponentStructureFXEditorBinding.java 370fe5c458f15bd8299364f858250d5c2bda6729 GREEN
......
......@@ -29,6 +29,7 @@ import org.fortiss.tooling.base.ui.editor.fx.controller.EObjectDiagramController
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedContentAnchorageController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedDiagramAnchorageController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedLinkBendPointController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedRectangularResizableContentController;
/**
* The implementation of the {@link IControllerFactory} for the component editor.
......@@ -40,7 +41,7 @@ public final class ComponentControllerFactory implements IControllerFactory {
/** {@inheritDoc} */
@Override
public IController createContentController(IContentMVCBundle model) {
return new SubComponentController(model);
return new LayoutedRectangularResizableContentController<Component>(model, Component.class);
}
/** {@inheritDoc} */
......
/*-------------------------------------------------------------------------+
| Copyright 2019 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.component.ui.editor.fx;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.IController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.Port;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedRectangularResizableContentController;
import javafx.geometry.Side;
/**
* {@link IController} for sub-components of the component displayed in the diagram.
*
* @author hoelzl
* @author diewald
*/
public final class SubComponentController
extends LayoutedRectangularResizableContentController<Component> {
/** Constructor. */
public SubComponentController(IContentMVCBundle mvcb) {
super(mvcb, Component.class);
}
/** {@inheritDoc} */
@Override
protected void moveAnchorageToSideOffset(IContentAnchorageMVCBundle anchorage, Side side,
double offset) {
Object portObj = anchorage.getModel();
if(portObj instanceof Port) {
super.moveAnchorageToSideOffset(anchorage, side, offset);
}
}
}
TaskController.java 77833bf43e637b45c8d03d709eb879c61c757312 GREEN
TaskControllerFactory.java 00570ab13930645cd1d055a851217c41e2ecaab2 GREEN
TaskController.java ec122418a1aed437d27fcb8151f4998d62439df0 YELLOW
TaskControllerFactory.java 2e3bdf2735238749dcfcb46a426b3269898a4ff2 YELLOW
TaskModelFactory.java 1bdcf252a807991911c2178df8713499a6fa55bd GREEN
TaskStructureFXEditor.java cbae52e6d2f9997c83d173e802561dc7e68b8722 GREEN
TaskStructureFXEditorBinding.java b8a0623846892a80fb65dc4c3f1cf6ae29d87884 GREEN
......
/*-------------------------------------------------------------------------+
| Copyright 2019 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.task.ui.editor.fx;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.IController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskPort;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedRectangularResizableContentController;
import javafx.geometry.Side;
/**
* {@link IController} for {@link Task}s displayed in the diagram.
*
* @author munaro
*/
public class TaskController extends LayoutedRectangularResizableContentController<Task> {
/** Constructor. */
public TaskController(IContentMVCBundle mvcb) {
super(mvcb, Task.class);
}
/** {@inheritDoc} */
@Override
protected boolean allowLink() {
return false;
}
/** {@inheritDoc} */
@Override
protected void moveAnchorageToSideOffset(IContentAnchorageMVCBundle anchorage, Side side,
double offset) {
Object portObj = anchorage.getModel();
if(portObj instanceof TaskPort) {
super.moveAnchorageToSideOffset(anchorage, side, offset);
}
}
}
......@@ -23,11 +23,13 @@ import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IDiagramAnchor
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IDiagramMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.af3.task.model.Signal;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskArchitecture;
import org.fortiss.af3.task.model.TaskPort;
import org.fortiss.tooling.base.ui.editor.fx.controller.EObjectDiagramController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedContentAnchorageController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedLinkBendPointController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedRectangularResizableContentController;
/**
* The implementation of the {@link IControllerFactory} for the task structure editor.
......@@ -39,7 +41,7 @@ public class TaskControllerFactory implements IControllerFactory {
/** {@inheritDoc} */
@Override
public IController createContentController(IContentMVCBundle model) {
return new TaskController(model);
return new LayoutedRectangularResizableContentController<Task>(model, Task.class);
}
/** {@inheritDoc} */
......
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