Package net.sf.robocode.settings

Examples of net.sf.robocode.settings.ISettingsManager


      } catch (NullPointerException e) {}
    }
  }

  private void loadDisplayOptions() {
    ISettingsManager props = properties;

    drawRobotName = props.getOptionsViewRobotNames();
    drawRobotEnergy = props.getOptionsViewRobotEnergy();
    drawScanArcs = props.getOptionsViewScanArcs();
    drawGround = props.getOptionsViewGround();
    drawExplosions = props.getOptionsViewExplosions();
    drawExplosionDebris = props.getOptionsViewExplosionDebris();

    renderingHints = props.getRenderingHints();
    numBuffers = props.getOptionsRenderingNoBuffers();
  }
View Full Code Here


  private void initialize() {
    setLayout(new GridLayout(1, 2));
    add(getVisibleOptionsPanel());
    add(getTpsOptionsPanel());

    final ISettingsManager props = properties;

    loadPreferences(props);

    props.addPropertyListener(new ISettingsListener() {
      public void settingChanged(String property) {
        if (property.equals(ISettingsManager.OPTIONS_BATTLE_DESIREDTPS)) {
          PreferencesViewOptionsTab.this.desiredTpsTextField.setText("" + props.getOptionsBattleDesiredTPS());
        }
      }
    });
  }
View Full Code Here

    getPreventSpeedupWhenMinimizedCheckBox().setSelected(
        robocodeProperties.getOptionsViewPreventSpeedupWhenMinimized());
  }

  public void storePreferences() {
    ISettingsManager props = properties;

    props.setOptionsViewFPS(getDisplayFpsCheckBox().isSelected());
    props.setOptionsViewTPS(getDisplayTpsCheckBox().isSelected());
    props.setOptionsViewRobotNames(getVisibleRobotNameCheckBox().isSelected());
    props.setOptionsViewRobotEnergy(getVisibleRobotEnergyCheckBox().isSelected());
    props.setOptionsViewScanArcs(getVisibleScanArcsCheckBox().isSelected());
    props.setOptionsViewExplosions(getVisibleExplosionsCheckBox().isSelected());
    props.setOptionsViewGround(getVisibleGroundCheckBox().isSelected());
    props.setOptionsViewExplosionDebris(getVisibleExplosionDebrisCheckBox().isSelected());
    props.setOptionsViewSentryBorder(getVisibleSentryBorderCheckBox().isSelected());
    props.setOptionsBattleDesiredTPS(Integer.parseInt(getDesiredTpsTextField().getText()));
    props.setOptionsViewPreventSpeedupWhenMinimized(getPreventSpeedupWhenMinimizedCheckBox().isSelected());
    properties.saveProperties();
  }
View Full Code Here

    getEnableReplayRecordingCheckBox().setSelected(props.getOptionsCommonEnableReplayRecording());
    getEnableAutoRecordingCheckBox().setSelected(props.getOptionsCommonEnableAutoRecording());
  }

  public void storePreferences() {
    ISettingsManager props = properties;

    props.setOptionsCommonNotifyAboutNewBetaVersions(getNotifyAboutBetaVersionsCheckBox().isSelected());
    props.setOptionsCommonShowResults(getShowResultsCheckBox().isSelected());
    props.setOptionsCommonDontHideRankings(getDontHideRankingsCheckBox().isSelected());
    props.setOptionsCommonAppendWhenSavingResults(getAppendWhenSavingResultsCheckBox().isSelected());
    props.setOptionsCommonEnableReplayRecording(getEnableReplayRecordingCheckBox().isSelected());
    props.setOptionsCommonEnableAutoRecording(getEnableAutoRecordingCheckBox().isSelected());

    properties.saveProperties();
  }
View Full Code Here

    getOptionsRenderingBufferImagesCheckBox().setSelected(props.getOptionsRenderingBufferImages());
    getOptionsRenderingForceBulletColorCheckBox().setSelected(props.getOptionsRenderingForceBulletColor());
  }

  public void storePreferences() {
    ISettingsManager props = properties;

    props.setOptionsRenderingAntialiasing(optionsRenderingAntialiasingComboBox.getSelectedIndex());
    props.setOptionsRenderingTextAntialiasing(optionsRenderingTextAntialiasingComboBox.getSelectedIndex());
    props.setOptionsRenderingMethod(optionsRenderingMethodComboBox.getSelectedIndex());
    props.setOptionsRenderingNoBuffers(optionsRenderingNoBuffersComboBox.getSelectedIndex() + 1);
    props.setOptionsRenderingBufferImages(optionsRenderingBufferImagesCheckBox.isSelected());
    props.setOptionsRenderingForceBulletColor(optionsRenderingForceBulletColorCheckBox.isSelected());
    properties.saveProperties();
  }
