System.out.println("visit(RulePredicate obj, Object arg)");
final LinkedList<Term> terms = new LinkedList<Term>();
// FrameOperator
if(obj.getLabel().contains("[") && obj.getLabel().contains("]")){
final FrameOperator frameOperator = new FrameOperator();
frameOperator.setVisualRifEditor(this.visualRifEditor);
frameOperator.setConstantComboBoxEntries(this.comboBoxEntries);
// create Terms
switch((Integer) obj.termParams.get(0).accept(this.scout, arg)){
case Scout.RULEVARIABLE : if(((String)obj.termParams.get(0).accept(this, arg)).startsWith("ALIASVAR")){
// TODO: check!
}
final Term termVar1 = frameOperator.prepareToCreateVariableTerm((String)obj.termParams.get(0).accept(this, arg));
terms.add(termVar1);
break;
case Scout.CONSTANT: String[] constArray = new String[2];
constArray = (String[]) obj.termParams.get(0).accept(this, arg);
final Term termConst1 = frameOperator.prepareToCreateConstantTerm(constArray[0],constArray[1],this.comboBoxEntries);
terms.add(termConst1);
break;
case Scout.RULELIST:
final ListOperator listOperator = (ListOperator) obj.termParams.get(0).accept(this, arg);
final Term listTerm = frameOperator.prepareToCreateListTerm(listOperator, this.comboBoxEntries);
terms.add(listTerm);
break;
case Scout.RULEPREDICATE:
final UnitermOperator unitermOperator = (UnitermOperator) obj.termParams.get(0).accept(this, arg);
final Term unitermTerm = frameOperator.prepareToCreateUnitermTerm(unitermOperator, this.comboBoxEntries);
terms.add(unitermTerm);
break;
case Scout.EXTERNAL:
final UnitermOperator external = (UnitermOperator) obj.termParams.get(0).accept(this, arg);
final Term externalTerm = frameOperator.prepareToCreateUnitermTerm(external, this.comboBoxEntries);
terms.add(externalTerm);
break;
default:
System.err.println("VisualRifGenerator.visit(RulePredicate obj, Object arg)");//TODO
break;
}
switch((Integer) obj.termName.accept(this.scout, arg)){
case Scout.RULEVARIABLE :
final Term termNameVar = frameOperator.prepareToCreateVariableTerm((String)obj.termName.accept(this, arg));
terms.add(termNameVar);
break;
case Scout.CONSTANT:
String[] constArray = new String[2];
constArray = (String[]) obj.termName.accept(this, arg);
final Term termNameConst = frameOperator.prepareToCreateConstantTerm(constArray[0],constArray[1],this.comboBoxEntries);
terms.add(termNameConst);
break;
case Scout.RULELIST:
final ListOperator listOperator = (ListOperator) obj.termName.accept(this, arg);
final Term listTerm = frameOperator.prepareToCreateListTerm(listOperator, this.comboBoxEntries);
terms.add(listTerm);
break;
case Scout.RULEPREDICATE:
final UnitermOperator unitermOperator = (UnitermOperator) obj.termName.accept(this, arg);
final Term unitermTerm = frameOperator.prepareToCreateUnitermTerm(unitermOperator, this.comboBoxEntries);
terms.add(unitermTerm);
break;
case Scout.EXTERNAL:
final UnitermOperator external = (UnitermOperator) obj.termName.accept(this, arg);
final Term externalTerm = frameOperator.prepareToCreateUnitermTerm(external, this.comboBoxEntries);
terms.add(externalTerm);
break;
default:
System.err.println("VisualRifGenerator.visit(RulePredicate obj, Object arg)");//TODO
break;
}
switch((Integer) obj.termParams.get(1).accept(this.scout, arg)){
case Scout.RULEVARIABLE :
final Term termVar2 = frameOperator.prepareToCreateVariableTerm((String)obj.termParams.get(1).accept(this, arg));
terms.add(termVar2);
break;
case Scout.CONSTANT: String[] constArray = new String[2];
constArray = (String[]) obj.termParams.get(1).accept(this, arg);
final Term termConst2 = frameOperator.prepareToCreateConstantTerm(constArray[0],constArray[1],this.comboBoxEntries);
terms.add(termConst2);
break;
case Scout.RULELIST:
final ListOperator listOperator = (ListOperator) obj.termParams.get(1).accept(this, arg);
final Term listTerm = frameOperator.prepareToCreateListTerm(listOperator, this.comboBoxEntries);
terms.add(listTerm);
break;
case Scout.RULEPREDICATE:
final UnitermOperator unitermOperator = (UnitermOperator) obj.termParams.get(1).accept(this, arg);
final Term unitermTerm = frameOperator.prepareToCreateUnitermTerm(unitermOperator, this.comboBoxEntries);
terms.add(unitermTerm);
break;
case Scout.EXTERNAL:
final UnitermOperator external = (UnitermOperator) obj.termParams.get(1).accept(this, arg);
final Term externalTerm = frameOperator.prepareToCreateUnitermTerm(external, this.comboBoxEntries);
terms.add(externalTerm);
break;
default:
System.err.println("VisualRifGenerator.visit(RulePredicate obj, Object arg)");//TODO
break;
}
frameOperator.setTerms(terms);
if( (arg instanceof RuleGraph) &&((RuleGraph) arg).isRecursiveOperatorGraph() ){
System.out.println("!Ich wart hier");
final RuleGraph rg = ((RuleGraph) arg);
rg.getOperatorContainer().addOperator(frameOperator);
}