Package lv.odylab.evemanage.client.presenter.tab.calculator

Examples of lv.odylab.evemanage.client.presenter.tab.calculator.ComputableCalculationPriceSetItem


    public void updatePrices() {
        Map<Long, BigDecimal> typeIdToPriceMap = new HashMap<Long, BigDecimal>();
        for (Map.Entry<Long, EditableCalculationPriceSetItem> mapEntry : typeIdToEditableCalculationPriceSetItemMap.entrySet()) {
            Long typeID = mapEntry.getKey();
            BigDecimal price = mapEntry.getValue().getPriceTextBox().getPrice();
            ComputableCalculationPriceSetItem computableCalculationPriceSetItem = typeIdToComputableCalculationPriceSetItemMap.get(typeID);
            computableCalculationPriceSetItem.getCalculationPriceSetItem().setPrice(price);
            typeIdToPriceMap.put(typeID, price);
        }
        calculationTree.setPrices(typeIdToPriceMap);
        recalculate();
    }
View Full Code Here


            ComputableCalculationItem computableCalculationItem = mapEntry.getValue();
            computableCalculationItem.recalculate();
        }
        for (Map.Entry<Long, CalculationPriceSetItemDto> mapEntry : pricingProcessorResult.getTypeIdToCalculationPriceSetItemMap().entrySet()) {
            CalculationPriceSetItemDto calculationPriceSetItemDto = mapEntry.getValue();
            ComputableCalculationPriceSetItem computableCalculationPriceSetItem = typeIdToComputableCalculationPriceSetItemMap.get(mapEntry.getKey());
            computableCalculationPriceSetItem.setCalculationPriceSetItem(calculationPriceSetItemDto);
            computableCalculationPriceSetItem.recalculate();
        }
        computableCalculation.getCalculation().setPrice(pricingProcessorResult.getTotalPrice());
        computableCalculation.recalculate(calculator);
        return pricingProcessorResult;
    }
View Full Code Here

    private void drawCalculationPriceSetItem(CalculationPriceSetItemDto calculationPriceSetItem) {
        EditableCalculationPriceSetItem editableCalculationPriceSetItem = new EditableCalculationPriceSetItem();
        Long typeID = calculationPriceSetItem.getItemTypeID();
        typeIdToEditableCalculationPriceSetItemMap.put(typeID, editableCalculationPriceSetItem);
        ComputableCalculationPriceSetItem computableCalculationPriceSetItem = new ComputableCalculationPriceSetItem();
        computableCalculationPriceSetItem.setCalculationPriceSetItem(calculationPriceSetItem);
        typeIdToComputableCalculationPriceSetItemMap.put(typeID, computableCalculationPriceSetItem);

        int index = priceSetItemTable.getRowCount();
        String imageUrl = imageUrlProvider.getImage32Url(calculationPriceSetItem.getItemCategoryID(), typeID, calculationPriceSetItem.getItemTypeIcon());
        Image image = new Image(imageUrl);
        image.setTitle(calculationPriceSetItem.getItemTypeName());
        image.addStyleName(resources.css().image32());
        EveItemInfoLink imageItemInfoLink = new EveItemInfoLink(ccpJsMessages, image, typeID);
        priceSetItemTable.setWidget(index, 0, imageItemInfoLink);
        priceSetItemTable.setWidget(index, 1, new EveItemMarketDetailsLink(constants, urlMessages, ccpJsMessages, calculationPriceSetItem.getItemTypeName(), typeID));
        PriceTextBox priceTextBox = new PriceTextBox();
        priceTextBox.setPrice(calculationPriceSetItem.getPrice());
        priceTextBox.addStyleName(resources.css().priceInput());
        priceSetItemTable.setWidget(index, 2, priceTextBox);
        Image eveCentralImage = new Image(resources.eveCentralIcon16());
        eveCentralImage.setTitle(messages.eveCentralQuicklook());
        priceSetItemTable.setWidget(index, 3, new EveCentralQuicklookLink(constants, urlMessages, eveCentralImage, typeID));
        Image eveMetricsImage = new Image(resources.eveMetricsIcon16());
        eveMetricsImage.setTitle(messages.eveMetricsItemPrice());
        priceSetItemTable.setWidget(index, 4, new EveMetricsItemPriceLink(constants, urlMessages, eveMetricsImage, calculationPriceSetItem.getItemCategoryID(), typeID));
        priceSetItemTable.setWidget(index, 5, new Label("x"));
        QuantityLabel quantityLabel = new QuantityLabel(calculationPriceSetItem.getQuantity());
        HorizontalPanel quantityAndDamagePerJobPanel = new HorizontalPanel();
        quantityAndDamagePerJobPanel.add(quantityLabel);
        BigDecimal damagePerJob = calculationPriceSetItem.getDamagePerJob();
        if (BigDecimal.ONE.compareTo(damagePerJob) == 1) {
            DamagePerJobLabel damagePerJobLabel = new DamagePerJobLabel(damagePerJob);
            damagePerJobLabel.addStyleName(resources.css().damagePerJob());
            quantityAndDamagePerJobPanel.add(damagePerJobLabel);
            quantityAndDamagePerJobPanel.setCellVerticalAlignment(damagePerJobLabel, HasVerticalAlignment.ALIGN_BOTTOM);
        }
        priceSetItemTable.setWidget(index, 6, quantityAndDamagePerJobPanel);
        priceSetItemTable.setWidget(index, 7, new Label("="));
        PriceLabel totalPriceLabel = new PriceLabel(calculationPriceSetItem.getTotalPrice());
        priceSetItemTable.setWidget(index, 8, totalPriceLabel);

        editableCalculationPriceSetItem.setPriceTextBox(priceTextBox);
        computableCalculationPriceSetItem.setQuantityLabel(quantityLabel);
        computableCalculationPriceSetItem.setTotalPriceLabel(totalPriceLabel);
    }
View Full Code Here

        computableCalculationPriceSetItem.setTotalPriceLabel(totalPriceLabel);
    }

    private Map<Long, CalculationPriceSetItemDto> createExistingTypeIdToCalculationPriceSetItemMap() {
        for (Map.Entry<Long, EditableCalculationPriceSetItem> mapEntry : typeIdToEditableCalculationPriceSetItemMap.entrySet()) {
            ComputableCalculationPriceSetItem computableCalculationPriceSetItem = typeIdToComputableCalculationPriceSetItemMap.get(mapEntry.getKey());
            computableCalculationPriceSetItem.getCalculationPriceSetItem();
            existingTypeIdToCalculationPriceSetItemMap.put(mapEntry.getKey(), computableCalculationPriceSetItem.getCalculationPriceSetItem());
        }
        return existingTypeIdToCalculationPriceSetItemMap;
    }
View Full Code Here

TOP

Related Classes of lv.odylab.evemanage.client.presenter.tab.calculator.ComputableCalculationPriceSetItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.