Skip to content
Snippets Groups Projects
Commit 5fd1d5b0 authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Now impossible to connect countermeasure to itself in FTD

parent ee2b0be9
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -40,6 +40,7 @@ package ui.ftd;
import ui.CDElement;
import ui.TGComponentManager;
import ui.TGConnectingPoint;
import ui.TGConnectingPointWidthHeight;
/**
......@@ -59,4 +60,18 @@ public class FTDCountermeasureConnectingPoint extends TGConnectingPointWidthHei
public boolean isCompatibleWith(int type) {
return type == TGComponentManager.FTD_COUNTERMEASURE_CONNECTOR;
}
public boolean isCompatibleWith(int type, TGConnectingPoint outPoint) {
if (outPoint != null) {
if ((outPoint.getFather() instanceof FTDCountermeasure) && (getFather() instanceof FTDCountermeasure)) {
return false;
}
if ((outPoint.getFather() instanceof FTDFault) && (getFather() instanceof FTDFault)) {
return false;
}
}
return isCompatibleWith(type);
}
}
......@@ -87,27 +87,5 @@ public class FTDCountermeasureConnector extends TGConnectorWithCommentConnectio
public int getType() {
return TGComponentManager.FTD_COUNTERMEASURE_CONNECTOR;
}
// Issue #31: Moved to upper class
// public void rescale(double scaleFactor){
// //
// int xx, yy;
//
// for(int i=0; i<nbInternalTGComponent; i++) {
// xx = tgcomponent[i].getX();
// yy = tgcomponent[i].getY();
// //
// tgcomponent[i].dx = (tgcomponent[i].dx + xx) / oldScaleFactor * scaleFactor;
// tgcomponent[i].dy = (tgcomponent[i].dy + yy) / oldScaleFactor * scaleFactor;
// xx = (int)(tgcomponent[i].dx);
// tgcomponent[i].dx = tgcomponent[i].dx - xx;
// yy = (int)(tgcomponent[i].dy);
// tgcomponent[i].dy = tgcomponent[i].dy - yy;
//
// tgcomponent[i].setCd(xx, yy);
//
// //
// }
//
// oldScaleFactor = scaleFactor;
// }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment