graphics.js revision 09ae00ccf51dc05697a0d0f54341917314ab06d1
/**
* The Graphics widget provides an api for basic drawing operations.
*
* @module graphics
*/
var SETTER = "setter",
VALUE = "value",
VALUEFN = "valueFn",
READONLY = "readOnly",
STR = "string",
WRITE_ONCE = "writeOnce",
AttributeLite = function()
{
var host = this, // help compression
// Perf tweak - avoid creating event literals if not required.
host._ATTR_E_FACADE = {};
};
/**
* AttributeLite provides Attribute-like getters and setters for shape classes in the Graphics module. It provides a get/set API without the event infastructure.
*
* @class AttributeLite
* @constructor
*/
/**
* Initializes the attributes for a shape. If an attribute config is passed into the constructor of the host,
* the initial values will be overwritten.
*
* @method addAttrs
* @param {Object} cfg Optional object containing attributes key value pairs to be set.
*/
{
var host = this,
attr,
i,
fn,
for(i in attrConfig)
{
if(attrConfig.hasOwnProperty(i))
{
attr = attrConfig[i];
{
}
{
{
}
else
{
}
}
{
continue;
}
{
}
if(cfg.hasOwnProperty(i))
{
{
}
else
{
}
}
}
}
},
/**
* For a given item, returns the value of the property requested, or undefined if not found.
*
* @method get
* @param name {String} The name of the item
* @return {Any} The value of the supplied property.
*/
{
var host = this,
{
if(getter)
{
{
}
}
}
return null;
},
/**
* Sets the value of an attribute.
*
* @method set
* @param {String}|{Object} name The name of the attribute. Alternatively, an object of key value pairs can
* be passed in to set multiple attributes at once.
* @param {Any} value The value to set the attribute to. This value is ignored if an object is received as
* the name param.
*/
{
var i;
{
for(i in attr)
{
if(attr.hasOwnProperty(i))
{
}
}
}
else
{
}
},
/**
* @private
*/
{
var host = this,
args,
{
if(setter)
{
{
}
}
}
}
};