f35b266aa621d10d05a4293de15828ceab656685
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / editors / NumberEditorFactory.as
1 package net.systemeD.potlatch2.mapfeatures.editors {
2
3     import net.systemeD.halcyon.connection.*;
4     import net.systemeD.potlatch2.mapfeatures.*;
5     import flash.display.*;
6
7         public class NumberEditorFactory extends SingleTagEditorFactory {
8         private var _minimum:Number;
9         private var _maximum:Number;
10         private var _stepSize:Number;
11             private var _notPresentText:String;
12
13         public function NumberEditorFactory(inputXML:XML) {
14             super(inputXML);
15             _minimum = parseFloat(inputXML.hasOwnProperty("@minimum") ? String(inputXML.@minimum) : "0");
16             _maximum = parseFloat(inputXML.hasOwnProperty("@maximum") ? String(inputXML.@maximum) : "100");
17             _stepSize = parseFloat(inputXML.hasOwnProperty("@stepSize") ? String(inputXML.@stepSize) : "1");
18             _notPresentText = inputXML.hasOwnProperty("@absenceText") ? String(inputXML.@absenceText) : "Unset";
19         }
20         
21         override protected function createSingleTagEditor():SingleTagEditor {
22             return new NumberEditor();
23         }
24         
25         public function get minimum():Number { return _minimum; }
26         public function get maximum():Number { return _maximum; }
27         public function get stepSize():Number { return _stepSize; }
28         public function get notPresentText():String { return _notPresentText; }
29     }
30
31 }
32
33