Skin.as revision f15db56f74c632307d2cd8210cb4e883ac99d308
package com.yahoo.renderers
{
/**
* Rendering class responsible for programatic fills
*/
public class Skin extends Renderer
{
/**
* @inheritDoc
*/
private static var _styleClass:Class = SkinStyles;
/**
* Constructor
*/
public function Skin():void
{
super();
}
/**
* @inheritDoc
*/
override public function getStyleClass():Class
{
return _styleClass;
}
/**
* @private
* Storage for drawSkinFunction
*/
private var _drawSkinFunction:Function = defaultDrawSkinFunction;
/**
* Algorithm for drawing skin
*/
public function get drawSkinFunction():Function
{
return this._drawSkinFunction;
}
/**
* @private (setter)
*/
public function set drawSkinFunction(value:Function):void
{
this._drawSkinFunction = value;
}
//--------------------------------------
// Public Methods
//--------------------------------------
/**
* @inheritDoc
*/
override protected function render():void
{
}
/**
* @private
*/
public function defaultDrawSkinFunction():void
{
var props:Object = this.getStyles();
{
return;
}
if(props.borderColor == props.fillColor)
{
this.graphics.lineStyle(0, 0, 0);
}
else
{
}
if(props.fillType != "linear" && props.fillType != "radial")
{
}
else
{
this.graphics.beginGradientFill(props.fillType, props.colors, props.alphas, props.ratios, props.matrix, props.spreadMethod, props.interpolationMethod, props.focalPointRatio);
}
this.graphics.drawRect(props.borderWidth * 0.5, props.borderWidth * 0.5, this.width - Number(props.borderWidth), this.height - Number(props.borderWidth));
}
}
}