// Decompiled by AS3 Sorcerer 6.78 // www.buraks.com/as3sorcerer…
- User
// Decompiled by AS3 Sorcerer 6.78 // www.buraks.com/as3sorcerer
//forms.TankWindowWithHeader
package forms { import base.DiscreteSprite; import alternativa.osgi.service.locale.ILocaleService; import controls.base.LabelBase; import controls.TankWindow; import flash.display.Bitmap; import alternativa.init.OSGi; import flash.text.TextFormat; import filters.Filters; import resources.windowheaders.background.BackgroundHeader;
public class TankWindowWithHeader extends DiscreteSprite { private static const HEADER_BACKGROUND_HEIGHT:int = 25; private static const HEADER_BACKGROUND_INNER_HEIGHT:int = 22; [Inject] public static var localeService:ILocaleService; private const GAP_11:int = 11; private var label:* = new LabelBase(); private var window:TankWindow; private var headerBackground:Bitmap; public function TankWindowWithHeader(_arg_1:String=null) { this.window = new TankWindow(); addChild(this.window); this.initHeaderStyle(); if (_arg_1 != null) { this.setHeader(_arg_1); }; } public static function createWindow(_arg_1:String, _arg_2:int=-1, _arg_3:int=-1):TankWindowWithHeader { var _local_4:TankWindowWithHeader = new TankWindowWithHeader(localeService.getText(_arg_1)); _local_4.width = _arg_2; _local_4.height = _arg_3; return (_local_4); } private function initHeaderStyle():void { this.label.filters = Filters.SHADOW_FILTERS; this.label.size = 16; this.label.color = 0xC0C0C0; this.label.bold = true; } private function setHeader(_arg_1:String):void { this.label.htmlText = _arg_1; if (this.label.width > this.label.height) { if ((this.label.width + (2 * this.GAP_11)) < BackgroundHeader.shortBackgroundHeader.width) { this.headerBackground = new Bitmap(BackgroundHeader.shortBackgroundHeader); } else { this.headerBackground = new Bitmap(BackgroundHeader.longBackgroundHeader); }; } else { this.headerBackground = new Bitmap(BackgroundHeader.verticalBackgroundHeader); }; addChild(this.headerBackground); addChild(this.label); this.resize(); } public function setHeaderId(_arg_1:String):void { this.setHeader(localeService.getText(_arg_1)); } override public function set width(_arg_1:Number):void { this.window.width = _arg_1; this.resize(); } override public function get width():Number { return (this.window.width); } override public function set height(_arg_1:Number):void { this.window.height = _arg_1; this.resize(); } override public function get height():Number { return (this.window.height); } private function resize():void { if (this.headerBackground != null) { if (this.label.width > this.label.height) { this.headerBackground.x = ((this.window.width - this.headerBackground.width) >> 1); this.headerBackground.y = -(HEADER_BACKGROUND_HEIGHT); this.label.x = ((this.window.width - this.label.width) >> 1); this.label.y = (5 - ((HEADER_BACKGROUND_INNER_HEIGHT + this.label.height) >> 1)); } else { this.headerBackground.x = -(HEADER_BACKGROUND_HEIGHT); this.headerBackground.y = ((this.window.height - this.headerBackground.height) >> 1); this.label.x = (5 - ((HEADER_BACKGROUND_INNER_HEIGHT + this.label.width) >> 1)); this.label.y = ((this.window.height - this.label.height) >> 1); }; }; } } - Assistant