The branch now loads maps again. Lots of messy code; most of the VectorLayer stuff...
[potlatch2.git] / net / systemeD / potlatch2 / BackgroundSelector.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <mx:VBox
3         xmlns:mx="http://www.adobe.com/2006/mxml"
4         paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
5         horizontalAlign="left" backgroundColor="white" borderStyle="inset">
6         
7         <mx:List width="100%" height="100%" id="background"
8                         labelField="name"
9                         change="Application.application.bgButton.close(); Imagery.instance().setBackground(background.selectedItem);"
10                 dataProvider="{Imagery.instance().getAvailableImagery()}"
11                 rowCount="{Imagery.instance().getAvailableImagery().length}"/>
12         <mx:HBox>
13         <mx:CheckBox width="100%" label="Dim" selected="{Application.application.theMap.getDimming()}" id="dim"
14             change="setDimming(dim.selected)" />
15         <mx:CheckBox width="100%" label="Sharpen" selected="{Application.application.theMap.getSharpen()}" id="sharpen"
16             change="setSharpen(sharpen.selected)" />
17         </mx:HBox>
18
19         <mx:HBox>
20         <mx:Button label="Edit..." click="Application.application.bgButton.close(); new BackgroundDialog().init('Background imagery',background,Imagery.instance());" />
21         <mx:Button label="Vector file..." click="Application.application.bgButton.close(); " />
22         </mx:HBox>
23
24         <mx:Script><![CDATA[
25                 // >>>> REFACTOR: vector file button was click="Application.application.bgButton.close(); new VectorSourceDialog().init();" but that's amazingly broken -->
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                 public function setDimming(v:Boolean):void {
36                         Application.application.theMap.setDimming(dim.selected);
37                         Application.application.yahoo.alpha = dim.selected ? 0.5 : 1;
38                         var obj:SharedObject=SharedObject.getLocal("user_state");
39                         obj.setProperty('background_dim',v);
40                         obj.flush();
41                 }
42                 public function setSharpen(v:Boolean):void {
43                         Application.application.theMap.setSharpen(sharpen.selected);
44                         var obj:SharedObject=SharedObject.getLocal("user_state");
45                         obj.setProperty('background_sharpen',v);
46                         obj.flush();
47                 }
48     ]]></mx:Script>     
49 </mx:VBox>
50