Commit b82e27cd authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Components: JavaFX editor. Fixed channel creation.

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

Signed-off-by: Florian Hölzl's avatarFlorian Hoelzl <hoelzl@fortiss.org>
parent 1a5890b8
......@@ -2,5 +2,5 @@ ComponentStructureFXEditor.java 0d5e3c00d0021fbd469841706093cccde85d7d42 YELLOW
ComponentStructureFXEditorBinding.java 3f78a7b48cb7b9a0b0b35fab58a4ad7f3233c18a YELLOW
ControllerFactory.java 0adaa2e7ab2e3bc73bae21aec736842a5abeb9a1 YELLOW
FXComponentEditorUtils.java 6aa86b3c28b6a8a68844d251c961378d83df7710 YELLOW
ModelFactory.java 4ae8e202869cffac25fa8eea484c4ab9411f8948 YELLOW
ModelFactory.java 302b27b932b375c0dff4537d32188baba44d8be4 YELLOW
VisualFactory.java c3f9acf01cb627f07dca673631a4c8f632d2c4a9 YELLOW
......@@ -19,10 +19,12 @@ import static java.util.Collections.emptyList;
import static java.util.Objects.requireNonNull;
import java.util.List;
import java.util.stream.Collectors;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelFactory;
import org.fortiss.af3.component.model.Channel;
import org.fortiss.af3.component.model.Component;
import org.fortiss.tooling.base.model.element.IConnection;
/**
* The implementation of the {@link IModelFactory} for the component editor.
......@@ -68,7 +70,13 @@ final class ModelFactory implements IModelFactory {
/** {@inheritDoc} */
@Override
public List<?> getLinkModels() {
return rootElement.getConnections();
return rootElement.getConnections().stream()
.filter(c -> filterPartiallyInitializedConnections(c)).collect(Collectors.toList());
}
/** Checks whether the given connection is only partially initialized. */
private boolean filterPartiallyInitializedConnections(IConnection c) {
return c.getSource() != null && c.getTarget() != null && c.eContainer() != null;
}
/** {@inheritDoc} */
......
ChannelController.java 99c2b3b99b4fe37642605a33a3f6fd7c12a2f6bf RED
DiagramComponentPortController.java 98f2b9c069c48d98fbf3a51fd086a3f5cffce911 YELLOW
DiagramComponentPortController.java c99d075a9bc6b9c4214dee19aa5fd634ca5be379 YELLOW
DiagramController.java 74e96ce04d715a8084eb5d20b74567bc0168910d YELLOW
SubComponentController.java 562b0913d8ed8a2ea8fbd5e3e77ca367d1d8d9d8 YELLOW
SubComponentPortController.java ce6b20088baeb1ddd5c98111316f707f71cd133e YELLOW
......@@ -15,9 +15,6 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.editor.fx.controller;
import static org.fortiss.tooling.base.utils.LayoutDataUtils.moveNode;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.FeedbackChange;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.IController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.fortiss.af3.component.model.Port;
......@@ -40,19 +37,4 @@ public final class DiagramComponentPortController
"Expected model of type Port, but was " + model.getClass().getSimpleName());
}
}
/** Returns the port. */
private Port getPort() {
// wild cast works: see constructor
return (Port)getModel();
}
/** {@inheritDoc} */
@Override
public void move(FeedbackChange deltaChange) {
Port p = getPort();
int dx = (int)deltaChange.getDeltaX();
int dy = (int)deltaChange.getDeltaY();
moveNode(p, dx, dy);
}
}
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