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