@Override
public void onQuickCalculatorDirectSet(QuickCalculatorDirectSetEvent event) {
unbindDynamic();
CalculationDto calculation = event.getCalculation();
CalculationExpression calculationExpression = event.getCalculationExpression();
display.getExistingTypeIdToCalculationPriceSetItemMap().clear();
display.getTypeIdToEditableCalculationPriceSetItemMap().clear();
display.setNewCalculation(calculation);
List<String> pathNodeStringsWithBlueprint = display.addCalculationTreeNodes(event.getPathNodesToCalculationMap());
for (String pathNodesString : pathNodeStringsWithBlueprint) {
EditableCalculationItem editableCalculationItem = display.getPathNodesStringToEditableCalculationItemMap().get(pathNodesString);
ComputableCalculationItem computableCalculationItem = display.getPathNodesStringToComputableCalculationItemMap().get(pathNodesString);
bindUseBlueprintImage(computableCalculationItem.getCalculationTreeNodeSummary(), editableCalculationItem.getBlueprintImage());
bindApplyButton(editableCalculationItem, computableCalculationItem);
}
for (Map.Entry<String, EditableCalculationItem> mapEntry : display.getPathNodesStringToEditableCalculationItemMap().entrySet()) {
EditableCalculationItem editableCalculationItem = mapEntry.getValue();
OpaqueLoadableBlueprintImage blueprintImage = editableCalculationItem.getBlueprintImage();
if (blueprintImage != null && display.getPathNodesStringToUsedCalculationMap().containsKey(mapEntry.getKey())) {
blueprintImage.removeOpacity();
}
}
display.changeMePeQuantity(calculation.getMaterialLevel(), calculation.getProductivityLevel(), calculationExpression.getQuantity());
Map<Long, String> priceSetItemTypeIdToPriceMap = calculationExpression.getPriceSetItemTypeIdToPriceMap();
for (Map.Entry<Long, EditableCalculationPriceSetItem> entry : display.getTypeIdToEditableCalculationPriceSetItemMap().entrySet()) {
Long typeID = entry.getKey();
EditableCalculationPriceSetItem calculationPriceSetItem = entry.getValue();
String price = priceSetItemTypeIdToPriceMap.get(typeID);
if (price != null) {