more turn restriction stuff, and checkboxes, and a bunch of little fixes
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / editors / SingleTagEditorFactory.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 SingleTagEditorFactory extends EditorFactory {
8             private var tagKey:String;
9                 private var boxDirection:String;
10         
11         public function SingleTagEditorFactory(inputXML:XML) {
12             super(inputXML);
13             tagKey = inputXML.@key;
14                         boxDirection = inputXML.@layout=='horizontal' ? 'horizontal' : 'vertical';
15         }
16         
17         override public function areTagsMatching(entity:Entity):Boolean {
18             return entity.getTag(tagKey) != null;
19         }
20
21         public function get key():String {
22             return tagKey;
23         }
24         
25         public function get direction():String {
26             return boxDirection;
27         }
28         
29         override public function createEditorInstance(entity:Entity):DisplayObject {
30             var editor:SingleTagEditor = createSingleTagEditor();
31             editor.factory = this;
32             editor.entity = entity;
33             return editor;
34         }
35         
36         protected function createSingleTagEditor():SingleTagEditor {
37             return null;
38         }
39     }
40
41 }
42
43