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

Removed org.fortiss.tooling.base.dnd.ConnectionDragContext.isValidSource().

refs 2653
parent f9a3d9c3
......@@ -57,7 +57,7 @@ public class AllocationDirectConnectionAndReconnectionEditPolicy extends
context.getSourcePosition(), context.getTarget(),
context.getTargetParent(), context.getTargetPosition(),
context.isSourceFreeConnector(), context.isTargetFreeConnector(),
context.isValidSource(), context.isTargetRoot(), allocationRoot);
context.isTargetRoot(), allocationRoot);
AllocationConnectCommand cmd = new AllocationConnectCommand(context);
request.setStartCommand(cmd);
......
......@@ -24,7 +24,6 @@ import org.eclipse.gef.RootEditPart;
import org.fortiss.tooling.base.dnd.ConnectionDragContext;
import org.fortiss.tooling.base.dnd.ConnectionDropContext;
import org.fortiss.tooling.base.ui.editpart.DiagramEditPartBase;
import org.fortiss.tooling.base.ui.editpart.ElementEditPartBase;
import org.fortiss.tooling.base.ui.editpart.FreeConnectorEditPartBase;
import org.fortiss.tooling.base.utils.LayoutModelElementFactory;
import org.fortiss.tooling.kernel.extension.data.IConnectionCompositionContext;
......@@ -67,8 +66,7 @@ public class DragAndDropBaseUtils {
ConnectionDragContext context =
new ConnectionDragContext((EObject)sourceModelObj, sourceParent,
sourceModelPoint, isConsideredAsRootEditPart(sourceEditPart),
sourceEditPart instanceof FreeConnectorEditPartBase,
sourceEditPart instanceof ElementEditPartBase);
sourceEditPart instanceof FreeConnectorEditPartBase);
org.fortiss.tooling.base.model.layout.Point targetModelPoint =
LayoutModelElementFactory.createPoint(sourcePosition.x, sourcePosition.y,
sourcePosition.toString() + "_targetPos");
......
......@@ -31,7 +31,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author igna
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 2A6272E51C04314F65C60044D767BCB4
* @ConQAT.Rating YELLOW Hash: 2C512064ECEA5676B7B1462E539044DF
*/
public abstract class HierarchicElementConnectorConnectionCompositorBase<HE extends IHierarchicElement, S extends IHierarchicElement, T extends IConnector>
extends ConnectionCompositorBase<HE, S, T> {
......@@ -47,7 +47,7 @@ public abstract class HierarchicElementConnectorConnectionCompositorBase<HE exte
public boolean canConnect(S source, T target, HE parent, IConnectionCompositionContext context) {
if(context instanceof ConnectionDragContext) {
ConnectionDragContext dc = (ConnectionDragContext)context;
if(dc.isTargetFreeConnector() && dc.isValidSource()) {
if(dc.isTargetFreeConnector()) {
return canConnectInternally(source, target);
}
}
......
......@@ -26,7 +26,7 @@ import org.fortiss.tooling.base.model.layout.Point;
* @author eder
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating GREEN Hash: 06294A86F29303DB9B39CE53F2BA3FA4
* @ConQAT.Rating YELLOW Hash: 6C1BB1BA2F975CEBDC97E8808DE69783
*/
public class AllocationConnectionDragContext extends ConnectionDragContext {
......@@ -36,10 +36,10 @@ public class AllocationConnectionDragContext extends ConnectionDragContext {
/** Constructor. */
public AllocationConnectionDragContext(EObject source, EObject sourceParent,
Point sourcePosition, EObject target, EObject targetParent, Point targetPosition,
boolean isSourceFreeConnector, boolean isTargetFreeConnector, boolean isValidSource,
boolean isTargetRoot, EObject allocationRoot) {
boolean isSourceFreeConnector, boolean isTargetFreeConnector, boolean isTargetRoot,
EObject allocationRoot) {
super(source, sourceParent, sourcePosition, target, targetParent, targetPosition, false,
isSourceFreeConnector, isTargetFreeConnector, isValidSource, isTargetRoot);
isSourceFreeConnector, isTargetFreeConnector, isTargetRoot);
this.allocationRoot = allocationRoot;
}
......
......@@ -39,7 +39,7 @@ import org.fortiss.tooling.kernel.extension.data.IConnectionCompositionContext;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: BEFB3AFB65C72E381108CA76C0B369CB
* @ConQAT.Rating YELLOW Hash: C798F0757AB84CE7090422DDB4A9DF35
*/
public class ConnectionDragContext implements IConnectionCompositionContext {
......@@ -73,9 +73,6 @@ public class ConnectionDragContext implements IConnectionCompositionContext {
/** Predicate whether the target of the connection is a free, unconnected {@link IConnector}. */
private boolean isTargetFreeConnector;
/** Indicator whether the intended connection is "valid". */
private boolean isValidSource;
/** Caches the zoom factor of the context. */
private double zoom;
......@@ -83,7 +80,7 @@ public class ConnectionDragContext implements IConnectionCompositionContext {
public ConnectionDragContext(EObject source, EObject sourceParent, Point sourcePosition,
EObject target, EObject targetParent, Point targetPosition,
boolean isSourceFreeConnector, boolean isSourceRoot, boolean isTargetFreeConnector,
boolean isValidSource, boolean isTargetRoot) {
boolean isTargetRoot) {
this.sourceElement = source;
this.sourceParent = sourceParent;
this.sourcePosition = sourcePosition;
......@@ -93,15 +90,14 @@ public class ConnectionDragContext implements IConnectionCompositionContext {
this.isSourceFreeConnector = isSourceFreeConnector;
this.isSourceRoot = isSourceRoot;
this.isTargetFreeConnector = isTargetFreeConnector;
this.isValidSource = isValidSource;
this.isTargetRoot = isTargetRoot;
}
/** Constructor. */
public ConnectionDragContext(EObject source, EObject parent, Point sourcePosition,
boolean isSourceRoot, boolean isSourceFreeConnector, boolean isValidSource) {
boolean isSourceRoot, boolean isSourceFreeConnector) {
this(source, parent, sourcePosition, null, null, null, isSourceFreeConnector, isSourceRoot,
false, isValidSource, false);
false, false);
}
/**
......@@ -171,13 +167,6 @@ public class ConnectionDragContext implements IConnectionCompositionContext {
return isTargetFreeConnector;
}
/** Indicates whether the intended connection is "valid". */
// TODO(2653): This method replicates the "old" behavior. Evaluate whether it is not advisable
// to make the validity checks on creation an eliminate this method.
public boolean isValidSource() {
return isValidSource;
}
/** Returns the corresponding source {@link ElementDropContext}. */
public ElementDropContext getSourceDropContext() {
return new ElementDropContext(getSource(), getSourcePosition(), isSourceRoot, zoom);
......
Supports Markdown
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