categories of additional tags for roads
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / EditorFactory.as
1 package net.systemeD.potlatch2.mapfeatures {
2
3     import net.systemeD.halcyon.connection.*;
4     import net.systemeD.potlatch2.mapfeatures.editors.*;
5     import flash.display.*;
6
7
8         public class EditorFactory {
9             private static const PRIORITY_HIGHEST:uint = 10;
10             private static const PRIORITY_HIGH:uint = 8;
11             private static const PRIORITY_NORMAL:uint = 5;
12             private static const PRIORITY_LOW:uint = 2;
13             private static const PRIORITY_LOWEST:uint = 0;
14         
15         public static function createFactory(inputType:String, inputXML:XML):EditorFactory {
16             switch ( inputType ) {
17             
18             case "freetext": return new FreeTextEditorFactory(inputXML);
19             case "choice": return new ChoiceEditorFactory(inputXML);
20             case "speed": return new SpeedEditorFactory(inputXML);
21             
22             }
23             
24             return null;
25         }
26
27         public static function getPriority(priority:String):uint {
28             switch ( priority ) {
29             case "highest": return PRIORITY_HIGHEST;
30             case "high": return PRIORITY_HIGHEST;
31             case "normal": return PRIORITY_NORMAL;
32             case "low": return PRIORITY_LOW;
33             case "lowest": return PRIORITY_LOWEST;
34             default: return PRIORITY_NORMAL;
35             }
36         }
37         
38         public var presence:Presence = Presence.getPresence("onTagMatch");
39         public var sortOrder:uint = PRIORITY_NORMAL;
40         public var category:String = "Standard";
41         
42         private var _name:String;
43         private var _description:String;
44         
45         public function EditorFactory(inputXML:XML) {
46             _name = String(inputXML.@name);
47             _description = String(inputXML.@description);
48             category = String(inputXML.@category);
49         }
50         
51         public function areTagsMatching(entity:Entity):Boolean {
52             return true;
53         }
54
55         public function createEditorInstance(entity:Entity):DisplayObject {
56             return null;
57         }
58         
59         public function get name():String {
60             return _name;
61         }
62
63         public function get description():String {
64             return _description;
65         }
66     }
67
68 }
69
70