File: /home/padewitte/projets/webcomponents/myscript-js/src/output/shape/abstractShapePrimitive.js
'use strict';
(function (scope) {
/**
* Abstract shape primitive
*
* @class AbstractShapePrimitive
* @param {Object} [obj]
* @constructor
*/
function AbstractShapePrimitive(obj) {
if (obj) {
this.type = obj.type;
this.beginDecoration = obj.beginDecoration;
this.beginTangentAngle = obj.beginTangentAngle;
this.endDecoration = obj.endDecoration;
this.endTangentAngle = obj.endTangentAngle;
}
}
/**
* Get type
*
* @method getType
* @returns {String}
*/
AbstractShapePrimitive.prototype.getType = function () {
return this.type;
};
/**
* Is line
*
* @method isLine
* @returns {Boolean}
*/
AbstractShapePrimitive.prototype.isLine = function () {
return this.type === 'line';
};
/**
* Is ellipse
*
* @method isEllipse
* @returns {Boolean}
*/
AbstractShapePrimitive.prototype.isEllipse = function () {
return this.type === 'ellipse';
};
/**
* Has begin decoration
*
* @method hasBeginDecoration
* @returns {Boolean}
*/
AbstractShapePrimitive.prototype.hasBeginDecoration = function () {
return typeof this.beginDecoration !== 'undefined';
};
/**
* Has end decoration
*
* @method hasEndDecoration
* @returns {Boolean}
*/
AbstractShapePrimitive.prototype.hasEndDecoration = function () {
return typeof this.endDecoration !== 'undefined';
};
/**
* Get begin decoration
*
* @method getBeginDecoration
* @returns {String}
*/
AbstractShapePrimitive.prototype.getBeginDecoration = function () {
return this.beginDecoration;
};
/**
* Get end decoration
*
* @method getEndDecoration
* @returns {String}
*/
AbstractShapePrimitive.prototype.getEndDecoration = function () {
return this.endDecoration;
};
/**
* Get begin tangent angle
*
* @method getBeginTangentAngle
* @returns {Number}
*/
AbstractShapePrimitive.prototype.getBeginTangentAngle = function () {
return this.beginTangentAngle;
};
/**
* Get end tangent angle
*
* @method getEndTangentAngle
* @returns {Number}
*/
AbstractShapePrimitive.prototype.getEndTangentAngle = function () {
return this.endTangentAngle;
};
// Export
scope.AbstractShapePrimitive = AbstractShapePrimitive;
})(MyScript);