Index: lams_common/src/flash/org/lamsfoundation/lams/common/Config.as =================================================================== diff -u --- lams_common/src/flash/org/lamsfoundation/lams/common/Config.as (revision 0) +++ lams_common/src/flash/org/lamsfoundation/lams/common/Config.as (revision c40830be7545758efe68288de4e980bbdd498bff) @@ -0,0 +1,46 @@ +import org.lamsfoundation.lams.common.* +/** +* Stores configuration data for LAMS application +* @class Config +* @author DI +*/ +class Config { + + //Declarations + + //Application instance is stored as a static in the application class + private static var _instance:Config = null; + private var _className = 'Config'; + + //Constructor + private function Config() { + + } + + /** + * Retrieves an instance of the Config singleton + */ + public static function getInstance():Config{ + if(Config._instance == null){ + Config._instance = new Config(); + } + return Config._instance; + } + + /** + * Loads application configuration data for LAMS, can load from a URL or cookie + */ + function load(src:Object){ + if(typeof(src)=='string'{ + //load from URL otherwise + }else { + //load from config cookie + } + } + + + //Getters+Setters + function get className():String{ + return _className; + } +} \ No newline at end of file Index: lams_common/src/flash/org/lamsfoundation/lams/common/style/LFButtonSkin.as =================================================================== diff -u --- lams_common/src/flash/org/lamsfoundation/lams/common/style/LFButtonSkin.as (revision 0) +++ lams_common/src/flash/org/lamsfoundation/lams/common/style/LFButtonSkin.as (revision c40830be7545758efe68288de4e980bbdd498bff) @@ -0,0 +1,62 @@ +import mx.skins.RectBorder; +import mx.core.ext.UIObjectExtensions; +import org.lamsfoundation.lams.common.style.* + + +/** +* LFButtonSkin allows buttons to be customised further than setStyle allows. Essentially it overrides the skin behaviour of +* the button component and draws the various button states. +* @class LFButtonSkin +* @author DI +* +*/ +class LFButtonSkin extends RectBorder +{ + static var symbolName:String = "LFButtonSkin"; + static var symbolOwner:Object = LFButtonSkin; + private var styleObj:mx.styles.CSSStyleDeclaration; + private var themeManager:ThemeManager; + + function size():Void + { + var c:Number; // color + var borderStyle:String = getStyle("borderStyle"); + themeManager = ThemeManager.getInstance(); + styleObj = themeManager.getStyleObject('Button'); + + switch (borderStyle) { + case "falseup": + case "falserollover": + case "falsedisabled": + c = 0x7777FF; + break; + case "falsedown":0 + c = getStyle('lala',styleObj); + trace('****getting color c: ' + c); + break; + case "trueup": + case "truedown": + case "truerollover": + case "truedisabled": + c = 0xFF7777; + break; + } + + clear(); + var thickness = _parent.emphasized ? 2 : 0; + lineStyle(thickness, 0, 100); + beginFill(c, 100); + drawRect(0, 0, __width, __height); + endFill(); + } + + // required for skins + static function classConstruct():Boolean + { + UIObjectExtensions.Extensions(); + _global.skinRegistry["ButtonSkin"] = true; + return true; + } + static var classConstructed:Boolean = classConstruct(); + static var UIObjectExtensionsDependency = UIObjectExtensions; +} \ No newline at end of file