CartesianCanvas.as revision f15db56f74c632307d2cd8210cb4e883ac99d308
0N/Apackage
0N/A{
0N/A import com.adobe.serialization.json.JSON;
0N/A import com.yahoo.renderers.*;
0N/A import com.yahoo.renderers.events.RendererEvent;
0N/A import com.yahoo.renderers.layout.*;
0N/A import com.yahoo.infographics.data.*;
0N/A import com.yahoo.infographics.cartesian.LineGraph;
0N/A import com.yahoo.infographics.axes.*;
0N/A import com.yahoo.infographics.styles.*;
0N/A import com.yahoo.util.YUIBridge;
0N/A import flash.events.Event;
0N/A
0N/A public class CartesianCanvas extends Application
0N/A {
0N/A /**
0N/A * Constructor
0N/A */
0N/A public function CartesianCanvas()
0N/A {
0N/A super();
0N/A this.setFlag("initBridge");
0N/A }
0N/A
0N/A /**
0N/A * @private
0N/A * Hash of class to be compiled into the swf.
0N/A * This also allows for the YUIBridge to create a
0N/A * class instance based on a one word string descriptor.
0N/A */
0N/A private var _compiledClasses:Object =
0N/A {
0N/A ChartDataProvider:ChartDataProvider,
0N/A NumericData:NumericData,
0N/A CategoryData:CategoryData,
0N/A TimeData:TimeData,
0N/A Axis:Axis,
0N/A LineGraph:LineGraph,
0N/A Container:Container,
0N/A BorderLayout:BorderLayout,
0N/A ILayoutStrategy:ILayoutStrategy,
0N/A HLayout:HLayout,
0N/A VLayout:VLayout,
0N/A HFlowLayout:HFlowLayout,
0N/A VFlowLayout:VFlowLayout,
0N/A LayerStack:LayerStack,
0N/A Skin:Skin,
0N/A ImageSkin:ImageSkin,
0N/A BorderContainer:BorderContainer
0N/A };
0N/A
0N/A /**
0N/A * @private
0N/A */
0N/A private var _defaultLayout:Class = LayerStack;
0N/A
0N/A /**
0N/A * @private (override)
0N/A */
0N/A override protected function getCompiledClasses():Object
0N/A {
0N/A return this._compiledClasses;
0N/A }
0N/A
0N/A /**
0N/A * @private (override)
0N/A */
0N/A override protected function render():void
0N/A {
0N/A if(this.checkFlag("initBridge"))
0N/A {
0N/A this._yuiBridge.addCallbacks({setStyle:this.setStyle});
0N/A }
0N/A super.render();
0N/A }
0N/A
0N/A /**
0N/A * @private (override)
0N/A */
0N/A override protected function parseFlashVars():void
0N/A {
0N/A super.parseFlashVars();
0N/A var inputLayout:String = "";
0N/A if(this.flashvars && this.flashvars.layout) inputLayout = this.flashvars.layout as String;
0N/A this.setAppLayout(inputLayout);
0N/A }
0N/A
0N/A /**
0N/A * @private
0N/A */
0N/A private function setAppLayout(value:String):void
0N/A {
0N/A var layoutClass:Class = this._compiledClasses.hasOwnProperty(value) ? this._compiledClasses[value] as Class : this._defaultLayout;
0N/A var layout:Object = new layoutClass();
0N/A if(layout is ILayoutStrategy) this.layout = layout as ILayoutStrategy;
0N/A }
0N/A }
0N/A}
0N/A