Packagenet.systemeD.potlatch2.mapfeatures
Classpublic class EditorFactory
SubclassesRelationMemberEditorFactory, SingleTagEditorFactory

Instantiates specific editing controls such as textboxes and speed limit selectors depending on the tags of a given entity. This class has child classes that instantiate the appropriate editors correctly.



Public Properties
 PropertyDefined by
  category : String = "Standard"
Default category: "Standard"
EditorFactory
  description : String
[read-only] The label given to the edited field, as defined in map features XML.
EditorFactory
  name : String
[read-only] The name of the field/tag/edit control, as defined in map features XML.
EditorFactory
  presence : Presence
Default Presence behaviour: onTagMatch
EditorFactory
  sortOrder : uint = 5
Default sorting: PRIORITY_NORMAL
EditorFactory
Public Methods
 MethodDefined by
  
EditorFactory(inputXML:XML)
The default EditorFactory extracts name, description and category from the provided map features XML subtree.
EditorFactory
  
areTagsMatching(entity:Entity):Boolean
Whether the tags on an entity correspond to those for the edit control.
EditorFactory
  
createEditorInstance(entity:Entity):DisplayObject
A subclass must provide an actual edit control.
EditorFactory
  
createFactory(inputType:String, inputXML:XML):EditorFactory
[static] Returns a specific subclass of EditorFactory as appropriate for the type: "freetext", "checkbox", "choice", "slider", "number", "speed", "route", "turn".
EditorFactory
  
getPriority(priority:String):uint
[static] Translates a priority string ("highest") to a const (PRIORITY_HIGHEST).
EditorFactory
Property detail
categoryproperty
public var category:String = "Standard"

Default category: "Standard"

descriptionproperty 
description:String  [read-only]

The label given to the edited field, as defined in map features XML.

Implementation
    public function get description():String
nameproperty 
name:String  [read-only]

The name of the field/tag/edit control, as defined in map features XML.

Implementation
    public function get name():String
presenceproperty 
public var presence:Presence

Default Presence behaviour: onTagMatch

sortOrderproperty 
public var sortOrder:uint = 5

Default sorting: PRIORITY_NORMAL

Constructor detail
EditorFactory()constructor
public function EditorFactory(inputXML:XML)

The default EditorFactory extracts name, description and category from the provided map features XML subtree.

Parameters
inputXML:XML
Method detail
areTagsMatching()method
public function areTagsMatching(entity:Entity):Boolean

Whether the tags on an entity correspond to those for the edit control. By default, returns true - must be overriden by more useful behaviour.

Parameters
entity:Entity

Returns
Boolean
createEditorInstance()method 
public function createEditorInstance(entity:Entity):DisplayObject

A subclass must provide an actual edit control. This returns null.

Parameters
entity:Entity

Returns
DisplayObject
createFactory()method 
public static function createFactory(inputType:String, inputXML:XML):EditorFactory

Returns a specific subclass of EditorFactory as appropriate for the type: "freetext", "checkbox", "choice", "slider", "number", "speed", "route", "turn". Otherwise null.

Parameters
inputType:String
 
inputXML:XML

Returns
EditorFactory
getPriority()method 
public static function getPriority(priority:String):uint

Translates a priority string ("highest") to a const (PRIORITY_HIGHEST).

Parameters
priority:String

Returns
uint