Changeset 423 for gssim_ui/branches


Ignore:
Timestamp:
08/21/12 12:53:20 (13 years ago)
Author:
mcichenski
Message:
 
Location:
gssim_ui/branches/vine/gssimstudio/src/web/ui/flex
Files:
3 edited

Legend:

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

    r22 r423  
    1515                public var error:String; 
    1616                public var allocationList:ArrayCollection; 
     17                public var imageFileList:ArrayCollection; 
    1718        } 
    1819} 
  • gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/app/gssim/gssimstudio/editor/gssim/editors/archive/ExperimentStatisticsWindow.mxml

    r420 r423  
    1717                import gssim.gssimstudio.editor.gssim.topology.file.topologyReader; 
    1818                 
     19                import mx.collections.ArrayCollection; 
    1920                import mx.controls.Alert; 
     21                import mx.controls.Image; 
    2022                import mx.events.FlexEvent; 
    2123                import mx.events.IndexChangedEvent; 
     
    5557                        //ganntChart.addChild(gannt); 
    5658                         
    57                         gannt.service.getImageURLs(i); 
     59                        parentApplication.addModelUpdatedSingleCallbacks( 
     60                                gannt.service.getImageURLs(i), initImgGannt); 
    5861                } 
    5962                 
     
    7174                        var r : topologyReader = new topologyReader(parentApplication.topologyEditor.objectCanvas, false); 
    7275                        r.readFromBinary(parentApplication.gsSimStudioModel.currentExperimentNetworkTopology); 
     76                } 
     77                 
     78                public function initImgGannt(event : ResultEvent) : void 
     79                { 
     80                        var expId : int = (experiment != null ? experiment.PK : -1); 
     81                        var array : ArrayCollection = parentApplication.gsSimStudioModel.ganntChartComponents['' + expId].imageFileList; 
     82                        for (var j : Number = 0; j < array.length; j++) 
     83                        { 
     84                                //for (var i : Number = 0; i < 5; i++) 
     85                                { 
     86                                        var img : Image = new Image(); 
     87                                        img.source = array[j].fileAccessUrl; 
     88                                        img.width = 500; 
     89                                        img.height = 500; 
     90                                        mimg.addImage(img); 
     91                                } 
     92                                //mimg.addRow(); 
     93                        } 
     94                        nav.container = mimg; 
    7395                } 
    7496 
  • gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor/GanntChart.java

    r422 r423  
    154154            } 
    155155 
    156             //String fileDownloadServletUrl = FileDownloadServlet.getResourceUrl(); 
    157  
    158             for (FileLocation fileLocation : fileLocationList) { 
    159  
     156            ServletContext servletContext = FlexContext.getServletContext(); 
     157             
     158            for (FileLocation fileLocation : fileLocationList) {                 
    160159                HashMap<String, String> fileLocationItem = new HashMap<String, String>(); 
    161160                fileLocationItemList.add(fileLocationItem); 
     
    194193                fileLocationItem.put("folderUrl", folderLocation.getUrl()); 
    195194                 
    196                 // Download url 
    197                 if (fileType.equals(FileType.FILE)) { 
    198                     //fileLocationItem.put("fileDownloadUrl", FileDownloadServlet.getResourceUrlForFileLocation(fileLocation, false)); 
     195                String contentType = servletContext.getMimeType(fileLocation.getFileName().toLowerCase()); 
     196                String openUrl = null; 
     197                if (contentType != null) { 
     198                    openUrl = VineFlexUtilClass.getURL(fileLocation, contentType); 
     199                } else { 
     200                    openUrl = VineFlexUtilClass.getDownloadURL(fileLocation); 
    199201                } 
     202                fileLocationItem.put("fileAccessUrl", openUrl); 
    200203            } 
    201204 
Note: See TracChangeset for help on using the changeset viewer.