Examples of IClientPreferences


Examples of megamek.common.preference.IClientPreferences

        serverPassF.addActionListener(this);
        portF = new JTextField(PreferenceManager.getClientPreferences()
                .getLastServerPort()
                + "", 4); //$NON-NLS-1$
        portF.addActionListener(this);
        IClientPreferences cs = PreferenceManager.getClientPreferences();
        metaserver = cs.getMetaServerName();
        metaserverL = new JLabel(
                Messages.getString("MegaMek.metaserverL"), SwingConstants.RIGHT); //$NON-NLS-1$
        metaserverF = new JTextField(metaserver);
        metaserverL.setEnabled(register);
        metaserverF.setEnabled(register);
        int goalNumber = cs.getGoalPlayers();
        goalL = new JLabel(
                Messages.getString("MegaMek.goalL"), SwingConstants.RIGHT); //$NON-NLS-1$
        goalF = new JTextField(Integer.toString(goalNumber), 2);
        goalL.setEnabled(register);
        goalF.setEnabled(register);
View Full Code Here

Examples of megamek.common.preference.IClientPreferences

        butAdd.setEnabled(enable);
        m_bPick.setEnabled(true);
    }

    private void autoSetSkills(Entity e) {
        IClientPreferences cs = PreferenceManager.getClientPreferences();
        if(!cs.useAverageSkills()) {
            return;
        }
        int piloting=5;
        int gunnery=4;
        if(e.isClan()) {
View Full Code Here

Examples of megamek.common.preference.IClientPreferences

     * <code>Dialog#setVisible(boolean)</code>.
     */
    @Override
    public void setVisible(boolean visible) {
        GUIPreferences gs = GUIPreferences.getInstance();
        IClientPreferences cs = PreferenceManager.getClientPreferences();

        minimapEnabled.setSelected(gs.getMinimapEnabled());
        autoEndFiring.setSelected(gs.getAutoEndFiring());
        autoDeclareSearchlight.setSelected(gs.getAutoDeclareSearchlight());
        nagForMASC.setSelected(gs.getNagForMASC());
        nagForPSR.setSelected(gs.getNagForPSR());
        nagForNoAction.setSelected(gs.getNagForNoAction());
        animateMove.setSelected(gs.getShowMoveStep());
        showWrecks.setSelected(gs.getShowWrecks());
        soundMute.setSelected(gs.getSoundMute());
        showMapHexPopup.setSelected(gs.getShowMapHexPopup());
        tooltipDelay.setText(Integer.toString(gs.getTooltipDelay()));

        // Select the correct char set (give a nice default to start).
        unitStartChar.setSelectedIndex(0);
        for (int loop = 0; loop < unitStartChar.getItemCount(); loop++) {
            if (((String) unitStartChar.getItemAt(loop)).charAt(0) == PreferenceManager
                    .getClientPreferences().getUnitStartChar()) {
                unitStartChar.setSelectedIndex(loop);
                break;
            }
        }

        maxPathfinderTime.setText(Integer.toString(cs.getMaxPathfinderTime()));

        rightDragScroll.setSelected(gs.getRightDragScroll());
        ctlScroll.setSelected(gs.getCtlScroll());
        clickEdgeScroll.setSelected(gs.getClickEdgeScroll());
        alwaysRightClickScroll.setSelected(gs.getAlwaysRightClickScroll());
        autoEdgeScroll.setSelected(gs.getAutoEdgeScroll());
        scrollSensitivity.setText(Integer.toString(gs.getScrollSensitivity()));

        keepGameLog.setSelected(cs.keepGameLog());
        gameLogFilename.setEnabled(keepGameLog.isSelected());
        gameLogFilename.setText(cs.getGameLogFilename());
        // gameLogMaxSize.setEnabled(keepGameLog.isSelected());
        // gameLogMaxSize.setText( Integer.toString(cs.getGameLogMaxSize()) );
        stampFilenames.setSelected(cs.stampFilenames());
        stampFormat.setEnabled(stampFilenames.isSelected());
        stampFormat.setText(cs.getStampFormat());

        defaultAutoejectDisabled.setSelected(cs.defaultAutoejectDisabled());
        useAverageSkills.setSelected(cs.useAverageSkills());
        showUnitId.setSelected(cs.getShowUnitId());

        int index = 0;
        if (cs.getLocaleString().startsWith("de")) {
            index = 1;
        }
        if (cs.getLocaleString().startsWith("ru")) {
            index = 2;
        }
        displayLocale.setSelectedIndex(index);

        chatloungeTabs.setSelected(gs.getChatLoungeTabs());

        showMapsheets.setSelected(gs.getShowMapsheets());

        File dir = new File("data" + File.separator + "images" + File.separator
                + "hexes" + File.separator);
        tileSets = dir.listFiles(new FilenameFilter() {
            public boolean accept(File direc, String name) {
                if (name.endsWith(".tileset")) {
                    return true;
                }
                return false;
            }
        });
        tileSetChoice.removeAllItems();
        for (int i = 0; i < tileSets.length; i++) {
            String name = tileSets[i].getName();
            tileSetChoice.addItem(name.substring(0, name.length() - 8));
            if (name.equals(cs.getMapTileset())) {
                tileSetChoice.setSelectedIndex(i);
            }
        }

        getFocus.setSelected(gs.getFocus());
View Full Code Here

Examples of megamek.common.preference.IClientPreferences

    /**
     * Update the settings from this dialog's values, then closes it.
     */
    private void update() {
        GUIPreferences gs = GUIPreferences.getInstance();
        IClientPreferences cs = PreferenceManager.getClientPreferences();

        gs.setMinimapEnabled(minimapEnabled.isSelected());
        gs.setAutoEndFiring(autoEndFiring.isSelected());
        gs.setAutoDeclareSearchlight(autoDeclareSearchlight.isSelected());
        gs.setNagForMASC(nagForMASC.isSelected());
        gs.setNagForPSR(nagForPSR.isSelected());
        gs.setNagForNoAction(nagForNoAction.isSelected());
        gs.setShowMoveStep(animateMove.isSelected());
        gs.setShowWrecks(showWrecks.isSelected());
        gs.setSoundMute(soundMute.isSelected());
        gs.setShowMapHexPopup(showMapHexPopup.isSelected());
        gs.setTooltipDelay(Integer.parseInt(tooltipDelay.getText()));
        cs.setUnitStartChar(((String) unitStartChar.getSelectedItem())
                .charAt(0));

        gs.setRightDragScroll(rightDragScroll.isSelected());
        gs.setCtlScroll(ctlScroll.isSelected());
        gs.setClickEdgeScroll(clickEdgeScroll.isSelected());
        gs.setAlwaysRightClickScroll(alwaysRightClickScroll.isSelected());
        gs.setAutoEdgeScroll(autoEdgeScroll.isSelected());
        gs.setScrollSensitivity(Integer.parseInt(scrollSensitivity.getText()));
        gs.setMouseWheelZoom(mouseWheelZoom.isSelected());

        cs.setMaxPathfinderTime(Integer.parseInt(maxPathfinderTime.getText()));

        gs.setGetFocus(getFocus.isSelected());

        cs.setKeepGameLog(keepGameLog.isSelected());
        cs.setGameLogFilename(gameLogFilename.getText());
        // cs.setGameLogMaxSize(Integer.parseInt(gameLogMaxSize.getText()));
        cs.setStampFilenames(stampFilenames.isSelected());
        cs.setStampFormat(stampFormat.getText());

        cs.setDefaultAutoejectDisabled(defaultAutoejectDisabled.isSelected());
        cs.setUseAverageSkills(useAverageSkills.isSelected());
        cs.setShowUnitId(showUnitId.isSelected());

        cs.setLocale(CommonSettingsDialog.LOCALE_CHOICES[displayLocale
                .getSelectedIndex()]);

        gs.setChatloungeTabs(chatloungeTabs.isSelected());
        gs.setShowMapsheets(showMapsheets.isSelected());

        if (tileSetChoice.getSelectedIndex() >= 0) {
            cs.setMapTileset(tileSets[tileSetChoice.getSelectedIndex()]
                    .getName());
        }

        setVisible(false);
    }
View Full Code Here

Examples of megamek.common.preference.IClientPreferences

        portF = new TextField(PreferenceManager.getClientPreferences()
                .getLastServerPort()
                + "", 4); //$NON-NLS-1$
        portF.addActionListener(this);

        IClientPreferences cs = PreferenceManager.getClientPreferences();
        metaserver = cs.getMetaServerName();
        metaserverL = new Label(
                Messages.getString("MegaMek.metaserverL"), Label.RIGHT); //$NON-NLS-1$
        metaserverF = new TextField(metaserver);
        metaserverL.setEnabled(register);
        metaserverF.setEnabled(register);

        int goalNumber = cs.getGoalPlayers();
        goalL = new Label(Messages.getString("MegaMek.goalL"), Label.RIGHT); //$NON-NLS-1$
        goalF = new TextField(Integer.toString(goalNumber), 2);
        goalL.setEnabled(register);
        goalF.setEnabled(register);
View Full Code Here

Examples of megamek.common.preference.IClientPreferences

     * <code>Dialog#show()</code>.
     */
    public void setVisible(boolean show) {
        if (show) {
            GUIPreferences gs = GUIPreferences.getInstance();
            IClientPreferences cs = PreferenceManager.getClientPreferences();

            minimapEnabled.setState(gs.getMinimapEnabled());
            autoEndFiring.setState(gs.getAutoEndFiring());
            autoDeclareSearchlight.setState(gs.getAutoDeclareSearchlight());
            nagForMASC.setState(gs.getNagForMASC());
            nagForPSR.setState(gs.getNagForPSR());
            nagForNoAction.setState(gs.getNagForNoAction());
            animateMove.setState(gs.getShowMoveStep());
            showWrecks.setState(gs.getShowWrecks());
            soundMute.setState(gs.getSoundMute());
            showMapHexPopup.setState(gs.getShowMapHexPopup());
            tooltipDelay.setText(Integer.toString(gs.getTooltipDelay()));
            mouseWheelZoom.setState(gs.getMouseWheelZoom());

            // Select the correct char set (give a nice default to start).
            unitStartChar.select(0);
            for (int loop = 0; loop < unitStartChar.getItemCount(); loop++) {
                if (unitStartChar.getItem(loop).charAt(0) == PreferenceManager
                        .getClientPreferences().getUnitStartChar()) {
                    unitStartChar.select(loop);
                    break;
                }
            }

            maxPathfinderTime.setText(Integer.toString(cs
                    .getMaxPathfinderTime()));

            rightDragScroll.setState(gs.getRightDragScroll());
            ctlScroll.setState(gs.getCtlScroll());
            clickEdgeScroll.setState(gs.getClickEdgeScroll());
            alwaysRightClickScroll.setState(gs.getAlwaysRightClickScroll());
            autoEdgeScroll.setState(gs.getAutoEdgeScroll());
            scrollSensitivity.setText(Integer.toString(gs
                    .getScrollSensitivity()));

            keepGameLog.setState(cs.keepGameLog());
            gameLogFilename.setEnabled(keepGameLog.getState());
            gameLogFilename.setText(cs.getGameLogFilename());
            // gameLogMaxSize.setEnabled(keepGameLog.getState());
            // gameLogMaxSize.setText( Integer.toString(cs.getGameLogMaxSize())
            // );
            stampFilenames.setState(cs.stampFilenames());
            stampFormat.setEnabled(stampFilenames.getState());
            stampFormat.setText(cs.getStampFormat());

            defaultAutoejectDisabled.setState(cs.defaultAutoejectDisabled());
            useAverageSkills.setState(cs.useAverageSkills());
            showUnitId.setState(cs.getShowUnitId());

            int index = 0;
            if (cs.getLocaleString().startsWith("de"))
                index = 1;
            if (cs.getLocaleString().startsWith("ru"))
                index = 2;
            locale.select(index);

            chatloungeTabs.setState(gs.getChatLoungeTabs());

            showMapsheets.setState(gs.getShowMapsheets());

            File dir = new File("data" + File.separator + "images"
                    + File.separator + "hexes" + File.separator);
            tileSets = dir.listFiles(new FilenameFilter() {
                public boolean accept(File direc, String name) {
                    if (name.endsWith(".tileset"))
                        return true;
                    return false;
                }
            });
            tileSetChoice.removeAll();
            for (int i = 0; i < tileSets.length; i++) {
                String name = tileSets[i].getName();
                tileSetChoice.add(name.substring(0, name.length() - 8));
                if (name.equals(cs.getMapTileset()))
                    tileSetChoice.select(i);
            }

            getFocus.setState(gs.getFocus());
        }
View Full Code Here

Examples of megamek.common.preference.IClientPreferences

    /**
     * Update the settings from this dialog's values, then closes it.
     */
    private void update() {
        GUIPreferences gs = GUIPreferences.getInstance();
        IClientPreferences cs = PreferenceManager.getClientPreferences();

        gs.setMinimapEnabled(minimapEnabled.getState());
        gs.setAutoEndFiring(autoEndFiring.getState());
        gs.setAutoDeclareSearchlight(autoDeclareSearchlight.getState());
        gs.setNagForMASC(nagForMASC.getState());
        gs.setNagForPSR(nagForPSR.getState());
        gs.setNagForNoAction(nagForNoAction.getState());
        gs.setShowMoveStep(animateMove.getState());
        gs.setShowWrecks(showWrecks.getState());
        gs.setSoundMute(soundMute.getState());
        gs.setShowMapHexPopup(showMapHexPopup.getState());
        gs.setTooltipDelay(Integer.parseInt(tooltipDelay.getText()));
        cs.setUnitStartChar(unitStartChar.getSelectedItem().charAt(0));

        gs.setRightDragScroll(rightDragScroll.getState());
        gs.setCtlScroll(ctlScroll.getState());
        gs.setClickEdgeScroll(clickEdgeScroll.getState());
        gs.setAlwaysRightClickScroll(alwaysRightClickScroll.getState());
        gs.setAutoEdgeScroll(autoEdgeScroll.getState());
        gs.setScrollSensitivity(Integer.parseInt(scrollSensitivity.getText()));
        gs.setMouseWheelZoom(mouseWheelZoom.getState());

        cs.setMaxPathfinderTime(Integer.parseInt(maxPathfinderTime.getText()));

        gs.setGetFocus(getFocus.getState());

        cs.setKeepGameLog(keepGameLog.getState());
        cs.setGameLogFilename(gameLogFilename.getText());
        // cs.setGameLogMaxSize(Integer.parseInt(gameLogMaxSize.getText()));
        cs.setStampFilenames(stampFilenames.getState());
        cs.setStampFormat(stampFormat.getText());

        cs.setDefaultAutoejectDisabled(defaultAutoejectDisabled.getState());
        cs.setUseAverageSkills(useAverageSkills.getState());
        cs.setShowUnitId(showUnitId.getState());

        cs.setLocale(CommonSettingsDialog.LOCALE_CHOICES[locale
                .getSelectedIndex()]);

        gs.setChatloungeTabs(chatloungeTabs.getState());
        gs.setShowMapsheets(showMapsheets.getState());

        if (tileSetChoice.getSelectedIndex() >= 0)
            cs.setMapTileset(tileSets[tileSetChoice.getSelectedIndex()]
                    .getName());

        this.setVisible(false);
    }
View Full Code Here

Examples of megamek.common.preference.IClientPreferences

        m_bPickClose.setEnabled(enable);
    }

  
    private void autoSetSkills(Entity e) {
        IClientPreferences cs = PreferenceManager.getClientPreferences();
        if (!cs.useAverageSkills())
            return;
        int piloting = 5;
        int gunnery = 4;
        if (e.isClan()) {
            if (e instanceof Mech || e instanceof BattleArmor) {
View Full Code Here

Examples of megamek.common.preference.IClientPreferences

        m_bPick.setEnabled(enable);
        m_bPickClose.setEnabled(enable);
    }

    private void autoSetSkills(Entity e) {
        IClientPreferences cs = PreferenceManager.getClientPreferences();
        if (!cs.useAverageSkills()) {
            return;
        }
        int piloting = 5;
        int gunnery = 4;
        if (e.isClan()) {
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.