+ /**
+ * Set (or edit) the specified field value
+ * @param inField Field to set
+ * @param inValue value to set
+ * @param inUndo true if undo operation, false otherwise
+ */
+ public void setFieldValue(Field inField, String inValue, boolean inUndo)
+ {
+ // See if this data point already has this field
+ int fieldIndex = _fieldList.getFieldIndex(inField);
+ // Add to field list if necessary
+ if (fieldIndex < 0)
+ {
+ // If value is empty & field doesn't exist then do nothing
+ if (inValue == null || inValue.equals(""))
+ {
+ return;
+ }
+ // value isn't empty so extend field list
+ fieldIndex = _fieldList.extendList(inField);
+ }
+ // Extend array of field values if necessary
+ if (fieldIndex >= _fieldValues.length)
+ {
+ resizeValueArray(fieldIndex);
+ }
+ // Set field value in array
+ _fieldValues[fieldIndex] = inValue;
+ // Increment edit count on all field edits except segment
+ if (inField != Field.NEW_SEGMENT) {
+ setModified(inUndo);
+ }
+ // Change Coordinate, Altitude, Name or Timestamp fields after edit
+ if (_altitude != null && _altitude.getFormat() != Altitude.Format.NO_FORMAT) {
+ // Altitude already present so reuse format
+ parseFields(inField, _altitude.getFormat());
+ }
+ else {
+ // use default altitude format from config
+ parseFields(inField, Config.getConfigBoolean(Config.KEY_METRIC_UNITS)?Altitude.Format.METRES:Altitude.Format.FEET);
+ }
+ }
+
+ /**
+ * Either increment or decrement the modify count, depending on whether it's an undo or not
+ * @param inUndo true for undo, false otherwise
+ */
+ public void setModified(boolean inUndo)
+ {
+ if (!inUndo) {
+ _modifyCount++;
+ }
+ else {
+ _modifyCount--;
+ }
+ }
+
+ /**
+ * @return field list for this point
+ */
+ public FieldList getFieldList()
+ {
+ return _fieldList;
+ }
+
+ /** @param inFlag true for start of track segment */
+ public void setSegmentStart(boolean inFlag)
+ {
+ setFieldValue(Field.NEW_SEGMENT, inFlag?"1":null, false);
+ }
+
+ /**
+ * Mark the point for deletion
+ * @param inFlag true to delete, false to keep
+ */
+ public void setMarkedForDeletion(boolean inFlag) {
+ _markedForDeletion = inFlag;
+ }
+
+ /** @return latitude */