View Full Code Here

    setMixerCompoBox(robocodeProperties.getOptionsSoundMixer());
  }

  public void storePreferences() {
    ISettingsManager props = properties;

    props.setOptionsSoundEnableSound(getEnableSoundCheckBox().isSelected());
    props.setOptionsSoundEnableGunshot(getEnableGunshotCheckBox().isSelected());
    props.setOptionsSoundEnableBulletHit(getEnableBulletHitCheckBox().isSelected());
    props.setOptionsSoundEnableRobotDeath(getEnableRobotDeathCheckBox().isSelected());
    props.setOptionsSoundEnableRobotCollision(getEnableRobotCollisionCheckBox().isSelected());
    props.setOptionsSoundEnableWallCollision(getEnableWallCollisionCheckBox().isSelected());
    props.setOptionsSoundEnableMixerVolume(getEnableMixerVolumeCheckBox().isSelected());
    props.setOptionsSoundEnableMixerPan(getEnableMixerPanCheckBox().isSelected());

    String mixerClassName = null;
    Mixer.Info mixerInfo = (Mixer.Info) getMixerComboBox().getSelectedItem();

    if (mixerInfo != null) {
      Mixer mixer = AudioSystem.getMixer((Mixer.Info) getMixerComboBox().getSelectedItem());

      if (mixer != null) {
        mixerClassName = mixer.getClass().getSimpleName();
      }
    }
    if (mixerClassName != null) {
      props.setOptionsSoundMixer(mixerClassName);
    }

    properties.saveProperties();
  }
View Full Code Here

      replayButton.setDisplayedMnemonicIndex(5);
      replayButton.setHorizontalTextPosition(SwingConstants.CENTER);
      replayButton.setVerticalTextPosition(SwingConstants.BOTTOM);
      replayButton.addActionListener(eventHandler);

      ISettingsManager props = properties;

      replayButton.setVisible(props.getOptionsCommonEnableReplayRecording());

      props.addPropertyListener(new ISettingsListener() {
        public void settingChanged(String property) {
          if (property.equals(ISettingsManager.OPTIONS_COMMON_ENABLE_REPLAY_RECORDING)) {
            replayButton.setVisible(properties.getOptionsCommonEnableReplayRecording());
          }
        }
View Full Code Here

   *
   * @return JSlider
   */
  private JSlider getTpsSlider() {
    if (tpsSlider == null) {
      final ISettingsManager props = properties;

      int tps = Math.max(props.getOptionsBattleDesiredTPS(), 1);

      tpsSlider = new JSlider(0, MAX_TPS_SLIDER_VALUE, tpsToSliderValue(tps));
      tpsSlider.setPaintLabels(true);
      tpsSlider.setPaintTicks(true);
      tpsSlider.setMinorTickSpacing(1);

      tpsSlider.addChangeListener(eventHandler);

      Dictionary<Integer, JLabel> labels = new Hashtable<Integer, JLabel>();

      labels.put(0, new JLabel("0"));
      labels.put(5, new JLabel("5"));
      labels.put(10, new JLabel("10"));
      labels.put(15, new JLabel("15"));
      labels.put(20, new JLabel("20"));
      labels.put(25, new JLabel("25"));
      labels.put(30, new JLabel("30"));
      labels.put(35, new JLabel("40"));
      labels.put(40, new JLabel("50"));
      labels.put(45, new JLabel("65"));
      labels.put(50, new JLabel("90"));
      labels.put(55, new JLabel("150"));
      labels.put(60, new JLabel("1000"));

      tpsSlider.setMajorTickSpacing(5);
      tpsSlider.setLabelTable(labels);

      WindowUtil.setFixedSize(tpsSlider, new Dimension((MAX_TPS_SLIDER_VALUE + 1) * 6, 40));

      props.addPropertyListener(new ISettingsListener() {
        public void settingChanged(String property) {
          if (property.equals(ISettingsManager.OPTIONS_BATTLE_DESIREDTPS)) {
            setTpsOnSlider(props.getOptionsBattleDesiredTPS());
          }
        }
      });
    }
    return tpsSlider;
View Full Code Here

      battleSaveRecordAsMenuItem.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_R, MENU_SHORTCUT_KEY_MASK, false));
      battleSaveRecordAsMenuItem.setEnabled(false);
      battleSaveRecordAsMenuItem.addActionListener(eventHandler);

      ISettingsManager props = properties;

      props.addPropertyListener(
          new ISettingsListener() {
        public void settingChanged(String property) {
          if (property.equals(ISettingsManager.OPTIONS_COMMON_ENABLE_REPLAY_RECORDING)) {
            final boolean canReplayRecord = recordManager.hasRecord();
            final boolean enableSaveRecord = properties.getOptionsCommonEnableReplayRecording()
View Full Code Here

      battleExportRecordMenuItem.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_X, MENU_SHORTCUT_KEY_MASK, false));
      battleExportRecordMenuItem.setEnabled(false);
      battleExportRecordMenuItem.addActionListener(eventHandler);

      ISettingsManager props = properties;

      props.addPropertyListener(
          new ISettingsListener() {
        public void settingChanged(String property) {
          if (property.equals(ISettingsManager.OPTIONS_COMMON_ENABLE_REPLAY_RECORDING)) {
            final boolean canReplayRecord = recordManager.hasRecord();
            final boolean enableSaveRecord = properties.getOptionsCommonEnableReplayRecording()
View Full Code Here

TOP

Related Classes of net.sf.robocode.settings.ISettingsManager

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.