Examples of MaterialDTO


Examples of lv.odylab.evemanage.client.rpc.dto.blueprint.MaterialDto

        List<RequirementDto> copyingRequirements = details.getCopyingRequirements();
        List<RequirementDto> inventionRequirements = details.getInventionRequirements();
        Map<MaterialDto, QuantityLabel> materialToWidgetMap = new HashMap<MaterialDto, QuantityLabel>();
        Map<RequirementDto, QuantityLabel> requirementToWidgetMap = new HashMap<RequirementDto, QuantityLabel>();
        for (int i = 0; i < materials.size(); i++) {
            MaterialDto material = materials.get(i);
            String imageUrl = imageUrlProvider.getImage16Url(material.getMaterialTypeCategoryID(), material.getMaterialTypeID(), material.getMaterialTypeGraphicIcon());
            Image image = new Image(imageUrl);
            image.setTitle(material.getMaterialTypeName());
            image.addStyleName(resources.css().image16());
            EveItemInfoLink imageItemInfoLink = new EveItemInfoLink(ccpJsMessages, image, material.getMaterialTypeID());
            materialsTable.setWidget(i, 0, imageItemInfoLink);
            materialsTable.setWidget(i, 1, new EveItemMarketDetailsLink(constants, urlMessages, ccpJsMessages, material.getMaterialTypeName(), material.getMaterialTypeID()));
            materialsTable.setWidget(i, 2, new Label("x"));
            QuantityLabel quantityLabel = new QuantityLabel();
            materialsTable.setWidget(i, 3, quantityLabel);
            materialToWidgetMap.put(material, quantityLabel);
        }
View Full Code Here

Examples of lv.odylab.evemanage.client.rpc.dto.blueprint.MaterialDto

        this.sharingLevelLabel = sharingLevelLabel;
    }

    public void recalculate(BlueprintDto blueprint, EveCalculator calculator) {
        for (Map.Entry<MaterialDto, QuantityLabel> mapEntry : materialToWidgetMap.entrySet()) {
            MaterialDto material = mapEntry.getKey();
            QuantityLabel quantityLabel = mapEntry.getValue();
            quantityLabel.setQuantity(calculator.calculateMaterialAmount(material.getQuantity(), blueprint.getMaterialLevel(), blueprintDetails.getWasteFactor()));
        }
        for (Map.Entry<RequirementDto, QuantityLabel> mapEntry : requirementToWidgetMap.entrySet()) {
            RequirementDto requirement = mapEntry.getKey();
            QuantityLabel quantityLabel = mapEntry.getValue();
            quantityLabel.setQuantity(requirement.getQuantity());
View Full Code Here

Examples of lv.odylab.evemanage.client.rpc.dto.blueprint.MaterialDto

        return blueprintDto;
    }

    @Override
    public MaterialDto map(TypeMaterialDto typeMaterial, Class<MaterialDto> blueprintMaterialDtoClass) {
        MaterialDto materialDto = new MaterialDto();
        materialDto.setMaterialTypeID(typeMaterial.getMaterialTypeID());
        materialDto.setMaterialTypeName(typeMaterial.getMaterialTypeName());
        materialDto.setMaterialTypeCategoryID(typeMaterial.getMaterialTypeCategoryID());
        materialDto.setQuantity(typeMaterial.getQuantity());
        materialDto.setMaterialTypeGraphicIcon(typeMaterial.getMaterialTypeGraphicIcon());
        return materialDto;
    }
View Full Code Here

Examples of lv.odylab.evemanage.client.rpc.dto.blueprint.MaterialDto

        return typeMaterialDto;
    }

    @Override
    public MaterialDto map(InvTypeMaterialDto invTypeMaterialDto, Class<MaterialDto> materialDtoClass) {
        MaterialDto materialDto = new MaterialDto();
        materialDto.setMaterialTypeID(invTypeMaterialDto.getMaterialTypeID());
        materialDto.setMaterialTypeName(invTypeMaterialDto.getMaterialTypeName());
        materialDto.setMaterialTypeCategoryID(invTypeMaterialDto.getMaterialTypeCategoryID());
        materialDto.setQuantity(invTypeMaterialDto.getQuantity());
        materialDto.setMaterialTypeGraphicIcon(invTypeMaterialDto.getMaterialTypeIcon());
        return materialDto;
    }
View Full Code Here

Examples of org.libreplan.ws.materials.api.MaterialDTO

        String unitTypeCode = null;
        if (material.getUnitType() != null) {
            unitTypeCode = material.getUnitType().getCode();
        }

        return new MaterialDTO(material.getCode(), material.getDescription(),
                material.getDefaultUnitPrice(), unitTypeCode, material
                        .getDisabled());

    }
View Full Code Here

Examples of org.libreplan.ws.materials.api.MaterialDTO

    @Test
    @Transactional
    public void testAddAndGetMaterialCategories() {
        /* Build materialCategory (0 constraint violations). */
        // Missing material name and the unit type.
        MaterialDTO m1 = new MaterialDTO(null, new BigDecimal(13),
                getUnitTypeCodeA(), true);
        // Missing default unit price
        MaterialDTO m2 = new MaterialDTO("material 2", null, getUnitTypeCodeA(),
                true);
        // Missing unit type
        MaterialDTO m3 = new MaterialDTO("material 3", new BigDecimal(13),
                null, true);
        // Missing unit type, same name
        MaterialDTO m4 = new MaterialDTO("material 3", new BigDecimal(13),
                getUnitTypeCodeA(), null);

        List<MaterialDTO> materialDTOs = new ArrayList<MaterialDTO>();
        materialDTOs.add(m1);
        materialDTOs.add(m2);
View Full Code Here

Examples of org.libreplan.ws.materials.api.MaterialDTO

    @Test
    @Transactional
    public void testAddMaterialRepeatedCodes() {
        /* Build material with same code (1 constraint violations). */
        MaterialDTO m1 = new MaterialDTO("CodeA", "material1", new BigDecimal(
                13), getUnitTypeCodeA(), true);
        MaterialDTO m2 = new MaterialDTO("CodeA", "material2", new BigDecimal(
                13), getUnitTypeCodeA(), true);

        List<MaterialDTO> materialDTOs = new ArrayList<MaterialDTO>();
        materialDTOs.add(m1);
        materialDTOs.add(m2);
View Full Code Here

Examples of org.libreplan.ws.materials.api.MaterialDTO

    @Test
    @Transactional
    public void testAddValidMaterialCategory() {
        /* Build material (0 constraint violations). */
        MaterialDTO m1 = new MaterialDTO("CodeM1", "material1", new BigDecimal(
                13), getUnitTypeCodeA(), true);
        MaterialDTO m2 = new MaterialDTO("CodeM2", "material2", new BigDecimal(
                13), getUnitTypeCodeA(), true);

        List<MaterialDTO> materialDTOs1 = new ArrayList<MaterialDTO>();
        List<MaterialDTO> materialDTOs2 = new ArrayList<MaterialDTO>();
        materialDTOs1.add(m1);
View Full Code Here

Examples of org.libreplan.ws.materials.api.MaterialDTO

    @Test
    @Transactional
    public void testAddAndUpdateMaterialCategory() {

        /* Build material (0 constraint violations). */
        MaterialDTO m1 = new MaterialDTO("M-1", "tornillos",
                new BigDecimal(13), UnitTypeBootstrap.getDefaultUnitType()
                        .getCode(), true);

        List<MaterialDTO> materialDTOs1 = new ArrayList<MaterialDTO>();
        materialDTOs1.add(m1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.