Package civquest.swing.panes.unitComp

Examples of civquest.swing.panes.unitComp.UnitInfoComponent


            Iterator<Long> iterator = fieldReader.getUnits(
                this.workingFieldPos);
            for (;iterator.hasNext();) {
                Long unitID = iterator.next();
                UnitInfoComponent infoComponent = new UnitInfoComponent(
                    unitID, this.unitInfoRuleset, true, this.gameData);
                this.wfUnits.put(unitID, infoComponent);
                this.addUnitComponent(this.wfInfoPanel, infoComponent,
                    this.dummyWfPanel);
            }               
View Full Code Here


            if (fieldReader.areUnitsAvailable(coord)) {
                Iterator<Long> uit = fieldReader.getUnits(coord);
                for (;uit.hasNext();) {
                    Long unitID = uit.next();
                    if (!this.markedFieldUnits.containsKey(unitID)) {
                        UnitInfoComponent infoComponent;
                        if (!this.activeUnits.containsKey(unitID)) {
                            infoComponent = new UnitInfoComponent(unitID,
                                    this.unitInfoRuleset, false,
                                    this.gameData);
                            this.addUnitComponent(this.markedInfoPanel,
                                    infoComponent, this.dummyMarkedPanel);
                        } else {
View Full Code Here

    public void afterGameChanged(MarkUnit markUnit) {
        this.infoMode = InfoMode.MARKED_MODE;

        Long[] unitIDs = markUnit.getUnits();
        for (Long unitID : unitIDs) {
            UnitInfoComponent infoComponent;
            if (!this.markedFieldUnits.containsKey(unitID)) {
                infoComponent = new UnitInfoComponent(unitID,
                        this.unitInfoRuleset, false, this.gameData);
                this.addUnitComponent(this.markedInfoPanel, infoComponent,
                        this.dummyMarkedPanel);
            } else {
                infoComponent = this.markedFieldUnits.get(unitID);
View Full Code Here

            = SetOperations.constructHashSet(unitsOnWFIterator);
//                     Set<Long> unitsOnWF = mainMapView.getWorkingField()
//                         .getUnitIDs();
                    if (unitsOnWF.contains(unitID)) {
                        //add unit to wfUnits if it entered the wf
                        UnitInfoComponent unitInfo = new UnitInfoComponent(unitID,
                                this.unitInfoRuleset, true, this.gameData);
                        this.addUnitComponent(this.wfInfoPanel, unitInfo,
                                this.dummyWfPanel);
                        this.wfUnits.put(unitID, unitInfo);
                    }
                }
            }
        } else if (this.infoMode == InfoMode.MARKED_MODE) {
            for (Long unitID : unitIDs) {
                if (this.markedFieldUnits.containsKey(unitID) ||
                        this.activeUnits.containsKey(unitID)) {
                    //unitInfo displayed
                    Group group = mainMapView.getActiveGroup();
                    boolean removeUnitInfo = true;
                    UnitInfoComponent unitInfo = null;

                    if (this.activeUnits.containsKey(unitID)) {
                        if (!group.getUnits().contains(unitID)) {
                            //remove unit from activeUnits as it isn't active
                            //any more
                            unitInfo = this.activeUnits.get(unitID);
                            this.activeUnits.remove(unitID);
                        } else {
                            removeUnitInfo = false;
                        }
                    }
                    if (this.markedFieldUnits.containsKey(unitID)) {
                        if (!group.getUnitsOnFields().contains(unitID)) {
                            //remove unit from markedUnits if it isn't on a
                            //marked field any more
                            unitInfo = this.markedFieldUnits.get(unitID);
                            this.markedFieldUnits.remove(unitID);
                        } else {
                            removeUnitInfo = false;
                        }
                    }
                    if (removeUnitInfo) {
                        this.markedInfoPanel.remove(unitInfo);
                    }
                } else {
                    //unitInfo not displayed
                    Group group = mainMapView.getActiveGroup();
                    if (group.getUnits().contains(unitID) ||
                            group.getUnitsOnFields().contains(unitID)) {
                        //add unit to markedUnits if it is marked now
                        UnitInfoComponent unitInfo = new UnitInfoComponent(unitID,
                                this.unitInfoRuleset, false, this.gameData);
                        this.addUnitComponent(this.markedInfoPanel, unitInfo,
                                this.dummyMarkedPanel);
                        if (group.getUnits().contains(unitID)) {
                            this.activeUnits.put(unitID, unitInfo);
View Full Code Here

TOP

Related Classes of civquest.swing.panes.unitComp.UnitInfoComponent

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.