Changes between Initial Version and Version 1 of Es:TaggingPresets


Ignore:
Timestamp:
2011-05-19T08:46:04+02:00 (15 years ago)
Author:
ovruni
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Es:TaggingPresets

    v1 v1  
     1[[TranslatedPages(revision=1)]]
     2= Etiquetas Preestablecidas =
     3JOSM soporta etiquetas preestablecidas distribuidas. Esto es un archivo de configuración XML que describe una interfaz gráfica de usuario para ingresar etiquetas (o propiedades, anotaciones, a veces llamadas características del mapa). Los archivos XML se pueden colocar en cualquier lugar de la web o en los sistema de archivos local de usuarios. Preestablecidos pueden ser añadidos por los usuarios en una página central de [wiki:Presets Preestablecidos].
     4
     5= Instalación =
     6Cada usuario puede optar por añadir cualquier url (o nombre de archivo) en sus preferencias. Una dirección URL de ejemplo se incluye en el SVN de JOSM.
     7
     8[[Image(josm-preferences1.png)]]
     9
     10Después las fuentes se especifican (y después de un reinicio), las etiquetas preestablecidos se pueden seleccionar desde el [wiki:Es:Help/Menu/Presets menú predefinidos]. También se puede añadir a la barra de herramientas en Preferencias>[wiki:Es:Help/Preferences/Toolbar Personalización de la Barra de herramientas]
     11
     12== Ejemplo ==
     13Aquí está un ejemplo de cómo se ve:
     14
     15[[Image(tagging_screenshot.png)]]
     16
     17Y este es el código que crea el ejemplo:
     18{{{
     19<presets xmlns="http://josm.openstreetmap.de/tagging-preset-1.0">
     20  <item name="Highway">
     21    <label text="Inserting a highway in UK" />
     22
     23    <text key="name" text="Highway (e.g. M3)" />
     24    <combo key="highway" text="Type" values="major,minor" delete_if_empty="true" />
     25
     26    <!-- Highways are usually oneway -->
     27    <check key="oneway" text="Oneway" default="on" />
     28
     29    <!-- Always setting class=highway -->
     30    <key key="class" value="highway" />
     31  </item>
     32</presets>
     33}}}
     34
     35
     36== Descripción del Formato XML ==
     37
     38La descripción de las etiquetas preestablecidas está en un formato XML muy simple.
     39
     40=== Etiquetas ===
     41El prólogo del documento:
     42 '''<presets>'''::
     43   Has to be the main tag of the file. Supports following attributes
     44   * '''xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"'''
     45   * '''author''' - the name of the author
     46   * '''version''' - a version of the file
     47   * '''description''' (i18n) - description what the file contains
     48   * '''shortdescription''' (i18n) - short overview description
     49   * '''link''' (i18n) - web link to further details
     50Comments:
     51 '''<!-- this is an example comment -->'''::
     52  The document can contain embedded comments.
     53Menu creation:
     54 '''<group>'''::
     55   Used to group items in sub menus. ''name'' is required, ''icon'' is optional attribute.
     56 '''<item>'''::
     57   Every item is one annotation set to select from. ''name'' is required, ''icon'' is optional attribute.
     58 '''<separator/>'''::
     59   Insert a line separator into the menu.
     60Create instructions for the user:
     61 '''<label>'''::
     62   Labels are static texts for display. ''text'' is a required attribute.
     63 '''<optional>'''::
     64   Used to group some optional elements of an item. Possibly equivalent to <label text="Optional Attributes:"/>
     65 '''<space/>'''::
     66   Add some space (ie a newline) in the preset display. Possibly equivalent to <label text=" "/>
     67 '''<link>'''::
     68   Specify a web link for this feature or to anything else of use. The ''href'' attribute is required.
     69Attribute entry and selection dialog boxes:
     70 '''<text>'''::
     71   A text edit field to enter any arbitrary string from the user. ''key'' is mandatory, ''text'', ''default'' and ''required'' is optional
     72 '''<combo>'''::
     73   Displays a multiple choice combo box. ''key'' and ''values'' are mandatory and ''text'', ''default'', ''readonly'' and ''required'' is optional.
     74   If readonly is not set, combo boxes can be edited as if they were text fields (additional to the drop down menu). Readonly
     75   combo boxes can only contain one of the specified values.  (Warning '''Readonly does not work''' yet as indicated in #6156 and #409)
     76
     77 '''<multiselect>'''::
     78   Displays a list from which zero or more items can be chosen. ''key'' and ''values'' are mandatory, and ''text'', ''default'', ''delimiter'', and ''required'' are optional. The selected values will be concatenated with the specified delimiter (default: semicolon) and written to the tag value. If a tag value has already been set when the preset dialog is opened, the multiselect will attempt to mark the appropriate items in the list as select. If the tag value cannot be represented by a combination of choices in the list, then the list will be disabled so that the user cannot accidentally overwrite a custom value. In contrast to the "combo" element, the "multiselect" expects the list of values, descriptions etc. to use the specified delimiter, i.e. by default you will have to use a semicolon. You can specify delimiter="," but then a comma will also be used in the tag value.
     79 '''<check>'''::
     80   A checkbox which the user can only select or deselect. The ''key'' attribute is mandatory. ''text'', ''default'' and ''required'' is optional.
     81Set a key value pair:
     82 '''<key>'''::
     83   This tag will always set a key to a specific value. ''key'' is required and if ''value'' is present, the key will be set. If ''value'' attribute is ommited, the key is removed.
     84
     85=== Attributes ===
     86The attributes of the tags have the following meaning:
     87 '''name="a_name"'''::
     88   Specify a name for an item. This name will be used in the GUI to display the tagging preset.
     89 '''name_context="context"'''::
     90   Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
     91 '''type="data_type"'''::
     92   When specified, only objects of the given type will be changed at all by this tagging preset. Can be "node", "relation", "way", "closedway" or any comma separated combination of them.
     93 '''icon="iconname"'''::
     94   A name of an icon that is within any classpath in the subdirectory of /images/symbols. You can load plugin-jar's to provide those images as well. The image will be used as icon to display in the selection list and when adding the preset to the toolbar. The icon should be quadratic in size.
     95 '''key="some_key"'''::
     96   This specifies the property key that will be modified by the item.
     97 '''text="Any text"'''::
     98   The description, that will be displayed before (after in case of <check>) the gui element.
     99 '''text_context="context"'''::
     100   Translation context for text attribute to separate equals words with different meaning (not required for in-file translations).
     101 '''default="default_value"'''::
     102   The default value for the item. If not specified, the current value of the key is chosen as default (if applicable).
     103 '''delete_if_empty="true"'''::
     104   If the text (or combo) box is left empty, the key is removed instead inserting an key with empty value. Default is "false".
     105 '''values="entry1,entry2,entry3"'''::
     106   A list of entries (for the combo box and multiselect). The list has to be separated by commas (for the combo box) or by the specified delimiter (for the multiselect). If a value contains the delimiter, the delimiter may be escaped with a backslash. If a value contains a backslash, it must also be escaped with a backslash.
     107 '''values_context="context"'''::
     108   Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
     109 '''display_values="Entry1,Entry2,Entry3"'''::
     110   A list of entries that is displayed to the user. Must be the same number of entries as values and '''readonly''' must be true or not specified. For the delimiter character and escaping, see the remarks at ''values''.
     111 '''value="foobar"'''::
     112   Specify a value to be entered in the <key> tag.
     113 '''value_on="foobar"'''::
     114   Specify the true value to be entered in the <key> tag (default is "yes").
     115 '''value_off="foobar"'''::
     116   Specify the false value to be entered in the <key> tag (default is "no").
     117 '''readonly="true"'''::
     118   The combo box is readonly, which means that the user can only select an item in the list. (Warning '''Readonly does not work''' yet as indicated in #6156 and #409)
     119 '''use_last_as_default="true"'''::
     120   For combo boxes or text fields the last value is used as default.
     121 '''required="true"'''::
     122   Preset is not valid unless value for this key is entered. Used by PropertiesDialog to show list of presets for selected object.
     123
     124
     125To support translations, all textual elements may be used in translated form. E.g. "de.name" would represent the name in case German language support is loaded.
     126
     127=== Icon handling ===
     128There are 3 different ways to source icons:
     129
     130 * Icons distributed with JOSM can be entered directly with the path (relative to JOSM's internal image directory). Hunt through [http://josm.openstreetmap.de/svn/trunk/data/defaultpresets.xml this page] for the names of existing icons.
     131 * New icons can be directly referenced using a http-link. These are downloaded and cached internally.
     132 * Since JOSM version 2289 Zip-Files are supported.
     133  * The zip file must contain at least one file with extension xml.
     134  * Icon names and path are relative to the topmost zip directory.
     135  * If there are multiple XML files, a file with "preset" in the name is preferred (to allow packaging styles and presets in one archive).
     136
     137=== Relation presets ===
     138As of 14 Sept 2010 (version 3514) the use of presets for the type relation is perhaps a little unwieldy. This is how you apply a relation preset once you have created it:
     139 * use the "Create a new relation" button to start a new relation.
     140 * enter the "name" of the relation as a key/value pair. Close the edit window with the "OK" button. This skeletal relation will now act as a target for the preset to be applied.
     141 * highlite the new skeletal relation in the relation list by clicking on it. It will be found at the top of the relation list.
     142 * click on the "select the relation objects" button, noting there are zero objects in the relation so far.
     143 * now apply your relation preset. All the other fields in the relation will be applied by the preset. It is now ready for use.
     144Existing relations can be altered by selecting all objects in the relation and then applying the preset. Only the relation is altered - the key/value pairs in the ways and nodes are not touched.