Examples of UnitType


Examples of org.freerealm.unit.UnitType

                } else if (subNode.getNodeName().equals("skippedForCurrentTurn")) {
                    boolean skippedForCurrentTurnValue = Boolean.parseBoolean(subNode.getFirstChild().getNodeValue());
                    unit.setSkippedForCurrentTurn(skippedForCurrentTurnValue);
                } else if (subNode.getNodeName().equals("type")) {
                    String unitTypeName = subNode.getFirstChild().getNodeValue();
                    UnitType unitType = realm.getUnitTypeManager().getUnitType(unitTypeName);
                    unit.setType(unitType);
                } else if (subNode.getNodeName().equals("Coordinate")) {
                    Coordinate coordinate = new Coordinate();
                    (new CoordinateXMLWrapper(coordinate)).initializeFromNode(realm, subNode);
                    unit.setCoordinate(coordinate);
View Full Code Here

Examples of org.freerealm.unit.UnitType

                xml.append("<queueItem>\n");
                xml.append("<type>SETTLEMENT_IMPROVEMENT</type>\n");
                xml.append("<id>" + cityImprovementType.getId() + "</id>\n");
                xml.append("</queueItem>\n");
            } else if (settlementBuildable instanceof UnitType) {
                UnitType unitType = (UnitType) settlementBuildable;
                xml.append("<queueItem>\n");
                xml.append("<type>UNIT</type>\n");
                xml.append("<id>" + unitType.getId() + "</id>\n");
                xml.append("</queueItem>\n");
            }
        }
        xml.append("</productionQueue>\n");
        xml.append("<contiuousProduction>" + settlement.isContiuousProduction() + "</contiuousProduction>\n");
View Full Code Here

Examples of org.freerealm.unit.UnitType

                            int id = Integer.parseInt(queueItemIdNode.getFirstChild().getNodeValue());
                            if (queueItemType.equals("SETTLEMENT_IMPROVEMENT")) {
                                SettlementImprovementType cityImprovementType = realm.getSettlementImprovementManager().getImprovement(id);
                                settlement.addToProductionQueue(cityImprovementType);
                            } else if (queueItemType.equals("UNIT")) {
                                UnitType unitType = realm.getUnitTypeManager().getUnitType(id);
                                settlement.addToProductionQueue(unitType);
                            }
                        }
                    }
                } else if (subNode.getNodeName().equals("contiuousProduction")) {
View Full Code Here

Examples of org.freerealm.unit.UnitType

    public int getUnitUpkeep() {
        int upkeep = 0;
        Iterator<Unit> unitsIterator = getUnits().values().iterator();
        while (unitsIterator.hasNext()) {
            UnitType unitType = unitsIterator.next().getType();
            upkeep = upkeep + unitType.getUpkeepCost();
        }
        return upkeep;
    }
View Full Code Here

Examples of org.jfree.util.UnitType

    Boolean isAntiAlias = (Boolean)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.CHART_ANTI_ALIAS);
    if(isAntiAlias != null)
      jfreeChart.setAntiAlias(isAntiAlias.booleanValue());
   
    Double padding = (Double)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.CHART_PADDING);
    UnitType unitType = (UnitType)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.UNIT_TYPE);
    if(padding != null && unitType != null)
    {
      double chartPadding = padding.doubleValue();
      jfreeChart.setPadding(new RectangleInsets(unitType, chartPadding, chartPadding, chartPadding, chartPadding));
    }
View Full Code Here

Examples of org.jfree.util.UnitType

    /**
     * Serialize an instance, restore it, and check for identity.
     */
    public void testSerialization() {

        UnitType t1 = UnitType.ABSOLUTE;
        UnitType t2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(t1);
View Full Code Here

Examples of org.jfree.util.UnitType

    /**
     * Serialize an instance, restore it, and check for identity.
     */
    public void testSerialization() {

        UnitType t1 = UnitType.ABSOLUTE;
        UnitType t2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(t1);
View Full Code Here

Examples of org.jfree.util.UnitType

    /**
     * Serialize an instance, restore it, and check for identity.
     */
    public void testSerialization() {

        UnitType t1 = UnitType.ABSOLUTE;
        UnitType t2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(t1);
View Full Code Here

Examples of org.libreplan.business.materials.entities.UnitType

                .trim(materialDTO.description), materialDTO.defaultPrice,
                materialDTO.disabled);

        if (materialDTO.unitType != null) {
            try {
                UnitType unitType = Registry.getUnitTypeDAO()
                        .findByCodeAnotherTransaction(
                        materialDTO.unitType);
                material.setUnitType(unitType);
            } catch (InstanceNotFoundException e) {
                throw new ValidationException("unit type code not found");
View Full Code Here

Examples of org.libreplan.business.materials.entities.UnitType

    public final static void updateMaterial(Material material,
            MaterialDTO materialDTO) throws ValidationException {
        if (materialDTO.unitType != null) {
            try {
                UnitType type = Registry.getUnitTypeDAO()
                        .findByCodeAnotherTransaction(
                        materialDTO.unitType);
                material.setUnitType(type);
            } catch (InstanceNotFoundException e) {
                throw new ValidationException("unit type code not found");
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.