/* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org License: LGPL 2.1: http://www.gnu.org/licenses/lgpl.html Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) ************************************************************************ */ /* ************************************************************************ #module(ui_core) #require(qx.sys.Client) #load(qx.renderer.border.BorderObject) ************************************************************************ */ /*! Border implementation for qx.ui.core.Widget instances. */ qx.OO.defineClass("qx.renderer.border.Border", qx.core.Object, function(vWidth, vStyle, vColor) { qx.core.Object.call(this); this._themedEdges = {}; this._initCache(); if (qx.util.Validation.isValidNumber(vWidth)) { this.setWidth(vWidth); if (qx.util.Validation.isValidString(vStyle)) { this.setStyle(vStyle); } if (qx.util.Validation.isValid(vColor)) { this.setColor(vColor); } } }); qx.Class.enhancedCrossBrowserMode = true; qx.Proto._needsCompilationTop = true; qx.Proto._needsCompilationRight = true; qx.Proto._needsCompilationBottom = true; qx.Proto._needsCompilationLeft = true; /* --------------------------------------------------------------------------- PROPERTIES --------------------------------------------------------------------------- */ qx.OO.addProperty({ name : "topWidth", type : "number", defaultValue : 0, impl : "borderTopProperty" }); qx.OO.addProperty({ name : "rightWidth", type : "number", defaultValue : 0, impl : "borderRightProperty" }); qx.OO.addProperty({ name : "bottomWidth", type : "number", defaultValue : 0, impl : "borderBottomProperty" }); qx.OO.addProperty({ name : "leftWidth", type : "number", defaultValue : 0, impl : "borderLeftProperty" }); qx.OO.addProperty({ name : "topStyle", type : "string", defaultValue : "none", impl : "borderTopProperty" }); qx.OO.addProperty({ name : "rightStyle", type : "string", defaultValue : "none", impl : "borderRightProperty" }); qx.OO.addProperty({ name : "bottomStyle", type : "string", defaultValue : "none", impl : "borderBottomProperty" }); qx.OO.addProperty({ name : "leftStyle", type : "string", defaultValue : "none", impl : "borderLeftProperty" }); qx.OO.addProperty({ name : "topColor", impl : "borderTopProperty", type : "object", instance : "qx.renderer.color.Color", convert : qx.renderer.color.ColorCache }); qx.OO.addProperty({ name : "rightColor", impl : "borderRightProperty", type : "object", instance : "qx.renderer.color.Color", convert : qx.renderer.color.ColorCache }); qx.OO.addProperty({ name : "bottomColor", impl : "borderBottomProperty", type : "object", instance : "qx.renderer.color.Color", convert : qx.renderer.color.ColorCache }); qx.OO.addProperty({ name : "leftColor", impl : "borderLeftProperty", type : "object", instance : "qx.renderer.color.Color", convert : qx.renderer.color.ColorCache }); /* --------------------------------------------------------------------------- UTILITY --------------------------------------------------------------------------- */ qx.renderer.border.Border.fromString = function(vDefString) { var vBorder = new qx.renderer.border.Border; var vAllParts = vDefString.split(/\s+/); var vPart, vTemp; for (var i=0; i