ToggleButtonModel.js
上传用户:ahit0551
上传日期:2009-04-15
资源大小:2345k
文件大小:1k
源码类别:

xml/soap/webservice

开发平台:

Java

  1. /**
  2.  * <p>Title: </p>
  3.  * <p>Description: </p>
  4.  * <p>Copyright: Copyright (c) xio.name 2006</p>
  5.  * @author xio
  6.  */ function ToggleButtonModel(enabled, pressed, pressed) {     this.base = ButtonModel;     this.base(enabled, pressed);
  7. //     if (pressed != null) {         this.setPressed(pressed);     } else {         this.setPressed(false);     }     //     this.buttonGroup = null; } ToggleButtonModel.prototype = new ButtonModel(); ToggleButtonModel.prototype.setPressed = function (pressed) {     var group = this.getGroup();     if (group != null) {         group.setPressed(this, pressed);         pressed = group.isPressed(this);     }     if (this.isPressed() == pressed) {         return;     }     this.pressed = pressed;     this.notifyObservers(ToggleButtonModel.PRESSED_CHANGED_PROPERTY); }; ToggleButtonModel.prototype.isPressed = function () {     return this.pressed; }; ToggleButtonModel.prototype.setGroup = function (buttonGroup) {     this.buttonGroup = buttonGroup; }; ToggleButtonModel.prototype.getGroup = function () {     return this.buttonGroup; };
  8. //静态变量 ToggleButtonModel.PRESSED_CHANGED_PROPERTY = "TOGGLE_BUTTON_PRESSED_CHANGED";