import org.simantics.structural2.modelingRules.ConnectionJudgement;
import org.simantics.structural2.modelingRules.IConnectionPoint;
import org.simantics.structural2.modelingRules.IModelingRules;
-import org.simantics.utils.datastructures.Callback;
import org.simantics.utils.datastructures.Pair;
import org.simantics.utils.ui.ErrorLogger;
}
}
}
- }, new Callback<DatabaseException>() {
- @Override
- public void run(DatabaseException e) {
- if (e != null)
- ErrorLogger.defaultLogError(e);
- }
+ }, e -> {
+ if (e != null)
+ ErrorLogger.defaultLogError(e);
});
}
}
Connector endConnector = null;
if (endTerminal != null) {
- endConnector = createConnectorForNode(graph, attachToConnection, endTerminal, EdgeEnd.End, judgment);
+ endConnector = createConnectorForNode(graph, attachToConnection, endTerminal, flagType == FlagClass.Type.In ? EdgeEnd.Begin : EdgeEnd.End, judgment);
} else if (createFlags) {
EdgeEnd end = flagType == FlagClass.Type.In ? EdgeEnd.Begin : EdgeEnd.End;
IElement endFlag = createFlag(graph, attachToConnection, end, controlPoints.getLast(), flagType, null);
EdgeEnd end, ConnectionJudgement judgment) throws DatabaseException {
IConnectionPoint cp = ConnectionUtil.toConnectionPoint(graph, element, terminal);
CPTerminal cpt = (cp instanceof CPTerminal) ? (CPTerminal) cp : null;
- Resource attachment = judgment.attachmentRelations.get(graph, cpt);
+ Resource attachment = null;
+ if (judgment.attachmentRelations != null)
+ attachment = judgment.attachmentRelations.get(graph, cpt);
if (attachment == null)
attachment = cu.toHasConnectorRelation(end);
Resource connector = cu.getOrCreateConnector(connection, element, terminal, end, attachment);