SetGlobalProperty.java 文件源码

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

项目:VASSAL-src 作者:
public Ed(final SetGlobalProperty 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();
  descConfig = new StringConfigurer(null, "Description:  ", m.description);
  controls.add(descConfig.getControls());
  nameConfig = new PropertyNameExpressionConfigurer(null, "Global Property Name:  ", m.getKey(), (EditablePiece) m);
  controls.add(nameConfig.getControls());
  levelConfig = new StringEnumConfigurer(null, "", new String[]{CURRENT_ZONE, NAMED_ZONE, NAMED_MAP});
  levelConfig.setValue(m.propertyLevel);
  levelConfig.addPropertyChangeListener(new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent e) {
      updateVisibility();
    }
  });
  Box box = Box.createHorizontalBox();
  box.add(new JLabel("Locate Property starting in the:   "));
  box.add(levelConfig.getControls());
  controls.add(box);
  nameBox = Box.createHorizontalBox();
  nameBox.add(new JLabel("Name of "));
  nameBox.add(mapLabel);
  nameBox.add(zoneLabel);
  nameBox.add(new JLabel(" containing property:  "));
  searchNameConfig = new FormattedExpressionConfigurer(null, "", m.searchName, (EditablePiece) m);
  nameBox.add(searchNameConfig.getControls());
  controls.add(nameBox);
  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();
  updateVisibility();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号