diff options
Diffstat (limited to 'webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/type')
3 files changed, 0 insertions, 454 deletions
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/type/Range.js b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/type/Range.js deleted file mode 100644 index 0a26c78c1c..0000000000 --- a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/type/Range.js +++ /dev/null @@ -1,89 +0,0 @@ -/* ************************************************************************ - - qooxdoo - the new era of web development - - http://qooxdoo.org - - Copyright: - 2004-2007 1&1 Internet AG, Germany, http://www.1and1.org - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Sebastian Werner (wpbasti) - * Andreas Ecker (ecker) - -************************************************************************ */ - -/* ************************************************************************ - - -************************************************************************ */ - -/** - * This manager is used by all objects which needs ranges like qx.ui.form.Spinner, ... - * - * @event change {qx.event.type.Event} - */ -qx.OO.defineClass("qx.type.Range", qx.core.Target, -function() { - qx.core.Target.call(this); -}); - -/** current value of the Range object */ -qx.OO.addProperty({ name : "value", type : "number", defaultValue : 0 }); - -/** minimal value of the Range object */ -qx.OO.addProperty({ name : "min", type : "number", defaultValue : 0 }); - -/** maximal value of the Range object */ -qx.OO.addProperty({ name : "max", type : "number", defaultValue : 100 }); - -/** Step size for increments/decrements of the value property */ -qx.OO.addProperty({ name : "step", type : "number", defaultValue : 1 }); - -qx.Proto._checkValue = function(propValue) { - return Math.max(this.getMin(), Math.min(this.getMax(), Math.floor(propValue))); -} - -qx.Proto._modifyValue = function(propValue, propOldValue, propData) -{ - if (this.hasEventListeners("change")) { - this.dispatchEvent(new qx.event.type.Event("change"), true); - } - - return true; -} - -qx.Proto._checkMax = function(propValue) { - return Math.floor(propValue); -} - -qx.Proto._modifyMax = function(propValue, propOldValue, propData) -{ - this.setValue(Math.min(this.getValue(), propValue)); - - if (this.hasEventListeners("change")) { - this.dispatchEvent(new qx.event.type.Event("change"), true); - } - - return true; -} - -qx.Proto._checkMin = function(propValue) { - return Math.floor(propValue); -} - -qx.Proto._modifyMin = function(propValue, propOldValue, propData) -{ - this.setValue(Math.max(this.getValue(), propValue)); - - if (this.hasEventListeners("change")) { - this.dispatchEvent(new qx.event.type.Event("change"), true); - } - - return true; -} diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/type/Selection.js b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/type/Selection.js deleted file mode 100644 index e4025bec42..0000000000 --- a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/type/Selection.js +++ /dev/null @@ -1,180 +0,0 @@ -/* ************************************************************************ - - qooxdoo - the new era of web development - - http://qooxdoo.org - - Copyright: - 2004-2007 1&1 Internet AG, Germany, http://www.1and1.org - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Sebastian Werner (wpbasti) - * Andreas Ecker (ecker) - -************************************************************************ */ - -/* ************************************************************************ - - - -************************************************************************ */ - -/** - * Helper for qx.manager.selection.SelectionManager, contains data for selections - * - * @param vManager {Object} a class which implements a getItemHashCode(oItem) method - */ -qx.OO.defineClass("qx.type.Selection", qx.core.Object, -function(vManager) -{ - qx.core.Object.call(this); - - this._manager = vManager; - this.removeAll(); -}); - - - - - -/* ---------------------------------------------------------------------------- - USER METHODS ---------------------------------------------------------------------------- -*/ - -/** - * Add an item to the selection - * - * @param oItem {var} item to add - */ -qx.Proto.add = function(oItem) { - this._storage[this.getItemHashCode(oItem)] = oItem; -}; - - -/** - * Remove an item from the selection - * - * @param oItem {var} item to remove - */ -qx.Proto.remove = function(oItem) { - delete this._storage[this.getItemHashCode(oItem)]; -}; - - -/** - * Remove all items from the selection - */ -qx.Proto.removeAll = function() { - this._storage = {}; -}; - - -/** - * Check whether the selection contains a given item - * - * @param oItem {var} item to check for - * @return {Boolean} whether the selection contains the item - */ -qx.Proto.contains = function(oItem) { - return this.getItemHashCode(oItem) in this._storage; -}; - - -/** - * Convert selection to an array - * - * @return {Array} array representation of the selection - */ -qx.Proto.toArray = function() -{ - var res = []; - - for (var key in this._storage) { - res.push(this._storage[key]); - } - - return res; -}; - - -/** - * Return first element of the Selection - * - * @return {var} first item of the selection - */ -qx.Proto.getFirst = function() -{ - for (var key in this._storage) { - return this._storage[key]; - } -} - - -/** - * Get a string representation of the Selection. The return value can be used to compare selections. - * - * @return {String} string representation of the Selection - */ -qx.Proto.getChangeValue = function() -{ - var sb = []; - - for (var hc in this._storage) { - sb.push(hc); - } - - sb.sort(); - return sb.join(";"); -}; - - -/** - * Compute a hash code for an item using the manager - * - * @param oItem {var} the item - * @return {var} unique hash code for the item - */ -qx.Proto.getItemHashCode = function(oItem) { - return this._manager.getItemHashCode(oItem); -}; - - -/** - * Whether the selection is empty - * - * @return {Boolean} whether the selection is empty - */ -qx.Proto.isEmpty = function() { - return qx.lang.Object.isEmpty(this._storage); -}; - - - - -/* ---------------------------------------------------------------------------- - DISPOSER ---------------------------------------------------------------------------- -*/ - -/** - * Destructor - */ -qx.Proto.dispose = function() -{ - if (this.getDisposed()) { - return; - } - - this._storage = null; - this._manager = null; - - qx.core.Object.prototype.dispose.call(this); -};
\ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/type/Version.js b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/type/Version.js deleted file mode 100755 index 01ffc708db..0000000000 --- a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/type/Version.js +++ /dev/null @@ -1,185 +0,0 @@ -/* ************************************************************************ - - qooxdoo - the new era of web development - - http://qooxdoo.org - - Copyright: - 2004-2007 1&1 Internet AG, Germany, http://www.1and1.org - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the qooxdoo top-level directory for details - - Authors: - * Sebastian Werner (wpbasti) - * Andreas Ecker (ecker) - ________________________________________________________________________ - - This class contains code based on the following work: - - SWFObject: Javascript Flash Player detection and embed script - http://blog.deconcept.com/swfobject/ - Version: 1.4.4 - - Copyright: - 2006 Geoff Stearns - - License: - MIT: http://www.opensource.org/licenses/mit-license.php - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - Authors: - * Geoff Stearns (geoff@deconcept.com) - -************************************************************************ */ - -/* ************************************************************************ - - -************************************************************************ */ - -/** - * Generic handling of version numbers based on a string representation of - * major, minor and revision flags. A incoming version object can be compared - * with the stored version string including checks to determine if this - * version is smaller than or identical to the one stored. - * - * This class contains code based on the following work:<br/> - * SWFObject: Javascript Flash Player detection and embed script<br/> - * http://blog.deconcept.com/swfobject/<br/> - * Version: 1.4.4 - * - * License:<br/> - * MIT: http://www.opensource.org/licenses/mit-license.php<br/> - * For more info, please see the corresponding source file. - * - * @param arrVersion {Array|String} array with three elements defining major, - * minor and revision number or an equivalent version string separated by '.' - */ -qx.OO.defineClass("qx.type.Version", qx.core.Object, -function(arrVersion) -{ - qx.core.Object.call(this); - - if (typeof arrVersion === "string") { - arrVersion = arrVersion.split("."); - } - - this._major = parseInt(arrVersion[0]) || 0; - this._minor = parseInt(arrVersion[1]) || 0; - this._rev = parseInt(arrVersion[2]) || 0; -}); - - - - -/* ---------------------------------------------------------------------------- - DATA FIELDS ---------------------------------------------------------------------------- -*/ - -qx.Proto._major = 0; -qx.Proto._minor = 0; -qx.Proto._rev = 0; - - - - - -/* ---------------------------------------------------------------------------- - USER VERSION ACCESS ---------------------------------------------------------------------------- -*/ - -/** - * Comapres the Version with another version number. - * Returns true if this version instance has a bigger version number - * - * @param fv {qx.type.Version} Version number to compare with - * @return {Boolean} whether the version instance has a bigger version numbers. - */ -qx.Proto.versionIsValid = function(fv) -{ - if (this.getMajor() < fv.getMajor()) return false; - if (this.getMajor() > fv.getMajor()) return true; - - if (this.getMinor() < fv.getMinor()) return false; - if (this.getMinor() > fv.getMinor()) return true; - - if (this.getRev() < fv.getRev()) return false; - - return true; -}; - - -/** - * Return major version number - * - * @return {String|Integer} major version number - */ -qx.Proto.getMajor = function() { - return this._major; -}; - - -/** - * Return minor version number - * - * @return {String|Integer} minor version number - */ -qx.Proto.getMinor = function() { - return this._minor; -}; - - -/** - * Return revision number - * - * @return {String|Integer} revision number - */ -qx.Proto.getRev = function() { - return this._rev; -}; - - - - - -/* ---------------------------------------------------------------------------- - DISPOSER ---------------------------------------------------------------------------- -*/ - -/** Destructor */ -qx.Proto.dispose = function() -{ - if (this.getDisposed()) { - return; - } - - this._major = this._minor = this._rev = null; - - qx.core.Object.prototype.dispose.call(this); -} |