String flowTypeGUI = flowControllerChoice.getText();
if (null == flowTypeGUI || flowTypeGUI.equals(S_))
return;
String prevFlowTypeGUI;
FlowControllerDeclaration fcd = getFlowControllerDeclaration();
FlowConstraints modelFlow = getModelFlow();
if (null != fcd)
prevFlowTypeGUI = USER_DEFINED_FLOW;
else {
if (null == modelFlow)
prevFlowTypeGUI = "";
else {
String prevFlowType = modelFlow.getFlowConstraintsType();
if (CapabilityLanguageFlow.FLOW_CONSTRAINTS_TYPE.equals(prevFlowType))
prevFlowTypeGUI = CAPABILITY_LANGUAGE_FLOW;
else
prevFlowTypeGUI = FIXED_FLOW;
}
}
if (prevFlowTypeGUI.equals(flowTypeGUI))
return;
CapabilityLanguageFlow clf = null;
FixedFlow ff = null;
String[] nodes = new FlowNodes(modelFlow).getFlow();
if (flowTypeGUI.equals(CAPABILITY_LANGUAGE_FLOW)) {
setFlowControllerDeclaration(null);
getAnalysisEngineMetaData().setFlowConstraints(clf = new CapabilityLanguageFlow_impl());
clf.setCapabilityLanguageFlow(nodes);
} else if (flowTypeGUI.equals(FIXED_FLOW)) {
setFlowControllerDeclaration(null);
getAnalysisEngineMetaData().setFlowConstraints(ff = new FixedFlow_impl());
ff.setFixedFlow(nodes);
} else if (flowTypeGUI.equals(USER_DEFINED_FLOW)) {
// use case: user set user-defined-flow from some other state.
// user will have to fill in the import (CDE only supports that format)
// flow nodes kept, put under "Fixed Flow" arbitrarily
FlowControllerDeclaration newFcd = new FlowControllerDeclaration_impl();
setFlowControllerDeclaration(newFcd);
refreshFcd(newFcd);
getAnalysisEngineMetaData().setFlowConstraints(ff = new FixedFlow_impl());
ff.setFixedFlow(nodes);
}