branch develop updated (99978f4 -> 48b4c2f)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository jaxx. See https://gitlab.nuiton.org/nuiton/jaxx.git from 99978f4 [jgitflow-maven-plugin]Updating develop poms back to pre merge state new 48b4c2f Error in DMD gis editor, minutes are not ok (fixes #4135) 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 48b4c2f0923d95ea374a2d4218aafc07dfecb180 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 #4135) Summary of changes: .../jaxx/widgets/gis/DmdCoordinateConverter.java | 5 ++++- .../widgets/gis/MaskFormatterFromConverter.java | 23 +++++++++++++++++----- 2 files changed, 22 insertions(+), 6 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 in repository jaxx. See https://gitlab.nuiton.org/nuiton/jaxx.git commit 48b4c2f0923d95ea374a2d4218aafc07dfecb180 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 #4135) --- .../jaxx/widgets/gis/DmdCoordinateConverter.java | 5 ++++- .../widgets/gis/MaskFormatterFromConverter.java | 23 +++++++++++++++++----- 2 files changed, 22 insertions(+), 6 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 ad54958..de4cf50 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 4fdb195..17aba78 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 @@ -2,9 +2,9 @@ package org.nuiton.jaxx.widgets.gis; /* * #%L - * JAXX :: Widgets Gis + * JAXX :: Widgets * %% - * Copyright (C) 2008 - 2017 CodeLutin + * Copyright (C) 2008 - 2014 Code Lutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -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; @@ -44,7 +49,7 @@ public class MaskFormatterFromConverter<O> extends MaskFormatter { public static <O> MaskFormatterFromConverter<O> newFormatter(Class<O> type, String pattern, Converter converter) throws ParseException { - return new MaskFormatterFromConverter<>(type, pattern, converter); + return new MaskFormatterFromConverter<O>(type, pattern, converter); } protected MaskFormatterFromConverter(Class<O> type, @@ -57,12 +62,20 @@ public class MaskFormatterFromConverter<O> extends MaskFormatter { @Override public String valueToString(Object value) throws ParseException { - return 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