📄 circleskin.as
字号:
package com.yahoo.astra.fl.charts.skins{ import fl.core.UIComponent; /** * A skin shaped like a circle with a single color. * * @author Josh Tynjala */ public class CircleSkin extends UIComponent implements IProgrammaticSkin { //-------------------------------------- // Constructor //-------------------------------------- /** * Constructor. */ public function CircleSkin() { super(); } //-------------------------------------- // Properties //-------------------------------------- /** * @private * Storage for the fillColor property. */ private var _fillColor:uint = 0x000000; /** * @copy com.yahoo.astra.fl.charts.skins.IProgrammaticSkin#fillColor */ public function get fillColor():uint { return this._fillColor; } /** * @private */ public function set fillColor(value:uint):void { if(this._fillColor != value) { this._fillColor = value; this.invalidate(); } } //-------------------------------------- // Protected Methods //-------------------------------------- /** * @private */ override protected function draw():void { super.draw(); this.graphics.clear(); if(this.width == 0 || this.height == 0 || isNaN(this.width) || isNaN(this.height)) { return; } this.graphics.lineStyle(0, 0, 0); this.graphics.beginFill(this._fillColor, 1); this.graphics.drawCircle(this.width / 2, this.height / 2, Math.min(this.width, this.height) / 2); this.graphics.endFill(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -