r162 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/cruise java/fr/ifremer/tutti/ui/swing/util resources/fr/ifremer/tutti/ui/swing/content/operation resources/i18n
Author: tchemit Date: 2013-01-09 21:38:38 +0100 (Wed, 09 Jan 2013) New Revision: 162 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/162 Log: refs #1911: [CAMPAGNE] - Gestion des campagnes (filtrage des navires) Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.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/i18n/tutti-ui-swing_fr_FR.properties Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2013-01-09 18:34:01 UTC (rev 161) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2013-01-09 20:38:38 UTC (rev 162) @@ -134,9 +134,41 @@ #vesselList { property: vessel; +} + +#vesselListPane { border: {BorderFactory.createTitledBorder(_("tutti.label.list.vessel"))}; } +#filterVesselLabel { + text: "tutti.label.filterVesselType"; +} + + +#filterVesselAllButton { + text: "tutti.label.filterVesselType.all"; + toolTipText: "tutti.label.filterVesselType.all.tip"; + value: "all"; + selected: {model.isVesselTypeAll()}; + buttonGroup: "filterVesselType"; +} + +#filterVesselScientificButton { + text: "tutti.label.filterVesselType.scientific"; + toolTipText: "tutti.label.filterVesselType.scientific.tip"; + value: "scientific"; + selected: {model.isVesselTypeScientific()}; + buttonGroup: "filterVesselType"; +} + +#filterVesselFishingButton { + text: "tutti.label.filterVesselType.fishing"; + toolTipText: "tutti.label.filterVesselType.fishing.tip"; + value: "fishing"; + selected: {model.isVesselTypeFishing()}; + buttonGroup: "filterVesselType"; +} + #gearList { property: gear; border: {BorderFactory.createTitledBorder(_("tutti.label.list.gear"))}; Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx 2013-01-09 18:34:01 UTC (rev 161) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx 2013-01-09 20:38:38 UTC (rev 162) @@ -89,10 +89,11 @@ <field name='comment' component='commentField'/> </BeanValidator> + <JSplitPane id='splitPane' constraints='BorderLayout.CENTER'> <Table fill='both'> - <!-- cruise program / year /program part / name --> + <!-- cruise program / year / program part / name --> <row> <cell anchor='west'> <JLabel id='programLabel'/> @@ -166,7 +167,18 @@ <row weighty='0.3'> <cell columns='6'> <JPanel layout='{new GridLayout(1, 0)}'> - <BeanDoubleList id='vesselList' genericType='Vessel'/> + <JPanel id='vesselListPane' layout="{new BorderLayout()}"> + <JPanel id='vesselFilterPane' constraints='BorderLayout.NORTH'> + <JLabel id='filterVesselLabel'/> + <JRadioButton id='filterVesselAllButton' + onActionPerformed='model.setVesselType(VesselTypeEnum.ALL)'/> + <JRadioButton id='filterVesselScientificButton' + onActionPerformed='model.setVesselType(VesselTypeEnum.SCIENTIFIC)'/> + <JRadioButton id='filterVesselFishingButton' + onActionPerformed='model.setVesselType(VesselTypeEnum.FISHING)'/> + </JPanel> + <BeanDoubleList id='vesselList' genericType='Vessel' constraints='BorderLayout.CENTER'/> + </JPanel> <BeanDoubleList id='gearList' genericType='Gear'/> </JPanel> </cell> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-01-09 18:34:01 UTC (rev 161) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-01-09 20:38:38 UTC (rev 162) @@ -126,13 +126,13 @@ ui.setContextValue(model); } - JAXXContextEntryDef<List<Vessel>> SCIENTIFIC_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef(); + JAXXContextEntryDef<List<Vessel>> SCIENTIFIC_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef("scientificVessel"); - JAXXContextEntryDef<List<Vessel>> FISHING_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef(); + JAXXContextEntryDef<List<Vessel>> FISHING_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef("fishingVessel"); - JAXXContextEntryDef<List<Gear>> SCIENTIFIC_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef(); + JAXXContextEntryDef<List<Gear>> SCIENTIFIC_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef("scientificGear"); - JAXXContextEntryDef<List<Gear>> FISHING_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef(); + JAXXContextEntryDef<List<Gear>> FISHING_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef("fishingGear"); protected List<Vessel> getVesselList(VesselTypeEnum vesselType) { List<Vessel> result = Lists.newArrayList(); @@ -213,8 +213,6 @@ } }); - model.setVesselType(VesselTypeEnum.ALL); - initBeanComboBox(ui.getSurveyComboBox(), persistenceService.getAllProgram(), model.getProgram()); @@ -244,6 +242,8 @@ listenValidatorValid(ui.getValidator(), model); + model.setVesselType(VesselTypeEnum.ALL); + // if new fishingOperation can already cancel his creation model.setModify(model.isCreate()); } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java 2013-01-09 18:34:01 UTC (rev 161) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java 2013-01-09 20:38:38 UTC (rev 162) @@ -249,11 +249,30 @@ } public void setVesselType(VesselTypeEnum vesselType) { + boolean oldAll = isVesselTypeAll(); + boolean oldScientific = isVesselTypeScientific(); + boolean oldFishing = isVesselTypeFishing(); Object oldValue = getVesselType(); this.vesselType = vesselType; firePropertyChange(PROPERTY_VESSEL_TYPE, oldValue, vesselType); + firePropertyChange("vesselTypeAll", oldAll, isVesselTypeAll()); + firePropertyChange("vesselTypeScientific", oldScientific, isVesselTypeScientific()); + firePropertyChange("vesselTypeFishing", oldFishing, isVesselTypeFishing()); + } + public boolean isVesselTypeAll() { + return VesselTypeEnum.ALL.equals(vesselType); + } + + public boolean isVesselTypeScientific() { + return VesselTypeEnum.SCIENTIFIC.equals(vesselType); + } + + public boolean isVesselTypeFishing() { + return VesselTypeEnum.FISHING.equals(vesselType); + } + public boolean isCanGenerateName() { return program != null && year != null; } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java 2013-01-09 18:34:01 UTC (rev 161) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java 2013-01-09 20:38:38 UTC (rev 162) @@ -1,7 +1,28 @@ package fr.ifremer.tutti.ui.swing.content.cruise; -import static org.nuiton.i18n.I18n._; -import static org.nuiton.i18n.I18n.n_; +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ /** * To select which vessel types we can see (All - Scientific, Fishing) @@ -10,18 +31,7 @@ * @since 0.3 */ public enum VesselTypeEnum { - - ALL(n_("tutti.label.vesselType.all")), - SCIENTIFIC(n_("tutti.label.vesselType.scientific")), - FISHING(n_("tutti.label.vesselType.fishing")); - - private final String i18nKey; - - private VesselTypeEnum(String i18nKey) { - this.i18nKey = i18nKey; - } - - public String getLabel() { - return _(i18nKey); - } + ALL, + SCIENTIFIC, + FISHING } Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-01-09 18:34:01 UTC (rev 161) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-01-09 20:38:38 UTC (rev 162) @@ -1,6 +1,30 @@ package fr.ifremer.tutti.ui.swing.util; +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel; import java.awt.Color; import java.awt.Transparency; Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native 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-01-09 18:34:01 UTC (rev 161) +++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-01-09 20:38:38 UTC (rev 162) @@ -17,10 +17,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public -License along with this program. If not, see -<http://www.gnu.org/licenses/gpl-3.0.html>. -#L% + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% --> 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-01-09 18:34:01 UTC (rev 161) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-09 20:38:38 UTC (rev 162) @@ -85,6 +85,13 @@ tutti.label.filterSpeciesBatchMode.mode.all=Tout voir tutti.label.filterSpeciesBatchMode.mode.leaf=Voir les feuilles tutti.label.filterSpeciesBatchMode.mode.root=Voir les parents +tutti.label.filterVesselType=Filtre \: +tutti.label.filterVesselType.all=Tout +tutti.label.filterVesselType.all.tip=Tout les navires +tutti.label.filterVesselType.fishing=Pro +tutti.label.filterVesselType.fishing.tip=Uniquement les navires pro +tutti.label.filterVesselType.scientific=Scientifique +tutti.label.filterVesselType.scientific.tip=Uniquement les navires scientifiques tutti.label.fishingOperation.date=Date tutti.label.fishingOperation.distanceChalutee=Distance chalutée tutti.label.fishingOperation.duree=Durée @@ -138,7 +145,6 @@ tutti.label.tab.fishingOperation=Trait tutti.label.tab.fishingOperation.environment=Environnement tutti.label.tab.fishingOperation.gearShooting=Mise en oeuvre de l'engin -tutti.label.tab.fishingOperation.general=Caractéristiques générales tutti.label.tab.fishingOperation.hydrology=Paramètres hydrologiques tutti.label.tab.macroDechet=Macro déchets tutti.label.tab.observationIndividuel=Observations individuelles @@ -148,9 +154,6 @@ tutti.label.tab.protocol.species=Espèces tutti.label.tab.species=Espèces tutti.label.traitReminder=Trait \: %s -tutti.label.vesselType.all= -tutti.label.vesselType.fishing= -tutti.label.vesselType.scientific= tutti.legend.catch.benthos=Benthos tutti.legend.catch.macroWaste=Macro déchets tutti.legend.catch.species=Espèces
participants (1)
-
tchemit@users.forge.codelutin.com