4b339d0e115b70c3519d5eb60ab3ece6ba48397c
[potlatch2.git] / net / systemeD / potlatch2 / BackgroundSelector.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <mx:VBox
3         xmlns:fx="http://ns.adobe.com/mxml/2009"
4         xmlns:mx="library://ns.adobe.com/flex/mx"
5         paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
6         horizontalAlign="left" backgroundColor="white" borderStyle="inset">
7         
8         <mx:List width="100%" height="100%" id="background"
9                         labelField="name"
10                         change="FlexGlobals.topLevelApplication.bgButton.close(); Imagery.instance().setBackground(background.selectedItem);"
11                 dataProvider="{Imagery.instance().getAvailableImagery()}"
12                 rowCount="{Imagery.instance().getAvailableImagery().length}"/>
13         <mx:HBox>
14         <mx:CheckBox width="100%" label="Dim" selected="{application.theMap.getDimming()}" id="dim"
15             change="setDimming(dim.selected)" />
16         <mx:CheckBox width="100%" label="Sharpen" selected="{application.theMap.getSharpen()}" id="sharpen"
17             change="setSharpen(sharpen.selected)" />
18         </mx:HBox>
19
20         <mx:HBox>
21         <mx:Button id="editLabel" label="Edit..." click="FlexGlobals.topLevelApplication.bgButton.close(); new BackgroundDialog().init('Background imagery',background,Imagery.instance());" />
22         <mx:Button label="Vector file..." click="FlexGlobals.topLevelApplication.bgButton.close(); new VectorSourceDialog().init();" />
23         </mx:HBox>
24
25         <fx:Script><![CDATA[
26
27                 import net.systemeD.halcyon.*;
28                 import net.systemeD.halcyon.connection.*;
29                 import net.systemeD.potlatch2.*;
30                 import net.systemeD.potlatch2.collections.Imagery;
31                 import mx.core.*;
32                 import mx.collections.ArrayCollection;
33                 import mx.managers.PopUpManager;
34
35                 [Bindable] private var application:Object = FlexGlobals.topLevelApplication;
36
37                 public function setDimming(v:Boolean):void {
38                         FlexGlobals.topLevelApplication.theMap.setDimming(dim.selected);
39                         FlexGlobals.topLevelApplication.yahoo.alpha = dim.selected ? 0.5 : 1;
40                         var obj:SharedObject=SharedObject.getLocal("user_state");
41                         obj.setProperty('background_dim',v);
42                         obj.flush();
43                 }
44                 public function setSharpen(v:Boolean):void {
45                         FlexGlobals.topLevelApplication.theMap.setSharpen(sharpen.selected);
46                         var obj:SharedObject=SharedObject.getLocal("user_state");
47                         obj.setProperty('background_sharpen',v);
48                         obj.flush();
49                 }
50     ]]></fx:Script>
51 </mx:VBox>
52