Ignore:
Timestamp:
08/26/11 12:20:13 (14 years ago)
Author:
mcichenski
Message:

gannt resize with window size change (manually - cannot use percentage values with scheduleViewer!)

hide zoom sliders when saving as PNG

Location:
gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/charts/GanntChart.mxml

    r36 r37  
    66        xmlns:c="gssim.gssimstudio.editor.charts.components.*" 
    77        xmlns:fx="http://ns.adobe.com/mxml/2009"   
    8         width="100%" creationComplete="init()" 
     8        width="100%" 
    99        height="100%" xmlns:charts="com.iwobanas.charts.*" xmlns:data="gssim.gssimstudio.editor.charting.data.*" xmlns:charts1="gssim.gssimstudio.editor.charts.*" xmlns:code="http://code.google.com/p/flexlib/"  
    1010> 
     
    5353                        private var zoom : Number; 
    5454                        [Bindable] 
    55                         private var scheduleViewerWidth : Number = 635; 
    56                         [Bindable] 
    57                         private var scheduleViewerHeight : Number = 4*50; 
     55                        public var scheduleViewerWidth : Number = 635; 
     56                        [Bindable] 
     57                        public var scheduleViewerHeight : Number = 4*50; 
    5858                        [Bindable] 
    5959                        private var dataProvider : IList; 
     
    8383                        { 
    8484                                date = new Date(); 
     85                                vZoomSliderGroup.visible = false; 
     86                                hZoomSliderGroup.visible = false; 
    8587                                var k : SaveToPNGCommand = new SaveToPNGCommand(fullChart); 
    8688                                k.execute(); 
     89                                vZoomSliderGroup.visible = true; 
     90                                hZoomSliderGroup.visible = true; 
    8791                        } 
    8892                         
    8993                        protected function initChart(event : ResultEvent) : void 
    9094                        { 
    91                                 Alert.show("initChart"); 
    9295                                initDataProvider(); 
    9396                                vZoom = 50; 
     
    100103                        protected function initFake() : void 
    101104                        { 
    102                                 Alert.show("fake!"); 
     105                                dataProvider = new ArrayCollection(); 
     106                                 
     107                                var data : ArrayCollection = new ArrayCollection(); 
     108                                data.addItem({unitId : 50, taskId : 1000, begin : new Date(2008, 4, 3), end : new Date(2008, 4, 10)}); 
     109                                 
     110                                startDate = new Date(3000, 0, 1); 
     111                                endDate = new Date(0); 
     112                                 
     113                                tempDataProvider = new ArrayCollection(); 
     114                                tempRowDataProvider = new ArrayCollection(); 
     115                                var resMap : Object = new Object(); 
     116                                for( var i : Number = 0; i < data.length; i++ ) 
     117                                { 
     118                                        if (!resMap.hasOwnProperty(data[i].unitId)) 
     119                                        { 
     120                                                resMap[data[i].unitId] = new ArrayCollection(); 
     121                                                tempRowDataProvider.addItem("Unit " + data[i].unitId); 
     122                                        } 
     123                                         
     124                                        var dummycolor : uint = 0x999999 + randomInt( 0x777777 ); 
     125                                         
     126                                        resMap[data[i].unitId].addItem(createColoredEntry(data[i].taskId, data[i].begin, data[i].end, dummycolor)); 
     127                                         
     128                                        if (data[i].begin < startDate) startDate = data[i].begin; 
     129                                        if (data[i].end > endDate) endDate = data[i].end; 
     130                                } 
     131                                 
     132                                for (var key : String in resMap) 
     133                                { 
     134                                        tempDataProvider.addItem(resMap[key]); 
     135                                } 
     136                                 
     137                                dataProvider = tempDataProvider; 
     138                                rowDataProvider = tempRowDataProvider; 
     139                                 
     140                                scheduleViewer.invalidateDisplayList(); 
     141                                this.validateNow(); 
     142                                rowsList.verticalScrollPosition = lastPosRowList; 
     143                                rowsList.selectedIndex = listIndex; 
     144                                 
    103145                        } 
    104146                         
     
    164206                                dataProvider = tempDataProvider; 
    165207                                rowDataProvider = tempRowDataProvider; 
    166                                  
    167                                 Alert.show("finished! " + startDate + " " + endDate); 
    168208                        } 
    169209                         
     
    178218                        /* end of copy */ 
    179219                         
    180                         protected function init():void 
    181                         { 
     220                        public function init():void 
     221                        { 
     222                                //scheduleViewer.percentHeight = 100; 
     223                                //scheduleViewer.percentWidth = 100; 
     224                                 
    182225                                listIndex = 0; 
    183226                                zoom = 500; 
     
    335378                                        <mx:List id="rowsList" width="135" height="{ scheduleViewerHeight }" 
    336379                                                         dataProvider="{ rowDataProvider }" rowHeight="{ scheduleViewer.rowHeight }" 
    337                                                          verticalAlign="middle" 
     380                                                         verticalAlign="middle" verticalScrollPolicy="off" 
    338381                                                         itemClick="rowsList_itemClickHandler(event)" selectable="true"> 
    339382                                                 
     
    380423                                                         
    381424                                                </s:Group> 
    382                                                 <s:HGroup width="100%"> 
     425                                                <s:HGroup width="100%" id="hZoomSliderGroup"> 
    383426                                                        <s:Label text="Zoom:" top="5"/> 
    384427                                                        <s:HSlider width="100%" id="zoomSlider" change="onZoom( zoomSlider.value );" liveDragging="true" 
     
    388431                                         
    389432                                </s:VGroup> 
    390                                 <s:VGroup width="60" height="100%"> 
     433                                <s:VGroup width="60" height="100%" id="vZoomSliderGroup"> 
    391434                                        <mx:Spacer height="{ timeline.height + (scheduleViewer.height - vZoomSlider.height) / 4 }"/> 
    392435                                        <mx:Label text="V Zoom"/> 
  • gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/gssim/editors/archive/ExperimentStatisticsWindow.mxml

    r27 r37  
    66                   title="{experiment.name} - {resourceManager.getString('ArchiveViewer', 'Details')}" 
    77                   xmlns:fx="http://ns.adobe.com/mxml/2009"  
    8                    width="600" height="400" 
     8                   width="600" height="450" 
    99                   xmlns:charts="gssim.gssimstudio.editor.charts.*" 
    1010                   xmlns:archive="gssim.gssimstudio.editor.gssim.editors.archive.*" 
     
    4747                        //parentApplication.bindSubmodel(viewer, 'model', parentApplication.gsSimStudioModel, 'resourceChartComponents', '' + i); 
    4848                         
    49                         var gannt : GanntChart = new GanntChart(); 
     49                        //var gannt : GanntChart = new GanntChart(); 
    5050                        gannt.expId = i; 
    5151                        gannt.expName = (experiment != null ? experiment.name : ""); 
    5252                        gannt.service = new VineRemoteObjectProxy(parentApplication.service, i); 
    53                         ganntChart.addChild(gannt); 
     53                        gannt.init(); 
     54                        //ganntChart.addChild(gannt); 
    5455                } 
    5556                 
     
    124125                        </mx:VBox> 
    125126                        <mx:VBox width="100%" height="100%" id="ganntChart" label="{resourceManager.getString('ArchiveViewer', 'Task')}"> 
     127                                <charts:GanntChart scheduleViewerHeight="{this.height - 250}" scheduleViewerWidth="{this.width - 250}" id="gannt" /> 
    126128                        </mx:VBox> 
    127129                        <!-- 
Note: See TracChangeset for help on using the changeset viewer.