use of com.talosvfx.talos.runtime.Expression in project talos by rockbite.
the class MathModuleWrapper method configureSlots.
@Override
protected void configureSlots() {
Array<String> mathsExpressions = new Array<>();
MathExpressionMappings.getAvailableMathExpressions(mathsExpressions);
selectBox = new VisSelectBox();
selectBox.setItems(mathsExpressions);
aField = addInputSlotWithTextField("A: ", MathModule.A);
leftWrapper.add(selectBox).left().expandX().pad(5).padLeft(17).row();
bField = addInputSlotWithTextField("B: ", MathModule.B);
aField.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
float a = floatFromText(aField);
module.setA(a);
}
});
bField.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
float b = floatFromText(bField);
module.setB(b);
}
});
addOutputSlot("result", 0);
selectBox.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
String selectedString = selectBox.getSelected();
Expression expression = MathExpressionMappings.getMathExpressionForName(selectedString);
module.setExpression(expression);
}
});
}
Aggregations