geopaparazzi/geopaparazzi — pull request #93 by mj10777 (2013-12-20 08:24:45+00:00)
Title: Vectorlabels

This is a prepared version to support labels for the Vector Labels
* everything has been prepared with the exception of the style and the filling and retrieving of a ComboxBox values

SpatialVectorTable
* already had the logic for collection the non-Geometry Fields and setting the first one as the default label
* had a function to retrieve this list [.getLabelList()]
* had a function to retrieve this selected Field [.getLabelField()]
* a new Function has been added to retrieve, if enabled, the selected field-name [.getSelectedLabelField()]
* internally it uses i_selected_label_index
* this is a 1 based index to store the used selected field
* 1=first field in the list, 2 the second etc
* if this field value is negative, then the user does not want any label shown
* the function will return and empty result
* if this field value is positive, then the user wants a label to be shown
* the function will return the filed name for the sql query

SpatialiteDatabaseHandler.buildGeometriesInBoundsQuery
* will call table.getSelectedLabelField()
* if the result is not empty, it will be added AFTER the geometry field to the sql

GeometryIterator
* 2 new functions have been added
* set_label_text(Stmt stmt)
* this will empty the 's_label' value
* if the statement has more than 1 column, it will fill 's_label'
* get_label_text()
* will return the value of 's_label', which may be empty
* next()
* has been adapted to call 'set_label_text(Stmt stmt)' AFTER the geometry has been read

GeopaparazziOverlay.drawFromSpatialite
* has been adapted to call '.get_label_text()'
* String s_label=geometryIterator.get_label_text();
* a placeholder has been prepared AFTER the geometry has been painted
* checking if 's_label' is not empty
* there the label can be painted
?DataPropertiesActivity
* have been adapted to call
* getLabelList() from SpatialVectorTable
* and set a '0' based integer value of the selected field
* even if the painting of the label is deactivated, the selected field will be retrieved
* in this way, the last selected field will not be lost if deactivated

TODO:
* add a CheckBox [show label yes/no]
* add a ComboBox with the non-geometry fields of this Table
* I am assuming that the selecting index of a ComboBox is '0' based
* add to style a '1' based label index
* i.e. add one to the result
* if CheckBox is not selected
* i_selected_label_index*= -1;
* adapt SpatialVectorTable.setStyle
* replace
* 'int i_style_selected_label_index=2;'
* with
* 'int i_style_selected_label_index=style.i_selected_label_index;'
* add the needed drawing logic in GeopaparazziOverlay.drawFromSpatialite inside the
* if (!s_label.equals(""))

With that the logic should be complete.