Author: ygrego Date: 2015-04-22 07:59:36 +0000 (Wed, 22 Apr 2015) New Revision: 1242 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1242 Log: Addition of a setter and getter for method "onIpAdressChange". And also the following methods: "addEventlistener", "removeEventListener", "_fireEvent". The properties "_callbacks", "_eventManager" and "_listeners" have been added. The property "configuration" is instanciated into method "init". Modified: oipf/js/impl/ConfigurationObject.js Modified: oipf/js/impl/ConfigurationObject.js =================================================================== --- oipf/js/impl/ConfigurationObject.js 2015-04-21 15:46:59 UTC (rev 1241) +++ oipf/js/impl/ConfigurationObject.js 2015-04-22 07:59:36 UTC (rev 1242) @@ -22,12 +22,16 @@ localSystem: null, init : function(){ + this._listeners = {}; + this._callbacks = {}; + this._eventManager = new EventManager(); var idTypes = new IntegerCollection(12,11); var tunerTNT = new Tuner(idTypes); var tuners = new TunerCollection(tunerTNT); var masterOutput = new AVOutput("master", "both", true); var outputs = new AVOutputCollection(masterOutput); this.localSystem = new LocalSystem(tuners, outputs); + this.configuration = new Configuration(); }, /* @@ -36,8 +40,24 @@ * is called with two arguments (NetworkInterface)item and (String)ipAddress. The ipAddress may have the value undefined if a previously assigned address has been * lost. * */ - onIpAddressChange: function(item, ipAddress) { + get onIpAddressChange() { + return this._getCallback("IpAddressChange"); + }, + set onIpAddressChange(callback) { + this._setCallback("IpAddressChange", callback); + }, + + addEventListener: function(type, listener) { + this._eventManager.addEventListener(type, listener, this); + }, + + _fireEvent: function(event) { + this._eventManager.fireEvent(event, this); + }, + + removeEventListener: function(type, listener) { + this._eventManager.removeEventListener(type, listener, this); } });
participants (1)
-
ygregoï¼ users.nuiton.org