branch develop-2.x updated (bc41579 -> daf97f5)
This is an automated email from the git hooks/post-receive script. New change to branch develop-2.x in repository jaxx. See https://gitlab.nuiton.org/nuiton/jaxx.git from bc41579 [jgitflow-maven-plugin]Updating develop poms back to pre merge state new daf97f5 Error in DMD gis editor, minutes are not ok (fixes #4128) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit daf97f5ecef5e082073b4a88111e72413a9f25f3 Author: Tony CHEMIT <dev@tchemit.fr> Date: Wed Jan 18 14:08:48 2017 +0100 Error in DMD gis editor, minutes are not ok (fixes #4128) Summary of changes: .../jaxx/widgets/gis/DmdCoordinateConverter.java | 5 ++++- .../widgets/gis/MaskFormatterFromConverter.java | 21 +++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-2.x in repository jaxx. See https://gitlab.nuiton.org/nuiton/jaxx.git commit daf97f5ecef5e082073b4a88111e72413a9f25f3 Author: Tony CHEMIT <dev@tchemit.fr> Date: Wed Jan 18 14:08:48 2017 +0100 Error in DMD gis editor, minutes are not ok (fixes #4128) --- .../jaxx/widgets/gis/DmdCoordinateConverter.java | 5 ++++- .../widgets/gis/MaskFormatterFromConverter.java | 21 +++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/jaxx-widgets-gis/src/main/java/org/nuiton/jaxx/widgets/gis/DmdCoordinateConverter.java b/jaxx-widgets-gis/src/main/java/org/nuiton/jaxx/widgets/gis/DmdCoordinateConverter.java index 963f205..d997208 100644 --- a/jaxx-widgets-gis/src/main/java/org/nuiton/jaxx/widgets/gis/DmdCoordinateConverter.java +++ b/jaxx-widgets-gis/src/main/java/org/nuiton/jaxx/widgets/gis/DmdCoordinateConverter.java @@ -102,6 +102,9 @@ public class DmdCoordinateConverter implements NuitonConverter<DmdCoordinate> { Integer degre = degresStr.isEmpty() || "-".equals(degresStr) ? null : Math.abs(Integer.valueOf(degresStr)); Integer minutes = minutesStr.isEmpty() ? null : Integer.valueOf(minutesStr); + if (minutesStr.length() == 1 && minutes != null && minutes > 0) { + minutes *= 10; + } Integer decimal = decimalesStr.isEmpty() ? null : Integer.valueOf(decimalesStr); boolean signed = degresStr.contains("-"); @@ -133,7 +136,7 @@ public class DmdCoordinateConverter implements NuitonConverter<DmdCoordinate> { DmdCoordinate.COORDINATE_STRING_PATTERN, signStr, StringUtils.leftPad(degreeStr, forLongitude ? 3 : 2, nullValue.equals(degreeStr) ? ' ' : fillChar), - StringUtils.rightPad(minuteStr, 2, nullValue.equals(minuteStr) ? ' ' : fillChar), + nullValue.equals(minuteStr) ? StringUtils.rightPad(minuteStr, 2, ' ') : StringUtils.leftPad(minuteStr, 2, fillChar), StringUtils.rightPad(decimalStr, 2, nullValue.equals(decimalStr) ? ' ' : fillChar)); } } diff --git a/jaxx-widgets-gis/src/main/java/org/nuiton/jaxx/widgets/gis/MaskFormatterFromConverter.java b/jaxx-widgets-gis/src/main/java/org/nuiton/jaxx/widgets/gis/MaskFormatterFromConverter.java index c5628d0..94c87af 100644 --- a/jaxx-widgets-gis/src/main/java/org/nuiton/jaxx/widgets/gis/MaskFormatterFromConverter.java +++ b/jaxx-widgets-gis/src/main/java/org/nuiton/jaxx/widgets/gis/MaskFormatterFromConverter.java @@ -23,6 +23,8 @@ package org.nuiton.jaxx.widgets.gis; */ import org.apache.commons.beanutils.Converter; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.swing.text.MaskFormatter; import java.text.ParseException; @@ -35,6 +37,9 @@ import java.text.ParseException; */ public class MaskFormatterFromConverter<O> extends MaskFormatter { + /** Logger */ + private static final Log log = LogFactory.getLog(MaskFormatterFromConverter.class); + private static final long serialVersionUID = 1L; private final Converter converter; @@ -48,8 +53,8 @@ public class MaskFormatterFromConverter<O> extends MaskFormatter { } protected MaskFormatterFromConverter(Class<O> type, - String pattern, - Converter converter) throws ParseException { + String pattern, + Converter converter) throws ParseException { super(pattern); this.type = type; this.converter = converter; @@ -57,12 +62,20 @@ public class MaskFormatterFromConverter<O> extends MaskFormatter { @Override public String valueToString(Object value) throws ParseException { - return (String) converter.convert(String.class, value); + String result = converter.convert(String.class, value); + if (log.isInfoEnabled()) { + log.info(value + " --> " + result); + } + return result; } @Override public Object stringToValue(String value) throws ParseException { - return converter.convert(type, value); + Object result = converter.convert(type, value); + if (log.isInfoEnabled()) { + log.info(value + " --> " + result); + } + return result; } protected Converter getConverter() { -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm