Author: kmorin Date: 2013-03-27 14:53:21 +0100 (Wed, 27 Mar 2013) New Revision: 687 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/687 Log: fixes #2219 [TRAIT] - Saisie des coordonn?\195?\169es : probl?\195?\168mes sur les valeurs accept?\195?\169es Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUI.java trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-03-26 18:15:51 UTC (rev 686) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-03-27 13:53:21 UTC (rev 687) @@ -250,7 +250,7 @@ showReset: false; useFloat: true; useSign: false; - numberPattern: {DECIMAL2_3_PATTERN}; + numberPattern: {DECIMAL2_DIGITS_PATTERN}; } .second { Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-03-26 18:15:51 UTC (rev 686) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-03-27 13:53:21 UTC (rev 687) @@ -178,7 +178,9 @@ protected boolean onTabChanged(int currentIndex, int newIndex) { ui.getCatchesCaracteristicsAttachmentsButton().onCloseUI(); ui.getSpeciesTabContent().getSpeciesBatchAttachmentsButton().onCloseUI(); + setSpeciesSelectedCard(EditCatchesUIHandler.MAIN_CARD); ui.getBenthosTabContent().getBenthosBatchAttachmentsButton().onCloseUI(); + setBenthosSelectedCard(EditCatchesUIHandler.MAIN_CARD); return super.onTabChanged(currentIndex, newIndex); } @@ -275,78 +277,82 @@ public void setSpeciesSelectedCard(String card) { JPanel panel = ui.getSpeciesTabPanel(); CardLayout2Ext layout = (CardLayout2Ext) panel.getLayout(); - layout.setSelected(card); + if (!card.equals(layout.getSelected())) { + layout.setSelected(card); - JPanel actionPanel = getUI().getCreateFishingOperationActions(); - if (MAIN_CARD.equals(card)) { - registerValidators(); - actionPanel.setVisible(true); - } else { - actionPanel.setVisible(false); - TuttiUI tuttiUi = null; - JXTitledPanel titlePanel = null; - String title = ""; - if (CREATE_BATCH_CARD.equals(card)) { - tuttiUi = ui.getSpeciesTabCreateBatch(); - titlePanel = ui.getSpeciesTabCreateBatchReminderLabel(); - title = n_("tutti.createSpeciesBatch.title"); + JPanel actionPanel = getUI().getCreateFishingOperationActions(); + if (MAIN_CARD.equals(card)) { + registerValidators(); + actionPanel.setVisible(true); + } else { + actionPanel.setVisible(false); + TuttiUI tuttiUi = null; + JXTitledPanel titlePanel = null; + String title = ""; + if (CREATE_BATCH_CARD.equals(card)) { + tuttiUi = ui.getSpeciesTabCreateBatch(); + titlePanel = ui.getSpeciesTabCreateBatchReminderLabel(); + title = n_("tutti.createSpeciesBatch.title"); - } else if (SPLIT_BATCH_CARD.equals(card)) { - tuttiUi = ui.getSpeciesTabSplitBatch(); - titlePanel = ui.getSpeciesTabSplitBatchReminderLabel(); - title = n_("tutti.splitSpeciesBatch.title"); + } else if (SPLIT_BATCH_CARD.equals(card)) { + tuttiUi = ui.getSpeciesTabSplitBatch(); + titlePanel = ui.getSpeciesTabSplitBatchReminderLabel(); + title = n_("tutti.splitSpeciesBatch.title"); - } else if (EDIT_FREQUENCY_CARD.equals(card)) { - tuttiUi = ui.getSpeciesTabFrequencyEditor(); - titlePanel = ui.getSpeciesTabFrequencyEditorReminderLabel(); - title = n_("tutti.editSpeciesFrequencies.title"); - } + } else if (EDIT_FREQUENCY_CARD.equals(card)) { + tuttiUi = ui.getSpeciesTabFrequencyEditor(); + titlePanel = ui.getSpeciesTabFrequencyEditorReminderLabel(); + title = n_("tutti.editSpeciesFrequencies.title"); + } - if (tuttiUi != null) { - registerValidators(tuttiUi.getHandler().getValidator()); + if (tuttiUi != null) { + registerValidators(tuttiUi.getHandler().getValidator()); + } + if (titlePanel != null) { + titlePanel.setTitle(ui.getSpeciesTabFishingOperationReminderLabel().getTitle() + " - " + _(title)); + } } - if (titlePanel != null) { - titlePanel.setTitle(ui.getSpeciesTabFishingOperationReminderLabel().getTitle() + " - " + _(title)); - } } } public void setBenthosSelectedCard(String card) { JPanel panel = ui.getBenthosTabPanel(); CardLayout2Ext layout = (CardLayout2Ext) panel.getLayout(); - layout.setSelected(card); + if (!card.equals(layout.getSelected())) { + layout.setSelected(card); - JPanel actionPanel = getUI().getCreateFishingOperationActions(); - if (MAIN_CARD.equals(card)) { - registerValidators(); - actionPanel.setVisible(true); - } else { - actionPanel.setVisible(false); - TuttiUI tuttiUi = null; - JXTitledPanel titlePanel = null; - String title = ""; - if (CREATE_BATCH_CARD.equals(card)) { - tuttiUi = ui.getBenthosTabCreateBatch(); - titlePanel = ui.getBenthosTabCreateBatchReminderLabel(); - title = n_("tutti.createBenthosBatch.title"); + JPanel actionPanel = getUI().getCreateFishingOperationActions(); + if (MAIN_CARD.equals(card)) { + registerValidators(); + actionPanel.setVisible(true); + } else { + actionPanel.setVisible(false); + TuttiUI tuttiUi = null; + JXTitledPanel titlePanel = null; + String title = ""; + if (CREATE_BATCH_CARD.equals(card)) { + tuttiUi = ui.getBenthosTabCreateBatch(); + titlePanel = ui.getBenthosTabCreateBatchReminderLabel(); + title = n_("tutti.createBenthosBatch.title"); - } else if (SPLIT_BATCH_CARD.equals(card)) { - tuttiUi = ui.getBenthosTabSplitBatch(); - titlePanel = ui.getBenthosTabSplitBatchReminderLabel(); - title = n_("tutti.splitBenthosBatch.title"); + } else if (SPLIT_BATCH_CARD.equals(card)) { + tuttiUi = ui.getBenthosTabSplitBatch(); + titlePanel = ui.getBenthosTabSplitBatchReminderLabel(); + title = n_("tutti.splitBenthosBatch.title"); - } else if (EDIT_FREQUENCY_CARD.equals(card)) { - tuttiUi = ui.getBenthosTabFrequencyEditor(); - titlePanel = ui.getBenthosTabFrequencyEditorReminderLabel(); - title = n_("tutti.editBenthosFrequencies.title"); - } + } else if (EDIT_FREQUENCY_CARD.equals(card)) { + tuttiUi = ui.getBenthosTabFrequencyEditor(); + titlePanel = ui.getBenthosTabFrequencyEditorReminderLabel(); + title = n_("tutti.editBenthosFrequencies.title"); + } - if (tuttiUi != null) { - registerValidators(tuttiUi.getHandler().getValidator()); + if (tuttiUi != null) { + registerValidators(tuttiUi.getHandler().getValidator()); + } + if (titlePanel != null) { + titlePanel.setTitle(ui.getBenthosTabFishingOperationReminderLabel().getTitle() + " - " + _(title)); + } } - if (titlePanel != null) { - titlePanel.setTitle(ui.getBenthosTabFishingOperationReminderLabel().getTitle() + " - " + _(title)); - } } } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUI.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUI.java 2013-03-26 18:15:51 UTC (rev 686) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUI.java 2013-03-27 13:53:21 UTC (rev 687) @@ -127,7 +127,7 @@ * * @since 1.0 */ - public static final String DECIMAL2_3_PATTERN = "\\d{0,2}|\\d{1,2}\\.\\d{0,3}"; + public static final String DECIMAL2_DIGITS_PATTERN = "\\d{0,2}|\\d{1,2}\\.\\d*"; public static final Font TEXTFIELD_NORMAL_FONT = UIManager.getDefaults().getFont("TextField.font"); Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml =================================================================== --- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-03-26 18:15:51 UTC (rev 686) +++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-03-27 13:53:21 UTC (rev 687) @@ -149,7 +149,8 @@ ( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max ) || ( ( getGearShootingStartLatitudeDegree() == ints.max || getGearShootingStartLatitudeDegree() == -ints.min ) - && getGearShootingStartLatitudeMinute() == 0 && getGearShootingStartLatitudeSecond() == 0 + && ( getGearShootingStartLatitudeMinute() == null || getGearShootingStartLatitudeMinute() == 0 ) + && ( getGearShootingStartLatitudeSecond() == null || getGearShootingStartLatitudeSecond() == 0 ) ) ) ]]> @@ -181,7 +182,7 @@ ( -ints.min < getGearShootingStartLatitudeDecimalDegree() && getGearShootingStartLatitudeDecimalDegree() < ints.max ) || ( ( getGearShootingStartLatitudeDecimalDegree() == ints.max || getGearShootingStartLatitudeDecimalDegree() == -ints.min ) - && getGearShootingStartLatitudeDecimalMinute() == 0.0 + && ( getGearShootingStartLatitudeDecimalMinute() == null || getGearShootingStartLatitudeDecimalMinute() == 0.0 ) ) ) ]]> @@ -322,7 +323,8 @@ (-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max) || ( ( getGearShootingStartLongitudeDegree() == ints.max || getGearShootingStartLongitudeDegree() == -ints.min ) - && getGearShootingStartLongitudeMinute() == 0 && getGearShootingStartLongitudeSecond() == 0 + && ( getGearShootingStartLongitudeMinute() == null || getGearShootingStartLongitudeMinute() == 0 ) + && ( getGearShootingStartLongitudeSecond() == null || getGearShootingStartLongitudeSecond() == 0 ) ) ) ]]> @@ -354,7 +356,7 @@ (-ints.min < getGearShootingStartLongitudeDecimalDegree() && getGearShootingStartLongitudeDecimalDegree() < ints.max) || ( ( getGearShootingStartLongitudeDecimalDegree() == ints.max || getGearShootingStartLongitudeDecimalDegree() == -ints.min ) - && getGearShootingStartLongitudeDecimalMinute() == 0.0 + && ( getGearShootingStartLongitudeDecimalMinute() == null || getGearShootingStartLongitudeDecimalMinute() == 0.0 ) ) ) ]]> @@ -496,7 +498,8 @@ (-ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max) || ( ( getGearShootingEndLatitudeDegree() == ints.max || getGearShootingEndLatitudeDegree() == -ints.min ) - && getGearShootingEndLatitudeMinute() == 0 && getGearShootingEndLatitudeSecond() == 0 + && ( getGearShootingEndLatitudeMinute() == null || getGearShootingEndLatitudeMinute() == 0 ) + && ( getGearShootingEndLatitudeSecond() == null || getGearShootingEndLatitudeSecond() == 0 ) ) ) ]]> @@ -528,7 +531,7 @@ (-ints.min < getGearShootingEndLatitudeDecimalDegree() && getGearShootingEndLatitudeDecimalDegree() < ints.max) || ( ( getGearShootingEndLatitudeDecimalDegree() == ints.max || getGearShootingEndLatitudeDecimalDegree() == -ints.min ) - && getGearShootingEndLatitudeDecimalMinute() == 0.0 + && ( getGearShootingEndLatitudeDecimalMinute() == null || getGearShootingEndLatitudeDecimalMinute() == 0.0 ) ) ) ]]> @@ -669,7 +672,8 @@ (-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max) || ( ( getGearShootingEndLongitudeDegree() == ints.max || getGearShootingEndLongitudeDegree() == -ints.min ) - && getGearShootingEndLongitudeMinute() == 0 && getGearShootingEndLongitudeSecond() == 0 + && ( getGearShootingEndLongitudeMinute() == null || getGearShootingEndLongitudeMinute() == 0 ) + && ( getGearShootingEndLongitudeSecond() == null || getGearShootingEndLongitudeSecond() == 0 ) ) ) ]]> @@ -701,7 +705,7 @@ (-ints.min < getGearShootingEndLongitudeDecimalDegree() && getGearShootingEndLongitudeDecimalDegree() < ints.max) || ( ( getGearShootingEndLongitudeDecimalDegree() == ints.max || getGearShootingEndLongitudeDecimalDegree() == -ints.min ) - && getGearShootingEndLongitudeDecimalMinute() == 0.0 + && ( getGearShootingEndLongitudeDecimalMinute() == null || getGearShootingEndLongitudeDecimalMinute() == 0.0 ) ) ) ]]> Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml =================================================================== --- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-03-26 18:15:51 UTC (rev 686) +++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-03-27 13:53:21 UTC (rev 687) @@ -211,7 +211,8 @@ (( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max ) || ( ( getGearShootingStartLatitudeDegree() == ints.max || getGearShootingStartLatitudeDegree() == -ints.min ) - && getGearShootingStartLatitudeMinute() == 0 && getGearShootingStartLatitudeSecond() == 0 + && ( getGearShootingStartLatitudeMinute() == null || getGearShootingStartLatitudeMinute() == 0 ) + && ( getGearShootingStartLatitudeSecond() == null || getGearShootingStartLatitudeSecond() == 0 ) )) ) ]]> @@ -244,7 +245,7 @@ (( -ints.min < getGearShootingStartLatitudeDecimalDegree() && getGearShootingStartLatitudeDecimalDegree() < ints.max ) || ( ( getGearShootingStartLatitudeDecimalDegree() == ints.max || getGearShootingStartLatitudeDecimalDegree() == -ints.min ) - && getGearShootingStartLatitudeDecimalMinute() == 0.0 + && ( getGearShootingStartLatitudeDecimalMinute() == null || getGearShootingStartLatitudeDecimalMinute() == 0.0 ) )) ) ]]> @@ -394,7 +395,8 @@ ((-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max) || ( ( getGearShootingStartLongitudeDegree() == ints.max || getGearShootingStartLongitudeDegree() == -ints.min ) - && getGearShootingStartLongitudeMinute() == 0 && getGearShootingStartLongitudeSecond() == 0 + && ( getGearShootingStartLongitudeMinute() == null || getGearShootingStartLongitudeMinute() == 0 ) + && ( getGearShootingStartLongitudeSecond() == null || getGearShootingStartLongitudeSecond() == 0 ) )) ) ]]> @@ -427,7 +429,7 @@ (( -ints.min < getGearShootingStartLongitudeDecimalDegree() && getGearShootingStartLongitudeDecimalDegree() < ints.max) || ( ( getGearShootingStartLongitudeDecimalDegree() == ints.max || getGearShootingStartLongitudeDecimalDegree() == -ints.min ) - && getGearShootingStartLongitudeDecimalMinute() == 0.0 + && ( getGearShootingStartLongitudeDecimalMinute() == null || getGearShootingStartLongitudeDecimalMinute() == 0.0 ) )) ) ]]> @@ -578,7 +580,8 @@ (( -ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max) || ( ( getGearShootingEndLatitudeDegree() == ints.max || getGearShootingEndLatitudeDegree() == -ints.min ) - && getGearShootingEndLatitudeMinute() == 0 && getGearShootingEndLatitudeSecond() == 0 + && ( getGearShootingEndLatitudeMinute() == null || getGearShootingEndLatitudeMinute() == 0 ) + && ( getGearShootingEndLatitudeSecond() == null || getGearShootingEndLatitudeSecond() == 0 ) )) ) ]]> @@ -611,7 +614,7 @@ (( -ints.min < getGearShootingEndLatitudeDecimalDegree() && getGearShootingEndLatitudeDecimalDegree() < ints.max) || ( ( getGearShootingEndLatitudeDecimalDegree() == ints.max || getGearShootingEndLatitudeDecimalDegree() == -ints.min ) - && getGearShootingEndLatitudeDecimalMinute() == 0.0 + && ( getGearShootingEndLatitudeDecimalMinute() == null || getGearShootingEndLatitudeDecimalMinute() == 0.0 ) )) ) ]]> @@ -761,7 +764,8 @@ ((-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max) || ( ( getGearShootingEndLongitudeDegree() == ints.max || getGearShootingEndLongitudeDegree() == -ints.min ) - && getGearShootingEndLongitudeMinute() == 0 && getGearShootingEndLongitudeSecond() == 0 + && ( getGearShootingEndLongitudeMinute() == null || getGearShootingEndLongitudeMinute() == 0 ) + && ( getGearShootingEndLongitudeSecond() == null || getGearShootingEndLongitudeSecond() == 0 ) )) ) ]]> @@ -794,7 +798,7 @@ (( -ints.min < getGearShootingEndLongitudeDecimalDegree() && getGearShootingEndLongitudeDecimalDegree() < ints.max) || ( ( getGearShootingEndLongitudeDecimalDegree() == ints.max || getGearShootingEndLongitudeDecimalDegree() == -ints.min ) - && getGearShootingEndLongitudeDecimalMinute() == 0.0 + && ( getGearShootingEndLongitudeDecimalMinute() == null || getGearShootingEndLongitudeDecimalMinute() == 0.0 ) )) ) ]]> Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties =================================================================== --- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-03-26 18:15:51 UTC (rev 686) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-03-27 13:53:21 UTC (rev 687) @@ -1031,13 +1031,13 @@ tutti.validator.error.splitSpeciesBatch.selectedCategory.required=La catégorie est obligatoire tutti.validator.warning.cruise.name.format=Le format n'est pas celui ... tutti.validator.warning.latitude.degree.outOfBounds=Le degré de la latitude doit être compris entre -90 et 90 -tutti.validator.warning.latitude.minute.outOfBounds=La minute de la latitude doit être comprise entre 0 et 60 +tutti.validator.warning.latitude.minute.outOfBounds=La minute de la latitude doit être comprise entre 0 et 59 tutti.validator.warning.latitude.outOfBounds=La Latitude doit être comprise entre -90.0 et 90.0 -tutti.validator.warning.latitude.second.outOfBounds=La seconde de la latitude doit être comprise entre 0 et 60 -tutti.validator.warning.longitude.degree.outOfBounds=Le degré de la latitude doit être compris entre -180 et 180 -tutti.validator.warning.longitude.minute.outOfBounds=La minute de la latitude doit être comprise entre 0 et 60 -tutti.validator.warning.longitude.outOfBounds=La Latitude doit être comprise entre -180.0 et 180.0 -tutti.validator.warning.longitude.second.outOfBounds=La seconde de la longitude doit être comprise entre 0 et 60 +tutti.validator.warning.latitude.second.outOfBounds=La seconde de la latitude doit être comprise entre 0 et 59 +tutti.validator.warning.longitude.degree.outOfBounds=Le degré de la longitude doit être compris entre -180 et 180 +tutti.validator.warning.longitude.minute.outOfBounds=La minute de la longitude doit être comprise entre 0 et 59 +tutti.validator.warning.longitude.outOfBounds=La longitude doit être comprise entre -180.0 et 180.0 +tutti.validator.warning.longitude.second.outOfBounds=La seconde de la longitude doit être comprise entre 0 et 59 tutti.vesselUseFeatureTable.action.removeCaracteristic=Supprimer tutti.vesselUseFeatureTable.action.removeCaracteristic.mnemonic=S tutti.vesselUseFeatureTable.action.removeCaracteristic.tip=Supprimer la caractéristique