DynamicProperty.java 文件源码

java
阅读 16 收藏 0 点赞 0 评论 0

项目:VASSAL-src 作者:
public Ed(final DynamicProperty m) {
  keyCommandListConfig = new ListConfigurer(null, "Key Commands") {
    protected Configurer buildChildConfigurer() {
      return new DynamicKeyCommandConfigurer(m);
    }
  };
  keyCommandListConfig.setValue(
    new ArrayList<DynamicKeyCommand>(Arrays.asList(m.keyCommands)));
  PropertyChangeListener l = new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent evt) {
      boolean isNumeric = numericConfig.booleanValue().booleanValue();
      minConfig.getControls().setVisible(isNumeric);
      maxConfig.getControls().setVisible(isNumeric);
      wrapConfig.getControls().setVisible(isNumeric);
      keyCommandListConfig.repack();
    }
  };
  controls = Box.createVerticalBox();
  nameConfig = new StringConfigurer(null, "Name:  ", m.getKey());
  controls.add(nameConfig.getControls());
  initialValueConfig = new StringConfigurer(null, "Value:  ", m.getValue());
  controls.add(initialValueConfig.getControls());
  numericConfig =
    new BooleanConfigurer(null, "Is numeric:  ", m.isNumeric());
  controls.add(numericConfig.getControls());
  minConfig =
    new IntConfigurer(null, "Minimum value:  ", m.getMinimumValue());
  controls.add(minConfig.getControls());
  maxConfig =
    new IntConfigurer(null, "Maximum value:  ", m.getMaximumValue());
  controls.add(maxConfig.getControls());
  wrapConfig = new BooleanConfigurer(null, "Wrap?", m.isWrap());
  controls.add(wrapConfig.getControls());
  controls.add(keyCommandListConfig.getControls());

  numericConfig.addPropertyChangeListener(l);
  numericConfig.fireUpdate();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号