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

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


        computableCalculation.setWasteLabel(wasteLabel);
        computableCalculation.setTotalPriceLabel(totalPriceLabel);
    }

    private void drawRootCalculationItem(CalculationTreeNode calculationTreeNode) {
        CalculationTreeNodeSummary calculationTreeNodeSummary = calculationTreeNode.getSummary();
        String pathNodesString = calculationTreeNodeSummary.getPathNodesString();
        EditableCalculationItem editableCalculationItem = new EditableCalculationItem();
        pathNodesStringToEditableCalculationItemMap.put(pathNodesString, editableCalculationItem);
        ComputableCalculationItem computableCalculationItem = new ComputableCalculationItem();
        computableCalculationItem.setCalculationItems(calculationTreeNode.getCalculationItems());
        computableCalculationItem.setCalculationTreeNodeSummary(calculationTreeNodeSummary);
        pathNodesStringToComputableCalculationItemMap.put(pathNodesString, computableCalculationItem);

        final int index = rootCalculationItemTable.getRowCount();
        String imageUrl = imageUrlProvider.getImage32Url(calculationTreeNodeSummary.getItemCategoryID(), calculationTreeNodeSummary.getItemTypeID(), calculationTreeNodeSummary.getItemTypeIcon());
        Image image = new Image(imageUrl);
        image.setTitle(calculationTreeNodeSummary.getItemTypeName());
        image.addStyleName(resources.css().image32());
        EveItemInfoLink imageItemInfoLink = new EveItemInfoLink(ccpJsMessages, image, calculationTreeNodeSummary.getItemTypeID());
        rootCalculationItemTable.setWidget(index, 0, imageItemInfoLink);
        rootCalculationItemTable.setWidget(index, 1, new EveItemMarketDetailsLink(constants, urlMessages, ccpJsMessages, calculationTreeNodeSummary.getItemTypeName(), calculationTreeNodeSummary.getItemTypeID()));
        rootCalculationItemTable.setWidget(index, 2, new Label("x"));
        QuantityLabel quantityForParentLabel = new QuantityLabel(calculationTreeNodeSummary.getParentQuantity() * calculationTreeNodeSummary.getQuantity());
        HorizontalPanel quantityAndDamagePerJobPanel = new HorizontalPanel();
        quantityAndDamagePerJobPanel.add(quantityForParentLabel);
        BigDecimal damagePerJob = calculationTreeNodeSummary.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);
        }
        rootCalculationItemTable.setWidget(index, 3, quantityAndDamagePerJobPanel);
        rootCalculationItemTable.setWidget(index, 4, new Label("x"));
        PriceLabel priceLabel = new PriceLabel(calculationTreeNodeSummary.getPrice());
        rootCalculationItemTable.setWidget(index, 5, priceLabel);
        rootCalculationItemTable.setWidget(index, 6, new Label("="));
        PriceLabel totalPriceForParentLabel = new PriceLabel(calculationTreeNodeSummary.getTotalPriceForParent());
        rootCalculationItemTable.setWidget(index, 7, totalPriceForParentLabel);

        if (hasBlueprint(calculationTreeNodeSummary.getItemCategoryID(), calculationTreeNodeSummary.getItemTypeID())) {
            OpaqueLoadableBlueprintImage blueprintImage = new OpaqueLoadableBlueprintImage(resources, messages, messages.useBlueprint(), messages.stopUsingBlueprint());
            blueprintImage.addStyleName(resources.css().image16());
            blueprintImage.addStyleName(resources.css().cursorHand());
            blueprintImage.setOpacity();
            rootCalculationItemTable.setWidget(index, 8, blueprintImage);
View Full Code Here


        computableCalculationItem.setPriceLabel(priceLabel);
        computableCalculationItem.setTotalPriceForParentLabel(totalPriceForParentLabel);
    }

    private void drawCalculationItem(FlexTable calculationItemTable, CalculationTreeNode calculationTreeNode) {
        CalculationTreeNodeSummary calculationTreeNodeSummary = calculationTreeNode.getSummary();
        String pathNodesString = calculationTreeNodeSummary.getPathNodesString();
        EditableCalculationItem editableCalculationItem = new EditableCalculationItem();
        pathNodesStringToEditableCalculationItemMap.put(pathNodesString, editableCalculationItem);
        ComputableCalculationItem computableCalculationItem = new ComputableCalculationItem();
        computableCalculationItem.setCalculationItems(calculationTreeNode.getCalculationItems());
        computableCalculationItem.setCalculationTreeNodeSummary(calculationTreeNodeSummary);
        pathNodesStringToComputableCalculationItemMap.put(pathNodesString, computableCalculationItem);

        final int index = calculationItemTable.getRowCount();
        String imageUrl = imageUrlProvider.getImage16Url(calculationTreeNodeSummary.getItemCategoryID(), calculationTreeNodeSummary.getItemTypeID(), calculationTreeNodeSummary.getItemTypeIcon());
        Image image = new Image(imageUrl);
        image.setTitle(calculationTreeNodeSummary.getItemTypeName());
        image.addStyleName(resources.css().image16());
        EveItemInfoLink imageItemInfoLink = new EveItemInfoLink(ccpJsMessages, image, calculationTreeNodeSummary.getItemTypeID());
        calculationItemTable.setWidget(index, 0, imageItemInfoLink);
        calculationItemTable.setWidget(index, 1, new EveItemMarketDetailsLink(constants, urlMessages, ccpJsMessages, calculationTreeNodeSummary.getItemTypeName(), calculationTreeNodeSummary.getItemTypeID()));
        calculationItemTable.setWidget(index, 2, new Label("x"));
        QuantityLabel quantityLabel = new QuantityLabel(calculationTreeNodeSummary.getQuantity());
        HorizontalPanel quantityAndDamagePerJobPanel = new HorizontalPanel();
        quantityAndDamagePerJobPanel.add(quantityLabel);
        BigDecimal damagePerJob = calculationTreeNodeSummary.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);
        }
        calculationItemTable.setWidget(index, 3, quantityAndDamagePerJobPanel);
        calculationItemTable.setWidget(index, 4, new Label("x"));
        PriceLabel priceLabel = new PriceLabel(calculationTreeNodeSummary.getPrice());
        calculationItemTable.setWidget(index, 5, priceLabel);
        calculationItemTable.setWidget(index, 6, new Label("="));
        PriceLabel totalPriceLabel = new PriceLabel(calculationTreeNodeSummary.getTotalPrice());
        calculationItemTable.setWidget(index, 7, totalPriceLabel);
        calculationItemTable.setWidget(index, 8, new Label("x"));
        QuantityLabel parentQuantityLabel = new QuantityLabel(calculationTreeNodeSummary.getParentQuantity());
        calculationItemTable.setWidget(index, 9, parentQuantityLabel);
        calculationItemTable.setWidget(index, 10, new Label("="));
        PriceLabel totalPriceForParentLabel = new PriceLabel(calculationTreeNodeSummary.getTotalPriceForParent());
        calculationItemTable.setWidget(index, 11, totalPriceForParentLabel);


        if (hasBlueprint(calculationTreeNodeSummary.getItemCategoryID(), calculationTreeNodeSummary.getItemTypeID())) {
            OpaqueLoadableBlueprintImage blueprintImage = new OpaqueLoadableBlueprintImage(resources, messages, messages.useBlueprint(), messages.stopUsingBlueprint());
            blueprintImage.addStyleName(resources.css().image16());
            blueprintImage.addStyleName(resources.css().cursorHand());
            blueprintImage.setOpacity();
            calculationItemTable.setWidget(index, 12, blueprintImage);
View Full Code Here

TOP

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

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.