Package de.ailis.xadrian.data

Examples of de.ailis.xadrian.data.Race


                final Element element = (Element) item;
                final String id = element.attributeValue("id");
                final String colorStr = element.attributeValue("color");
                final Color color = new Color(Integer.parseInt(colorStr
                    .substring(1), 16));
                final Race race = new Race(this.game, id, color);
                this.races.add(race);
                this.raceMap.put(id, race);
            }
        }
        catch (final DocumentException e)
View Full Code Here


        // Load preference values
        for (final Map.Entry<Race, JCheckBox> entry : this.racesCheckBoxes
            .entrySet())
        {
            final Race race = entry.getKey();
            final JCheckBox checkBox = entry.getValue();
            checkBox.setSelected(!config.isRaceIgnored(race));
        }
        this.showFactoryResourcesCheckBox.setSelected(config
            .isShowFactoryResources());
        this.nightModeCheckBox.setSelected(config
            .isNightMode());
        this.themeComboBox.setSelectedItem(ThemeFactory.getInstance().getTheme(
            UIManager.getLookAndFeel().getClass().getName()));
        this.localeComboBox.setSelectedItem(new ComboBoxEntry(null,
            config.getLocale()));
        this.prodStatsComboBox.setSelectedItem(new ComboBoxEntry(null,
            config.isProdStatsPerMinute()));
        this.x3tcPlayerSectorComboBox.setSelectedIndex(config.getX3TCPlayerSector());
        this.x3apPlayerSectorComboBox.setSelectedIndex(config.getX3APPlayerSector());

        final String defaultGameId = config.getDefaultGame();
        final GameFactory gameFactory = GameFactory.getInstance();
        if (defaultGameId == null || !gameFactory.hasGame(defaultGameId))
            this.gamesComboBox.setSelectedIndex(0);
        else
            this.gamesComboBox.setSelectedItem(GameFactory.getInstance()
                .getGame(defaultGameId));

        final Result result = super.open();
        if (result == Result.OK)
        {
            // Save preference values
            for (final Map.Entry<Race, JCheckBox> entry : this.racesCheckBoxes
                .entrySet())
            {
                final Race race = entry.getKey();
                final JCheckBox checkBox = entry.getValue();
                config.setRaceIgnored(race, !checkBox.isSelected());
            }
            for (final Game game : GameFactory.getInstance().getGames())
            {
View Full Code Here

                final String sizeStr = element.attributeValue("size");
                if (sizeStr == null)
                    size = FactorySize.S;
                else
                    size = FactorySize.valueOf(sizeStr);
                final Race race = raceFactory.getRace(element
                    .attributeValue("race"));
                final int cycle = Integer.parseInt(element
                    .attributeValue("cycle"));
                final int price = Integer.parseInt(element
                    .attributeValue("price"));
View Full Code Here

                this.maxY = Math.max(this.maxY, y);
                final int planets = Integer.parseInt(element
                    .attributeValue("planets"));
                final Sun suns = sunsFactory.getSun(Integer.parseInt(element
                    .attributeValue("suns")));
                final Race race = raceFactory.getRace(element
                    .attributeValue("race"));
                final boolean core = Boolean.parseBoolean(element
                    .attributeValue("core"));
                final String northId = element.attributeValue("north");
                final String eastId = element.attributeValue("east");
View Full Code Here

TOP

Related Classes of de.ailis.xadrian.data.Race

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.