Tutti-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- 4058 discussions
r663 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species: . frequency
by tchemit@users.forge.codelutin.com 21 Mar '13
by tchemit@users.forge.codelutin.com 21 Mar '13
21 Mar '13
Author: tchemit
Date: 2013-03-21 12:28:04 +0100 (Thu, 21 Mar 2013)
New Revision: 663
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/663
Log:
continue refactor
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyCellComponent.java
Removed:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-20 23:23:30 UTC (rev 662)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-21 11:28:04 UTC (rev 663)
@@ -45,7 +45,7 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryComponent;
import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType;
import fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.FrequencyCellComponent;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyCellComponent;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.CreateSpeciesBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.CreateSpeciesBatchUIModel;
@@ -519,8 +519,8 @@
{ // Number column (from frequencies)
addColumnToModel(columnModel,
- FrequencyCellComponent.newEditor(ui, computedDataColor),
- FrequencyCellComponent.newRender(computedDataColor),
+ SpeciesFrequencyCellComponent.newEditor(ui, computedDataColor),
+ SpeciesFrequencyCellComponent.newRender(computedDataColor),
SpeciesBatchTableModel.COMPUTED_NUMBER);
}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java 2013-03-20 23:23:30 UTC (rev 662)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java 2013-03-21 11:28:04 UTC (rev 663)
@@ -1,303 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 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 com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchTableModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI;
-import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
-import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
-import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
-import jaxx.runtime.SwingUtil;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.AbstractCellEditor;
-import javax.swing.JTable;
-import javax.swing.border.LineBorder;
-import javax.swing.table.DefaultTableCellRenderer;
-import javax.swing.table.TableCellEditor;
-import javax.swing.table.TableCellRenderer;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.List;
-
-/**
- * Component to render and edit frequency stuff from batch table.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class FrequencyCellComponent extends DefaultTableCellRenderer {
-
- private static final long serialVersionUID = 1L;
-
- public static final String ROW_INDEX = "rowIndex";
-
- protected Color computedDataColor;
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(FrequencyCellComponent.class);
-
- public FrequencyCellComponent(Color computedDataColor) {
- setHorizontalAlignment(CENTER);
- setIcon(SwingUtil.createActionIcon("show-frequency"));
- this.computedDataColor = computedDataColor;
- }
-
- public void setComputedOrNotText(TuttiComputedOrNotData<Integer> data) {
- String text;
-
- if (data != null && data.getData() != null) {
- text = String.valueOf(data.getData());
-
- } else if (data != null
- && data.getComputedData() != null
- && data.getComputedData() != 0) {
-
- String blue = Integer.toHexString(computedDataColor.getRGB()).substring(2);
- text = "<html><em style='color: #" + blue + "'>" + data.getComputedData() + "</em></html>";
-
- } else {
- text = " - ";
- }
- setText(text);
- setToolTipText(text);
- }
-
- public static TableCellRenderer newRender(Color computedDataColor) {
- return new FrequencyCellRenderer(computedDataColor);
- }
-
- public static TableCellEditor newEditor(SpeciesBatchUI ui, Color computedDataColor) {
- return new FrequencyCellEditor(ui, computedDataColor);
- }
-
- public static class FrequencyCellEditor extends AbstractCellEditor implements TableCellEditor {
-
- private static final long serialVersionUID = 1L;
-
- protected final FrequencyCellComponent component;
-
- protected final SpeciesBatchUI ui;
-
- protected JTable table;
-
- protected SpeciesBatchTableModel tableModel;
-
- protected ColumnIdentifier<SpeciesBatchRowModel> columnIdentifier;
-
- protected SpeciesBatchRowModel editRow;
-
- protected Integer rowIndex;
-
- protected Integer columnIndex;
-
- public FrequencyCellEditor(SpeciesBatchUI ui, Color computedDataColor) {
- this.ui = ui;
- component = new FrequencyCellComponent(computedDataColor);
- component.setBorder(new LineBorder(Color.BLACK));
- component.addKeyListener(new KeyAdapter() {
- @Override
- public void keyReleased(KeyEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_ENTER ||
- e.getKeyCode() == KeyEvent.VK_SPACE) {
- e.consume();
- startEdit();
- }
- }
- });
-
- component.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent e) {
- e.consume();
- startEdit();
- }
- });
- }
-
- protected void startEdit() {
-
- Preconditions.checkNotNull(tableModel, "No table model assigned.");
-
- // open frequency dialog
-
- Preconditions.checkNotNull(editRow, "No editRow found.");
-
- if (log.isInfoEnabled()) {
- log.info("Will edit frequencies for row: " + rowIndex);
- }
-
- EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
- SpeciesFrequencyUI frequencyEditor = parent.getSpeciesTabFrequencyEditor();
-
- frequencyEditor.getHandler().editBatch(editRow, this);
-
- // open frequency editor
- parent.getHandler().setSpeciesSelectedCard(EditCatchesUIHandler.EDIT_FREQUENCY_CARD);
- }
-
- public void validateEdition(SpeciesFrequencyUIModel frequencyModel) {
- if (frequencyModel.isValid()) {
-
- // at close, synch back frequencies
- List<SpeciesFrequencyRowModel> frequency = Lists.newArrayList();
-
- if (frequencyModel.isSimpleCountingMode()) {
- editRow.setNumber(frequencyModel.getSimpleCount());
-
- } else {
- // transfer rows to editor
-
- for (SpeciesFrequencyRowModel row : frequencyModel.getRows()) {
- if (row.isValid()) {
-
- // can keep this row
- frequency.add(row);
- }
- }
- if (log.isInfoEnabled()) {
- log.info("Push back " + frequency.size() +
- " frequency to batch " + frequencyModel.getBatch());
- }
-
- // push back to batch
- editRow.setNumber(null);
-
- }
-
- editRow.setFrequency(frequency);
- // update frequencies total
- ui.getHandler().updateTotalFromFrequencies(editRow);
-
- }
-
- int r = rowIndex;
- int c = columnIndex;
-
- // stop edition
- stopCellEditing();
-
- // reselect this cell
- AbstractSelectTableAction.doSelectCell(table, r, c);
- table.requestFocus();
- }
-
- @Override
- public Component getTableCellEditorComponent(JTable table,
- Object value,
- boolean isSelected,
- int row,
- int column) {
- tableModel = (SpeciesBatchTableModel) table.getModel();
- this.table = table;
- columnIdentifier = SpeciesBatchTableModel.COMPUTED_NUMBER;
- if (log.isDebugEnabled()) {
- log.debug("Set columnIdentifier (" + column + ") :: " + columnIdentifier.getPropertyName());
- }
- TuttiComputedOrNotData<Integer> data = (TuttiComputedOrNotData<Integer>) value;
- component.setComputedOrNotText(data);
-
- rowIndex = row;
- columnIndex = column;
-
- editRow = tableModel.getEntry(row);
-
- return component;
- }
-
- @Override
- public Object getCellEditorValue() {
-
- Preconditions.checkNotNull(editRow, "No editRow found in editor.");
-
- Object result = null;
- if (columnIdentifier == SpeciesBatchTableModel.COMPUTED_NUMBER) {
- result = editRow.getComputedOrNotNumber();
- }
- if (log.isDebugEnabled()) {
- log.debug("editor value (" + columnIdentifier + "): " + result);
- }
-
- return result;
- }
-
-// @Override
-// public boolean stopCellEditing() {
-// boolean b = super.stopCellEditing();
-// if (b) {
-// rowIndex = null;
-// editRow = null;
-// columnIndex = null;
-// }
-// return b;
-// }
-
- @Override
- public void cancelCellEditing() {
- super.cancelCellEditing();
- rowIndex = null;
- columnIndex = null;
- editRow = null;
- }
- }
-
- public static class FrequencyCellRenderer implements TableCellRenderer {
-
- protected final FrequencyCellComponent component;
-
- public FrequencyCellRenderer(Color computedDataColor) {
- component = new FrequencyCellComponent(computedDataColor);
- }
-
- @Override
- public Component getTableCellRendererComponent(JTable table,
- Object value,
- boolean isSelected,
- boolean hasFocus,
- int row,
- int column) {
-
- TuttiComputedOrNotData<Integer> data = (TuttiComputedOrNotData<Integer>) value;
- FrequencyCellComponent result =
- (FrequencyCellComponent) component.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
-
- boolean editable = table.isCellEditable(row, column);
- result.setEnabled(editable);
- result.setComputedOrNotText(data);
- return result;
- }
- }
-}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyCellComponent.java (from rev 662, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyCellComponent.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyCellComponent.java 2013-03-21 11:28:04 UTC (rev 663)
@@ -0,0 +1,303 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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 com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchTableModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI;
+import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
+import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
+import jaxx.runtime.SwingUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.AbstractCellEditor;
+import javax.swing.JTable;
+import javax.swing.border.LineBorder;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.List;
+
+/**
+ * Component to render and edit frequency stuff from batch table.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class SpeciesFrequencyCellComponent extends DefaultTableCellRenderer {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String ROW_INDEX = "rowIndex";
+
+ protected Color computedDataColor;
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(SpeciesFrequencyCellComponent.class);
+
+ public SpeciesFrequencyCellComponent(Color computedDataColor) {
+ setHorizontalAlignment(CENTER);
+ setIcon(SwingUtil.createActionIcon("show-frequency"));
+ this.computedDataColor = computedDataColor;
+ }
+
+ public void setComputedOrNotText(TuttiComputedOrNotData<Integer> data) {
+ String text;
+
+ if (data != null && data.getData() != null) {
+ text = String.valueOf(data.getData());
+
+ } else if (data != null
+ && data.getComputedData() != null
+ && data.getComputedData() != 0) {
+
+ String blue = Integer.toHexString(computedDataColor.getRGB()).substring(2);
+ text = "<html><em style='color: #" + blue + "'>" + data.getComputedData() + "</em></html>";
+
+ } else {
+ text = " - ";
+ }
+ setText(text);
+ setToolTipText(text);
+ }
+
+ public static TableCellRenderer newRender(Color computedDataColor) {
+ return new FrequencyCellRenderer(computedDataColor);
+ }
+
+ public static TableCellEditor newEditor(SpeciesBatchUI ui, Color computedDataColor) {
+ return new FrequencyCellEditor(ui, computedDataColor);
+ }
+
+ public static class FrequencyCellEditor extends AbstractCellEditor implements TableCellEditor {
+
+ private static final long serialVersionUID = 1L;
+
+ protected final SpeciesFrequencyCellComponent component;
+
+ protected final SpeciesBatchUI ui;
+
+ protected JTable table;
+
+ protected SpeciesBatchTableModel tableModel;
+
+ protected ColumnIdentifier<SpeciesBatchRowModel> columnIdentifier;
+
+ protected SpeciesBatchRowModel editRow;
+
+ protected Integer rowIndex;
+
+ protected Integer columnIndex;
+
+ public FrequencyCellEditor(SpeciesBatchUI ui, Color computedDataColor) {
+ this.ui = ui;
+ component = new SpeciesFrequencyCellComponent(computedDataColor);
+ component.setBorder(new LineBorder(Color.BLACK));
+ component.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.getKeyCode() == KeyEvent.VK_ENTER ||
+ e.getKeyCode() == KeyEvent.VK_SPACE) {
+ e.consume();
+ startEdit();
+ }
+ }
+ });
+
+ component.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ e.consume();
+ startEdit();
+ }
+ });
+ }
+
+ protected void startEdit() {
+
+ Preconditions.checkNotNull(tableModel, "No table model assigned.");
+
+ // open frequency dialog
+
+ Preconditions.checkNotNull(editRow, "No editRow found.");
+
+ if (log.isInfoEnabled()) {
+ log.info("Will edit frequencies for row: " + rowIndex);
+ }
+
+ EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ SpeciesFrequencyUI frequencyEditor = parent.getSpeciesTabFrequencyEditor();
+
+ frequencyEditor.getHandler().editBatch(editRow, this);
+
+ // open frequency editor
+ parent.getHandler().setSpeciesSelectedCard(EditCatchesUIHandler.EDIT_FREQUENCY_CARD);
+ }
+
+ public void validateEdition(SpeciesFrequencyUIModel frequencyModel) {
+ if (frequencyModel.isValid()) {
+
+ // at close, synch back frequencies
+ List<SpeciesFrequencyRowModel> frequency = Lists.newArrayList();
+
+ if (frequencyModel.isSimpleCountingMode()) {
+ editRow.setNumber(frequencyModel.getSimpleCount());
+
+ } else {
+ // transfer rows to editor
+
+ for (SpeciesFrequencyRowModel row : frequencyModel.getRows()) {
+ if (row.isValid()) {
+
+ // can keep this row
+ frequency.add(row);
+ }
+ }
+ if (log.isInfoEnabled()) {
+ log.info("Push back " + frequency.size() +
+ " frequency to batch " + frequencyModel.getBatch());
+ }
+
+ // push back to batch
+ editRow.setNumber(null);
+
+ }
+
+ editRow.setFrequency(frequency);
+ // update frequencies total
+ ui.getHandler().updateTotalFromFrequencies(editRow);
+
+ }
+
+ int r = rowIndex;
+ int c = columnIndex;
+
+ // stop edition
+ stopCellEditing();
+
+ // reselect this cell
+ AbstractSelectTableAction.doSelectCell(table, r, c);
+ table.requestFocus();
+ }
+
+ @Override
+ public Component getTableCellEditorComponent(JTable table,
+ Object value,
+ boolean isSelected,
+ int row,
+ int column) {
+ tableModel = (SpeciesBatchTableModel) table.getModel();
+ this.table = table;
+ columnIdentifier = SpeciesBatchTableModel.COMPUTED_NUMBER;
+ if (log.isDebugEnabled()) {
+ log.debug("Set columnIdentifier (" + column + ") :: " + columnIdentifier.getPropertyName());
+ }
+ TuttiComputedOrNotData<Integer> data = (TuttiComputedOrNotData<Integer>) value;
+ component.setComputedOrNotText(data);
+
+ rowIndex = row;
+ columnIndex = column;
+
+ editRow = tableModel.getEntry(row);
+
+ return component;
+ }
+
+ @Override
+ public Object getCellEditorValue() {
+
+ Preconditions.checkNotNull(editRow, "No editRow found in editor.");
+
+ Object result = null;
+ if (columnIdentifier == SpeciesBatchTableModel.COMPUTED_NUMBER) {
+ result = editRow.getComputedOrNotNumber();
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("editor value (" + columnIdentifier + "): " + result);
+ }
+
+ return result;
+ }
+
+// @Override
+// public boolean stopCellEditing() {
+// boolean b = super.stopCellEditing();
+// if (b) {
+// rowIndex = null;
+// editRow = null;
+// columnIndex = null;
+// }
+// return b;
+// }
+
+ @Override
+ public void cancelCellEditing() {
+ super.cancelCellEditing();
+ rowIndex = null;
+ columnIndex = null;
+ editRow = null;
+ }
+ }
+
+ public static class FrequencyCellRenderer implements TableCellRenderer {
+
+ protected final SpeciesFrequencyCellComponent component;
+
+ public FrequencyCellRenderer(Color computedDataColor) {
+ component = new SpeciesFrequencyCellComponent(computedDataColor);
+ }
+
+ @Override
+ public Component getTableCellRendererComponent(JTable table,
+ Object value,
+ boolean isSelected,
+ boolean hasFocus,
+ int row,
+ int column) {
+
+ TuttiComputedOrNotData<Integer> data = (TuttiComputedOrNotData<Integer>) value;
+ SpeciesFrequencyCellComponent result =
+ (SpeciesFrequencyCellComponent) component.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+
+ boolean editable = table.isCellEditable(row, column);
+ result.setEnabled(editable);
+ result.setComputedOrNotText(data);
+ return result;
+ }
+ }
+}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-20 23:23:30 UTC (rev 662)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-21 11:28:04 UTC (rev 663)
@@ -37,8 +37,7 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUIHandler;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.FrequencyCellComponent.FrequencyCellEditor;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyCellComponent.FrequencyCellEditor;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
1
0
20 Mar '13
Author: tchemit
Date: 2013-03-21 00:23:30 +0100 (Thu, 21 Mar 2013)
New Revision: 662
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/662
Log:
refs #1863: [BENTHOS] - Gestion de la saisie du benthos
- impact sur service de persistence
- debut de reusinage des APi d'ui
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategory.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryColumnIdentifier.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryType.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/TableViewMode.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateSpeciesMelagAction.java
Removed:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategory.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryType.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/TableViewMode.java
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceWriteTest.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDataContext.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RenameSpeciesBatchAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -488,7 +488,7 @@
//-- Benthos Batch methods --//
//------------------------------------------------------------------------//
- List<SpeciesBatch> getAllRootBenthosBatch(String fishingOperationId);
+ BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId);
@Transactional(readOnly = false)
SpeciesBatch createBenthosBatch(SpeciesBatch bean, String parentBatchId);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -575,8 +575,8 @@
//------------------------------------------------------------------------//
@Override
- public List<SpeciesBatch> getAllRootBenthosBatch(String fishingOperationId) {
- return batchService.getAllRootBenthosBatch(fishingOperationId);
+ public BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId) {
+ return batchService.getRootBenthosBatch(fishingOperationId);
}
@Override
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -385,7 +385,7 @@
}
@Override
- public List<SpeciesBatch> getAllRootBenthosBatch(String fishingOperationId) {
+ public BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId) {
throw new RuntimeException("method not implemented");
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceService.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceService.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -146,11 +146,12 @@
* <p/>
* <strong>Note:</strong> All childs of the batch should be loaded here.
*
+ *
* @param fishingOperationId if of the fishing operation to seek
* @return the list of root {@link SpeciesBatch}
* @since 1.0
*/
- List<SpeciesBatch> getAllRootBenthosBatch(String fishingOperationId);
+ BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId);
@Transactional(readOnly = false)
SpeciesBatch createBenthosBatch(SpeciesBatch bean, String parentBatchId);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -62,7 +62,6 @@
import javax.annotation.Resource;
import java.io.Serializable;
import java.text.MessageFormat;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -74,7 +73,9 @@
public class BatchPersistenceServiceImpl
extends AbstractPersistenceService implements BatchPersistenceService {
- /** Logger. */
+ /**
+ * Logger.
+ */
private static final Log log =
LogFactory.getLog(BatchPersistenceServiceImpl.class);
@@ -119,13 +120,13 @@
// Vrac
SortingBatch vracBatch = catchBatchDao.getSortingBatch(source.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID);
+ "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID);
result.setCatchTotalSortedCarousselWeight(vracBatch.getWeight());
result.setCatchTotalSortedTremisWeight(vracBatch.getWeightBeforeSampling());
{
// Species
SortingBatch speciesBatch = catchBatchDao.getSortingBatch(vracBatch.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
result.setSpeciesTotalSampleSortedWeight(speciesBatch.getWeight());
result.setSpeciesTotalSortedWeight(speciesBatch.getWeightBeforeSampling());
@@ -133,14 +134,14 @@
{
// Inert
SortingBatch inertBatch = catchBatchDao.getSortingBatch(speciesBatch.getChildBatchs(),
- "referenceTaxonId", enumeration.REFERENCE_TAXON_ID_INERT);
+ "referenceTaxonId", enumeration.REFERENCE_TAXON_ID_INERT);
if (inertBatch != null) {
result.setSpeciesTotalInertWeight(inertBatch.getWeight());
}
// Alive no itemized
SortingBatch livingNotItemizedBatch = catchBatchDao.getSortingBatch(speciesBatch.getChildBatchs(),
- "referenceTaxonId", enumeration.REFERENCE_TAXON_ID_LIFE);
+ "referenceTaxonId", enumeration.REFERENCE_TAXON_ID_LIFE);
if (livingNotItemizedBatch != null) {
result.setSpeciesTotalLivingNotItemizedWeight(livingNotItemizedBatch.getWeight());
}
@@ -148,7 +149,7 @@
// Benthos
SortingBatch benthosBatch = catchBatchDao.getSortingBatch(vracBatch.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
+ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
if (benthosBatch != null) {
result.setBenthosTotalSampleSortedWeight(benthosBatch.getWeight());
result.setBenthosTotalSortedWeight(benthosBatch.getWeightBeforeSampling());
@@ -159,19 +160,19 @@
// Hors Vrac
SortingBatch horsVracBatch = catchBatchDao.getSortingBatch(source.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID);
+ "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID);
if (horsVracBatch != null) {
result.setCatchTotalUnsortedWeight(horsVracBatch.getWeight());
{
// Species
SortingBatch speciesBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
if (speciesBatch != null) {
result.setSpeciesTotalUnsortedWeight(speciesBatch.getWeight());
}
SortingBatch benthosBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
+ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
if (benthosBatch != null) {
result.setBenthosTotalUnsortedWeight(benthosBatch.getWeight());
}
@@ -182,7 +183,7 @@
// Non trié
SortingBatch unsortedBatch = catchBatchDao.getSortingBatch(source.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_UNSORTED_ID);
+ "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_UNSORTED_ID);
if (unsortedBatch != null) {
result.setCatchTotalRejectedWeight(unsortedBatch.getWeight());
}
@@ -206,8 +207,8 @@
getCurrentSession().flush();
Integer fishingOperationId = Integer.valueOf(bean.getFishingOperation().getId());
int rowUpdated = queryUpdate("updateFishingOperationCatchBatch",
- "fishingOperationId", IntegerType.INSTANCE, fishingOperationId,
- "catchBatchId", IntegerType.INSTANCE, catchBatch.getId());
+ "fishingOperationId", IntegerType.INSTANCE, fishingOperationId,
+ "catchBatchId", IntegerType.INSTANCE, catchBatch.getId());
if (rowUpdated == 0) {
throw new DataIntegrityViolationException("Could not attach catch batch to the given operation : operation was not found.");
}
@@ -248,12 +249,12 @@
// Vrac / Species
SortingBatch vracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
- "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+ "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
+ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
// container of speciesBatch is arbitraty put on vrac type (there is
// no common ancestor for all species batch).
- BatchContainer result = new BatchContainer<SpeciesBatch>();
+ BatchContainer<SpeciesBatch> result = new BatchContainer<SpeciesBatch>();
result.setId(String.valueOf(vracSpeciesBatch.getId()));
for (Batch batch1 : vracSpeciesBatch.getChildBatchs()) {
@@ -261,8 +262,8 @@
// evict some special batches : Life (or Biota) and Inert
if (source.getReferenceTaxon() != null
- && !enumeration.REFERENCE_TAXON_ID_LIFE.equals(source.getReferenceTaxon().getId())
- && !enumeration.REFERENCE_TAXON_ID_INERT.equals(source.getReferenceTaxon().getId())) {
+ && !enumeration.REFERENCE_TAXON_ID_LIFE.equals(source.getReferenceTaxon().getId())
+ && !enumeration.REFERENCE_TAXON_ID_INERT.equals(source.getReferenceTaxon().getId())) {
SpeciesBatch target = new SpeciesBatch();
entityToBean(source, target);
@@ -272,8 +273,8 @@
// Hors-Vrac / Species
SortingBatch horsVracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID,
- "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+ "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID,
+ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
if (horsVracSpeciesBatch != null) {
for (Batch batch : horsVracSpeciesBatch.getChildBatchs()) {
SortingBatch source = (SortingBatch) batch;
@@ -487,35 +488,36 @@
//------------------------------------------------------------------------//
@Override
- public List<SpeciesBatch> getAllRootBenthosBatch(String fishingOperationId) {
+ public BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId) {
// Load batch tree
Integer catchBatchId = catchBatchDao.getIdByFishingOperationId(Integer.valueOf(fishingOperationId));
fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId);
- List<SpeciesBatch> result = new ArrayList<SpeciesBatch>();
-
// Vrac / Benthos
SortingBatch vracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
- "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
+ "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
+ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
+
+ BatchContainer<SpeciesBatch> result = new BatchContainer<SpeciesBatch>();
+ result.setId(String.valueOf(vracSpeciesBatch.getId()));
for (Batch batch1 : vracSpeciesBatch.getChildBatchs()) {
SortingBatch source = (SortingBatch) batch1;
// evict some special batches : Life (or Biota) and Inert
if (source.getReferenceTaxon() != null
- && !enumeration.REFERENCE_TAXON_ID_LIFE.equals(source.getReferenceTaxon().getId())
- && !enumeration.REFERENCE_TAXON_ID_INERT.equals(source.getReferenceTaxon().getId())) {
+ && !enumeration.REFERENCE_TAXON_ID_LIFE.equals(source.getReferenceTaxon().getId())
+ && !enumeration.REFERENCE_TAXON_ID_INERT.equals(source.getReferenceTaxon().getId())) {
SpeciesBatch target = new SpeciesBatch();
entityToBean(source, target);
- result.add(target);
+ result.addChildren(target);
}
}
// Hors-Vrac / Benthos
SortingBatch horsVracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
- "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID,
- "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
+ "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID,
+ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
if (horsVracSpeciesBatch != null) {
for (Batch batch : horsVracSpeciesBatch.getChildBatchs()) {
SortingBatch source = (SortingBatch) batch;
@@ -523,10 +525,10 @@
SpeciesBatch target = new SpeciesBatch();
entityToBean(source, target);
- result.add(target);
+ result.addChildren(target);
}
}
- return Collections.unmodifiableList(result);
+ return result;
}
@Override
@@ -607,8 +609,8 @@
}
int rowUpdated = queryUpdate("updateBatchSpecies",
- "batchId", IntegerType.INSTANCE, Integer.valueOf(batchId),
- "referenceTaxonId", IntegerType.INSTANCE, species.getReferenceTaxonId());
+ "batchId", IntegerType.INSTANCE, Integer.valueOf(batchId),
+ "referenceTaxonId", IntegerType.INSTANCE, species.getReferenceTaxonId());
Preconditions.checkArgument(rowUpdated == 1, "Unable to update operation, to be linked with catch batch.");
}
@@ -838,8 +840,8 @@
// If parent and root need to be set
if (target.getId() == null
- || target.getRootBatch() == null
- || (target.getParentBatch() != null && !target.getParentBatch().getId().toString().equals(parentBatchId))) {
+ || target.getRootBatch() == null
+ || (target.getParentBatch() != null && !target.getParentBatch().getId().toString().equals(parentBatchId))) {
setBatchParents(source, target, parentBatchId, catchBatch);
}
@@ -863,11 +865,11 @@
// Nothing to do : will be removed later, using notChangedSortingMeasurements
} else if (source.getSampleCategoryWeight() != null && source.getWeight() == null) {
QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getSampleCategoryWeight(), true);
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getSampleCategoryWeight(), true);
notChangedQuantificationMeasurements.remove(quantificationMeasurement);
} else if (source.getWeight() != null && source.getSampleCategoryWeight() == null) {
QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
notChangedQuantificationMeasurements.remove(quantificationMeasurement);
}
@@ -881,7 +883,7 @@
target.setSamplingRatioText(samplingRatioText);
target.setSamplingRatio(source.getWeight() / source.getSampleCategoryWeight());
QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
notChangedQuantificationMeasurements.remove(quantificationMeasurement);
}
@@ -893,7 +895,7 @@
// Do not store sorting measurement if pmfm = SORTED (already store in an ancestor batch)
if (!pmfmId.equals(enumeration.PMFM_ID_SORTED_UNSORTED)) {
SortingMeasurement sortingMeasurement = setSortingMeasurement(target, recorderDepartmentId,
- source.getSampleCategoryType(), source.getSampleCategoryValue());
+ source.getSampleCategoryType(), source.getSampleCategoryValue());
notChangedSortingMeasurements.remove(sortingMeasurement);
}
}
@@ -969,8 +971,8 @@
Integer qualitativeValueId = convertSampleCategoryValueIntoQualitativeId(source.getSampleCategoryValue());
parentBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
- "pmfmId", pmfmId, qualitativeValueId,
- "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+ "pmfmId", pmfmId, qualitativeValueId,
+ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
// Parent Batch
target.setParentBatch(parentBatch);
@@ -1053,8 +1055,8 @@
// If parent and root need to be set
if (target.getId() == null
- || target.getRootBatch() == null
- || (target.getParentBatch() != null && !target.getParentBatch().getId().equals(parentBatch.getId()))) {
+ || target.getRootBatch() == null
+ || (target.getParentBatch() != null && !target.getParentBatch().getId().equals(parentBatch.getId()))) {
target.setParentBatch(parentBatch);
target.setRootBatch(parentBatch.getRootBatch());
@@ -1068,7 +1070,7 @@
// Nothing to do : will be removed later, using notChangedSortingMeasurements
} else if (source.getWeight() != null) {
QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
notChangedQuantificationMeasurements.remove(quantificationMeasurement);
}
@@ -1078,7 +1080,7 @@
} else if (source.getLengthStepCaracteristic() != null && source.getLengthStep() != null) {
Integer pmfmId = Integer.valueOf(source.getLengthStepCaracteristic().getId());
SortingMeasurement sortingMeasurement = setSortingMeasurement(target, recorderDepartmentId, pmfmId,
- source.getLengthStep());
+ source.getLengthStep());
notChangedSortingMeasurements.remove(sortingMeasurement);
}
@@ -1173,7 +1175,7 @@
// Nothing to do : will be removed later, using notChangedQuantificationMeasurements
} else if (source.getCatchTotalWeight() != null) {
QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getCatchTotalWeight(), true);
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getCatchTotalWeight(), true);
notChangedQuantificationMeasurements.remove(quantificationMeasurement);
}
@@ -1195,9 +1197,9 @@
target.getChildBatchs().add(batch);
}
beanToEntitySortingBatch(target, target, batch, recorderDepartmentId,
- enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
- source.getCatchTotalSortedCarousselWeight(), source.getCatchTotalSortedTremisWeight(),
- copyIfNull);
+ enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
+ source.getCatchTotalSortedCarousselWeight(), source.getCatchTotalSortedTremisWeight(),
+ copyIfNull);
batch.setRankOrder((short) 1);
// Manage childs :
@@ -1217,9 +1219,9 @@
}
}
beanToEntitySortingBatch(target, batch, speciesBatch, recorderDepartmentId,
- enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES,
- source.getSpeciesTotalSampleSortedWeight(), source.getSpeciesTotalSortedWeight(),
- copyIfNull);
+ enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES,
+ source.getSpeciesTotalSampleSortedWeight(), source.getSpeciesTotalSortedWeight(),
+ copyIfNull);
speciesBatch.setRankOrder((short) 1);
{
@@ -1236,9 +1238,9 @@
}
}
beanToEntityReferenceTaxonBatch(target, speciesBatch, aliveNotItemizedBatch, recorderDepartmentId,
- enumeration.REFERENCE_TAXON_ID_LIFE,
- source.getSpeciesTotalLivingNotItemizedWeight(), null,
- copyIfNull);
+ enumeration.REFERENCE_TAXON_ID_LIFE,
+ source.getSpeciesTotalLivingNotItemizedWeight(), null,
+ copyIfNull);
aliveNotItemizedBatch.setRankOrder((short) 1);
// -----------------------------------------------------------------------------
@@ -1250,9 +1252,9 @@
speciesBatch.getChildBatchs().add(inertBatch);
}
beanToEntityReferenceTaxonBatch(target, speciesBatch, inertBatch, recorderDepartmentId,
- enumeration.REFERENCE_TAXON_ID_INERT,
- source.getSpeciesTotalInertWeight(), null,
- copyIfNull);
+ enumeration.REFERENCE_TAXON_ID_INERT,
+ source.getSpeciesTotalInertWeight(), null,
+ copyIfNull);
inertBatch.setRankOrder((short) 2);
}
@@ -1266,9 +1268,9 @@
batch.getChildBatchs().add(benthosBatch);
}
beanToEntitySortingBatch(target, batch, benthosBatch, recorderDepartmentId,
- enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS,
- source.getBenthosTotalSampleSortedWeight(), source.getBenthosTotalSortedWeight(),
- copyIfNull);
+ enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS,
+ source.getBenthosTotalSampleSortedWeight(), source.getBenthosTotalSortedWeight(),
+ copyIfNull);
benthosBatch.setRankOrder((short) 2);
}
@@ -1286,9 +1288,9 @@
target.getChildBatchs().add(batch);
}
beanToEntitySortingBatch(target, target, batch, recorderDepartmentId,
- enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID,
- source.getCatchTotalUnsortedWeight(), null,
- copyIfNull);
+ enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID,
+ source.getCatchTotalUnsortedWeight(), null,
+ copyIfNull);
batch.setRankOrder((short) 2);
// Manage childs :
@@ -1309,9 +1311,9 @@
}
}
beanToEntitySortingBatch(target, batch, speciesBatch, recorderDepartmentId,
- enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES,
- source.getSpeciesTotalUnsortedWeight(), null,
- copyIfNull);
+ enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES,
+ source.getSpeciesTotalUnsortedWeight(), null,
+ copyIfNull);
speciesBatch.setRankOrder((short) 1);
}
@@ -1325,9 +1327,9 @@
batch.getChildBatchs().add(benthosBatch);
}
beanToEntitySortingBatch(target, batch, benthosBatch, recorderDepartmentId,
- enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS,
- source.getBenthosTotalUnsortedWeight(), null,
- copyIfNull);
+ enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS,
+ source.getBenthosTotalUnsortedWeight(), null,
+ copyIfNull);
benthosBatch.setRankOrder((short) 2);
}
@@ -1346,9 +1348,9 @@
target.getChildBatchs().add(unsortedBatch);
}
beanToEntitySortingBatch(target, target, unsortedBatch, recorderDepartmentId,
- enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_UNSORTED_ID,
- source.getCatchTotalRejectedWeight(), null,
- copyIfNull);
+ enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_UNSORTED_ID,
+ source.getCatchTotalRejectedWeight(), null,
+ copyIfNull);
unsortedBatch.setRankOrder((short) 3);
}
@@ -1452,7 +1454,7 @@
batchReferenceWeight = sampleWeight;
}
QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, batchReferenceWeight, true);
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, batchReferenceWeight, true);
notChangedQuantificationMeasurements.remove(quantificationMeasurement);
}
@@ -1519,7 +1521,7 @@
batchReferenceWeight = sampleWeight;
}
QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, batchReferenceWeight, true);
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, batchReferenceWeight, true);
notChangedQuantificationMeasurements.remove(quantificationMeasurement);
}
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceWriteTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceWriteTest.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceWriteTest.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -855,7 +855,7 @@
}
protected SpeciesBatch getBenthosBatch(String fishingOperationId, String speciesBatchId) {
- return getSpeciesBatch(speciesBatchId, service.getAllRootBenthosBatch(fishingOperationId));
+ return getSpeciesBatch(speciesBatchId, service.getRootBenthosBatch(fishingOperationId));
}
protected SpeciesBatch getSpeciesBatch(String speciesBatchId, List<SpeciesBatch> speciesBatchs) {
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -681,8 +681,8 @@
//------------------------------------------------------------------------//
@Override
- public List<SpeciesBatch> getAllRootBenthosBatch(String fishingOperationId) {
- return driver.getAllRootBenthosBatch(fishingOperationId);
+ public BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId) {
+ return driver.getRootBenthosBatch(fishingOperationId);
}
@Override
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-03-20 23:23:30 UTC (rev 662)
@@ -108,7 +108,7 @@
tutti.editProtocol.field.vesselUseFeature.help=editProtocol.html\#fields
tutti.editProtocol.help=editProtocol.html
tutti.editProtocol.pane.caracteristic.help=editProtocol.html\#fields
-tutti.editSpeciesBatch.action.createMelag.help=editSpeciesBatch.html\#actions
+tutti.editSpeciesBatch.action.createSpeciesMelag.help=editSpeciesBatch.html\#actions
tutti.editSpeciesBatch.action.createSpeciesBatch.help=editSpeciesBatch.html\#actions
tutti.editSpeciesBatch.action.removeSpeciesBatch.help=editSpeciesBatch.html\#actions
tutti.editSpeciesBatch.action.removeSpeciesSubBatch.help=editSpeciesBatch.html\#actions
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-03-20 23:23:30 UTC (rev 662)
@@ -108,7 +108,7 @@
tutti.editProtocol.field.vesselUseFeature.help=editProtocol.html\#fields
tutti.editProtocol.help=editProtocol.html
tutti.editProtocol.pane.caracteristic.help=editProtocol.html\#fields
-tutti.editSpeciesBatch.action.createMelag.help=editSpeciesBatch.html\#actions
+tutti.editSpeciesBatch.action.createSpeciesMelag.help=editSpeciesBatch.html\#actions
tutti.editSpeciesBatch.action.createSpeciesBatch.help=editSpeciesBatch.html\#actions
tutti.editSpeciesBatch.action.removeSpeciesBatch.help=editSpeciesBatch.html\#actions
tutti.editSpeciesBatch.action.removeSpeciesSubBatch.help=editSpeciesBatch.html\#actions
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDataContext.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDataContext.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDataContext.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -25,8 +25,11 @@
*/
import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
+import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
@@ -40,7 +43,9 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.Closeable;
+import java.util.Collections;
import java.util.List;
+import java.util.Map;
/**
* Data context of ui.
@@ -52,7 +57,9 @@
*/
public class TuttiDataContext implements Closeable {
- /** Logger. */
+ /**
+ * Logger.
+ */
private static final Log log = LogFactory.getLog(TuttiDataContext.class);
protected Program program;
@@ -63,10 +70,14 @@
protected List<Caracteristic> caracteristics;
+ protected List<Caracteristic> lengthStepCaracteristics;
+
protected List<Person> persons;
protected List<Species> species;
+ protected List<Species> referentSpeciesWithSurveyCode;
+
protected List<Species> referentSpecies;
protected List<Vessel> fishingVessels;
@@ -98,7 +109,7 @@
this.uiContext.addPropertyChangeListener(TuttiUIContext.PROPERTY_PROTOCOL_ID, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
- protocol = null;
+ resetProtocol();
resetSpecies();
}
});
@@ -156,6 +167,73 @@
return caracteristics;
}
+ public List<Caracteristic> getLengthStepCaracteristics() {
+ if (lengthStepCaracteristics == null) {
+
+ if (uiContext.isProtocolFilled()) {
+
+ // get loaded protocol
+ protocol = getProtocol();
+ lengthStepCaracteristics = Lists.newArrayListWithCapacity(
+ protocol.sizeLengthClassesPmfmId());
+
+ Map<String, Caracteristic> allCaractericsById =
+ TuttiEntities.splitById(getCaracteristics());
+
+ if (!protocol.isLengthClassesPmfmIdEmpty()) {
+ for (String id : protocol.getLengthClassesPmfmId()) {
+ lengthStepCaracteristics.add(allCaractericsById.get(id));
+ }
+ }
+ } else {
+ lengthStepCaracteristics = Lists.newArrayList(
+ getCaracteristics());
+ }
+
+ lengthStepCaracteristics = Collections.unmodifiableList(lengthStepCaracteristics);
+ }
+ return lengthStepCaracteristics;
+ }
+
+ public List<Species> getReferentSpeciesWithSurveyCode() {
+ if (referentSpeciesWithSurveyCode == null) {
+
+ if (uiContext.isProtocolFilled()) {
+
+ // get loaded protocol
+
+ TuttiProtocol protocol = getProtocol();
+ Preconditions.checkNotNull(protocol,
+ "Could not find protocol in ui context");
+
+ // fill available species from protocol
+
+ referentSpeciesWithSurveyCode = Lists.newArrayList();
+ if (!protocol.isSpeciesEmpty()) {
+
+ // split by taxonId
+ Map<String, Species> map = TuttiEntities.splitByTaxonId(getReferentSpecies());
+
+ for (SpeciesProtocol protocolSpecy : protocol.getSpecies()) {
+ String taxonId = String.valueOf(protocolSpecy.getSpeciesReferenceTaxonId());
+ Species species = map.get(taxonId);
+ species.setSurveyCode(protocolSpecy.getSpeciesSurveyCode());
+ referentSpeciesWithSurveyCode.add(species);
+ }
+ }
+
+ } else {
+
+ // no protocol, use default values
+
+ referentSpeciesWithSurveyCode = Lists.newArrayList(getReferentSpecies());
+
+ }
+ referentSpeciesWithSurveyCode = Collections.unmodifiableList(referentSpeciesWithSurveyCode);
+ }
+ return referentSpeciesWithSurveyCode;
+ }
+
public List<Species> getSpecies() {
if (species == null) {
if (log.isInfoEnabled()) {
@@ -241,13 +319,18 @@
service = null;
program = null;
cruise = null;
- program = null;
+ resetProtocol();
resetVessels();
resetGears();
resetPersons();
resetSpecies();
}
+ public void resetProtocol() {
+ protocol = null;
+ lengthStepCaracteristics = null;
+ }
+
public void resetGears() {
fishingGears = null;
scientificGears = null;
@@ -265,6 +348,7 @@
public void resetSpecies() {
species = null;
referentSpecies = null;
+ referentSpeciesWithSurveyCode = null;
}
public void resetCaracteristics() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -27,7 +27,6 @@
import fr.ifremer.tutti.TuttiBusinessException;
import fr.ifremer.tutti.service.PersistenceService;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategory;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -24,11 +24,15 @@
* #L%
*/
+import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Lists;
+import com.google.common.collect.Multimap;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
+import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
@@ -152,6 +156,14 @@
protected final List<Attachment> attachment = Lists.newArrayList();
+ /**
+ * Species already used in some batches.
+ *
+ * @since 0.3
+ */
+ protected final Multimap<CaracteristicQualitativeValue, Species>
+ speciesUsed = ArrayListMultimap.create();
+
public EditCatchesUIModel() {
super(CatchBatch.class, fromBeanBinder, toBeanBinder);
speciesTotalSortedComputedOrNotWeight.addPropertyChangeListener(
@@ -210,6 +222,10 @@
firePropertyChange(PROPERTY_FISHING_OPERATION, oldValue, fishingOperation);
}
+ public Multimap<CaracteristicQualitativeValue, Species> getSpeciesUsed() {
+ return speciesUsed;
+ }
+
public TuttiComputedOrNotData<Float> getCatchTotalComputedOrNotWeight() {
return catchTotalComputedOrNotWeight;
}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategory.java (from rev 661, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategory.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategory.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategory.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -0,0 +1,162 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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 org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+
+import java.io.Serializable;
+
+/**
+ * Represents a sample category value in the species batch table.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class SampleCategory<C extends Serializable> implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Sample category type.
+ *
+ * @since 0.3
+ */
+ protected SampleCategoryType categoryType;
+
+ /**
+ * Sample category value.
+ *
+ * @since 0.3
+ */
+ protected C categoryValue;
+
+ /**
+ * Sample category weight.
+ *
+ * @since 0.3
+ */
+ protected Float categoryWeight;
+
+ /**
+ * Sample computed weight.
+ *
+ * @since 1.0
+ */
+ protected Float computedWeight;
+
+ /**
+ * Is this sample a subsample ?
+ * Available only if the category is the finest category of the row
+ *
+ * @since 1.0
+ */
+ protected boolean subSample;
+
+ /**
+ * Has the row only one frequency ?
+ * Available only if the category is the finest category of the row
+ *
+ * @since 1.0
+ */
+ protected boolean onlyOneFrequency;
+
+ public static <C extends Serializable> SampleCategory<C> newSample(SampleCategoryType categoryType) {
+ SampleCategory<C> result = new SampleCategory<C>();
+ result.setCategoryType(categoryType);
+ return result;
+ }
+
+ protected SampleCategory() {
+ }
+
+ public SampleCategoryType getCategoryType() {
+ return categoryType;
+ }
+
+ public void setCategoryType(SampleCategoryType categoryType) {
+ this.categoryType = categoryType;
+ }
+
+ public C getCategoryValue() {
+ return categoryValue;
+ }
+
+ public void setCategoryValue(C categoryValue) {
+ this.categoryValue = categoryValue;
+ }
+
+ public Float getCategoryWeight() {
+ return categoryWeight;
+ }
+
+ public void setCategoryWeight(Float categoryWeight) {
+ this.categoryWeight = categoryWeight;
+ }
+
+ public Float getComputedWeight() {
+ return computedWeight;
+ }
+
+ public void setComputedWeight(Float computedWeight) {
+ this.computedWeight = computedWeight;
+ }
+
+ public boolean isSubSample() {
+ return subSample;
+ }
+
+ public void setSubSample(boolean subSample) {
+ this.subSample = subSample;
+ }
+
+ public boolean hasOnlyOneFrequency() {
+ return onlyOneFrequency;
+ }
+
+ public void setOnlyOneFrequency(boolean onlyOneFrequency) {
+ this.onlyOneFrequency = onlyOneFrequency;
+ }
+
+ public boolean isValid() {
+ return categoryValue != null;
+ }
+
+ public boolean isEmpty() {
+ return categoryValue == null
+ && categoryWeight == null
+ && computedWeight == null;
+ }
+
+ public boolean isEmptyOrValid() {
+ return isEmpty() || isValid();
+ }
+
+ @Override
+ public String toString() {
+ return new ReflectionToStringBuilder(this).
+ appendSuper(super.toString()).
+ toString();
+ }
+}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryColumnIdentifier.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryColumnIdentifier.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryColumnIdentifier.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -0,0 +1,48 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
+import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.2
+ */
+public class SampleCategoryColumnIdentifier<R> extends ColumnIdentifier<R> {
+
+ private static final long serialVersionUID = 1L;
+
+ public static <R> SampleCategoryColumnIdentifier<R> newId(String propertyName,
+ String weightPropertyName,
+ SampleCategoryType sampleCategoryType,
+ String headerI18nKey,
+ String headerTipI18nKey) {
+ return new SampleCategoryColumnIdentifier<R>(propertyName,
+ weightPropertyName,
+ sampleCategoryType,
+ headerI18nKey,
+ headerTipI18nKey);
+ }
+
+ private final SampleCategoryType sampleCategoryType;
+
+ private final String weightPropertyName;
+
+ SampleCategoryColumnIdentifier(String propertyName,
+ String weightPropertyName,
+ SampleCategoryType sampleCategoryType,
+ String headerI18nKey,
+ String headerTipI18nKey
+ ) {
+ super(propertyName, headerI18nKey, headerTipI18nKey);
+ this.weightPropertyName = weightPropertyName;
+ this.sampleCategoryType = sampleCategoryType;
+ }
+
+ public void setWeightValue(R entry, Object value) {
+ TuttiUIUtil.setProperty(entry, weightPropertyName, value);
+ }
+
+ public SampleCategoryType getSampleCategoryType() {
+ return sampleCategoryType;
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryColumnIdentifier.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryComponent.java (from rev 661, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryComponent.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryComponent.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryComponent.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -0,0 +1,271 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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.util.TuttiUIUtil;
+import jaxx.runtime.JAXXUtil;
+import jaxx.runtime.swing.editor.NumberEditor;
+import org.nuiton.util.decorator.Decorator;
+
+import javax.swing.AbstractCellEditor;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTable;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+import javax.swing.event.AncestorEvent;
+import javax.swing.event.AncestorListener;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.io.Serializable;
+
+/**
+ * To render and edit a {@link SampleCategory}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class SampleCategoryComponent {
+
+ public static <C extends Serializable> TableCellRenderer newRender(
+ TableCellRenderer renderer,
+ Decorator<C> decorator,
+ Color computedDataColor) {
+ return new SampleCategoryRenderer<C>(renderer, decorator, computedDataColor);
+ }
+
+ public static <C extends Serializable> TableCellEditor newEditor(Decorator<C> decorator) {
+ return new SampleCategoryEditor<C>(decorator);
+ }
+
+ /**
+ * SampleCategory cell editor.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+ public static class SampleCategoryEditor<C extends Serializable> extends AbstractCellEditor
+ implements TableCellEditor, FocusListener, AncestorListener {
+
+ private static final long serialVersionUID = 1L;
+
+ protected final NumberEditor numberEditor;
+
+ protected final JPanel editor;
+
+ protected final JLabel editorLabel;
+
+ protected final Decorator<C> categoryDecorator;
+
+ public SampleCategoryEditor(Decorator<C> categoryDecorator) {
+ this.categoryDecorator = categoryDecorator;
+ numberEditor = new NumberEditor();
+ numberEditor.getTextField().setHorizontalAlignment(SwingConstants.RIGHT);
+ numberEditor.getTextField().setBorder(null);
+ numberEditor.getTextField().addFocusListener(this);
+ numberEditor.getTextField().addAncestorListener(this);
+ numberEditor.setModelType(Float.class);
+ numberEditor.setUseSign(false);
+ numberEditor.init();
+
+ editor = new JPanel(new BorderLayout());
+ editor.add(BorderLayout.WEST, editorLabel = new JLabel());
+ editor.add(BorderLayout.CENTER, numberEditor);
+ }
+
+ @Override
+ public Component getTableCellEditorComponent(JTable table,
+ Object value,
+ boolean isSelected,
+ int row,
+ int column) {
+
+ SampleCategory<C> sampleCategory = (SampleCategory<C>) value;
+
+ C categoryValue = sampleCategory == null ? null : sampleCategory.getCategoryValue();
+ Float number = sampleCategory == null ? null : sampleCategory.getCategoryWeight();
+
+ numberEditor.setModel(number);
+
+ // Check nullity and set the text that will be selected with the current value
+ if (number == null) {
+ numberEditor.setModelText("");
+ } else {
+ numberEditor.setModelText(String.valueOf(number));
+ }
+
+ String label = sampleCategory == null ? "-" :
+ categoryDecorator.toString(categoryValue);
+
+ editorLabel.setText(label);
+ return editor;
+ }
+
+ @Override
+ public Float getCellEditorValue() {
+ return (Float) numberEditor.getModel();
+ }
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ numberEditor.getTextField().requestFocus();
+ numberEditor.getTextField().selectAll();
+ }
+ });
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ }
+
+ @Override
+ public void ancestorAdded(AncestorEvent event) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ numberEditor.getTextField().requestFocus();
+ numberEditor.getTextField().selectAll();
+ }
+ });
+ }
+
+ @Override
+ public void ancestorRemoved(AncestorEvent event) {
+ }
+
+ @Override
+ public void ancestorMoved(AncestorEvent event) {
+ }
+
+ @Override
+ public boolean stopCellEditing() {
+ boolean result = super.stopCellEditing();
+ // Reset previous data to avoid keeping it on other cell edition
+ if (result) {
+ resetEditor();
+ }
+ return result;
+ }
+
+ @Override
+ public void cancelCellEditing() {
+ resetEditor();
+ super.cancelCellEditing();
+ }
+
+ protected void resetEditor() {
+ numberEditor.setModel(null);
+ // Use empty string, otherwise there is a NPE in NumberEditorHandler
+ numberEditor.setModelText("");
+ editorLabel.setText("-");
+ }
+ }
+
+ /**
+ * To render a {@link SampleCategory} in a table cell.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+ public static class SampleCategoryRenderer<C extends Serializable> implements TableCellRenderer {
+
+ protected final TableCellRenderer delegate;
+
+ protected final Decorator<C> categoryDecorator;
+
+ protected final Color computedWeightColor;
+
+ public SampleCategoryRenderer(TableCellRenderer delegate,
+ Decorator<C> categoryDecorator,
+ Color computedWeightColor) {
+ this.delegate = delegate;
+ this.categoryDecorator = categoryDecorator;
+ this.computedWeightColor = computedWeightColor;
+ }
+
+ @Override
+ public Component getTableCellRendererComponent(JTable table,
+ Object value,
+ boolean isSelected,
+ boolean hasFocus,
+ int row,
+ int column) {
+
+ SampleCategory<C> sampleCategory = (SampleCategory<C>) value;
+
+ String text = null;
+ if (sampleCategory != null) {
+ C categoryValue = sampleCategory.getCategoryValue();
+ if (categoryValue != null) {
+ Float number = sampleCategory.getCategoryWeight();
+ Float computedNumber = sampleCategory.getComputedWeight();
+
+ text = "<html><span style='white-space: nowrap;'>" + categoryDecorator.toString(categoryValue) + " /";
+
+ if (sampleCategory.isSubSample()) {
+ text += "/";
+ }
+ text += " ";
+
+ if (number != null) {
+ text += JAXXUtil.getStringValue(number);
+
+ } else if (computedNumber != null) {
+ if (sampleCategory.hasOnlyOneFrequency()) {
+ text += TuttiUIUtil.getWeightStringValue(computedNumber);
+
+ } else {
+ String color = Integer.toHexString(computedWeightColor.getRGB()).substring(2);
+ text += "<em style='color: #" + color + "'>" +
+ TuttiUIUtil.getWeightStringValue(computedNumber) + "</em>";
+ }
+ } else {
+ text += "-";
+ }
+
+ text += "</span></html>";
+ }
+ }
+
+ JComponent result =
+ (JComponent) delegate.getTableCellRendererComponent(table,
+ text,
+ isSelected,
+ hasFocus,
+ row,
+ column);
+ result.setToolTipText(text);
+
+ return result;
+ }
+ }
+}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryType.java (from rev 661, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryType.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryType.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryType.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -0,0 +1,98 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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 com.google.common.collect.Maps;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
+import fr.ifremer.tutti.service.DecoratorService;
+
+import java.util.EnumMap;
+
+import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * All sample category types.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public enum SampleCategoryType implements DecoratorService.LabelAware {
+ sortedUnsorted(
+ n_("tutti.sampleCategoryType.sortedUnsorted"),
+ SampleCategoryEnum.sortedUnsorted),
+ size(
+ n_("tutti.sampleCategoryType.size"),
+ SampleCategoryEnum.size),
+ sex(
+ n_("tutti.sampleCategoryType.sex"),
+ SampleCategoryEnum.sex),
+ maturity(
+ n_("tutti.sampleCategoryType.maturity"),
+ SampleCategoryEnum.maturity),
+ age(
+ n_("tutti.sampleCategoryType.age"),
+ SampleCategoryEnum.age);
+
+ private final String i18nKey;
+
+ private final SampleCategoryEnum type;
+
+ private SampleCategoryType(String i18nKey, SampleCategoryEnum type) {
+ this.i18nKey = i18nKey;
+ this.type = type;
+ }
+
+ @Override
+ public String getLabel() {
+ return _(i18nKey);
+ }
+
+ public SampleCategoryEnum getType() {
+ return type;
+ }
+
+ public static SampleCategoryType valueOf(SampleCategoryEnum type) {
+ SampleCategoryType result = enumToType.get(type);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return getLabel();
+ }
+
+ public static final EnumMap<SampleCategoryEnum, SampleCategoryType> enumToType;
+
+ static {
+ enumToType = Maps.newEnumMap(SampleCategoryEnum.class);
+ enumToType.put(SampleCategoryEnum.sortedUnsorted, sortedUnsorted);
+ enumToType.put(SampleCategoryEnum.size, size);
+ enumToType.put(SampleCategoryEnum.sex, sex);
+ enumToType.put(SampleCategoryEnum.maturity, maturity);
+ enumToType.put(SampleCategoryEnum.age, age);
+
+ }
+}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/TableViewMode.java (from rev 661, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/TableViewMode.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/TableViewMode.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/TableViewMode.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -0,0 +1,52 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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%
+ */
+
+/**
+ * What to show in the species table?
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public enum TableViewMode {
+ /**
+ * Show all nodes of sampling.
+ *
+ * @since 0.3
+ */
+ ALL,
+ /**
+ * Show only leaves of sampling.
+ *
+ * @since 0.3
+ */
+ LEAF,
+ /**
+ * Show onlyroot nodes of sampling.
+ *
+ * @since 0.3
+ */
+ ROOT
+}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2013-03-20 23:23:30 UTC (rev 662)
@@ -27,6 +27,10 @@
<import>
fr.ifremer.tutti.ui.swing.TuttiUIContext
fr.ifremer.tutti.ui.swing.TuttiHelpBroker
+
+ fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode
+ fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType
+
fr.ifremer.tutti.ui.swing.util.TuttiUI
jaxx.runtime.swing.editor.NumberEditor
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -27,6 +27,7 @@
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.referential.Species;
@@ -58,7 +59,7 @@
LogFactory.getLog(BenthosBatchUIHandler.class);
public BenthosBatchUIHandler(TuttiUI<?, ?> parentUi,
- BenthosBatchUI ui) {
+ BenthosBatchUI ui) {
super(parentUi, ui,
BenthosBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM,
BenthosBatchRowModel.PROPERTY_SPECIES,
@@ -87,14 +88,15 @@
if (log.isInfoEnabled()) {
log.info("Get benthos batch for fishingOperation: " +
- bean.getId());
+ bean.getId());
}
rows = Lists.newArrayList();
if (!TuttiEntities.isNew(bean)) {
- List<SpeciesBatch> catches =
- persistenceService.getAllRootBenthosBatch(bean.getId());
- for (SpeciesBatch aBatch : catches) {
+ BatchContainer<SpeciesBatch> catches =
+ persistenceService.getRootBenthosBatch(bean.getId());
+ for (SpeciesBatch aBatch : catches.getChildren()
+ ) {
BenthosBatchRowModel entry =
new BenthosBatchRowModel(aBatch);
rows.add(entry);
@@ -126,16 +128,16 @@
@Override
protected void onRowModified(int rowIndex,
- BenthosBatchRowModel row,
- String propertyName,
- Object oldValue,
- Object newValue) {
+ BenthosBatchRowModel row,
+ String propertyName,
+ Object oldValue,
+ Object newValue) {
recomputeRowValidState(row);
}
@Override
protected void saveSelectedRowIfRequired(TuttiBeanMonitor<BenthosBatchRowModel> rowMonitor,
- BenthosBatchRowModel row) {
+ BenthosBatchRowModel row) {
if (row.isValid()) {
// there is a valid bean attached to the monitor
@@ -319,8 +321,7 @@
}
if (log.isInfoEnabled()) {
- log.info("Persist new benthos batch with parentId: " +
- parentBatchId);
+ log.info("Persist new benthos batch with parentId: " + parentBatchId);
}
catchBean = persistenceService.createBenthosBatch(catchBean, parentBatchId);
row.setId(catchBean.getId());
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -1,183 +0,0 @@
-
-package fr.ifremer.tutti.ui.swing.content.operation.catches.species;
-
-/*
- * #%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 com.google.common.collect.Maps;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
-import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
-import jaxx.runtime.SwingUtil;
-import org.apache.commons.lang3.StringUtils;
-
-import javax.swing.JOptionPane;
-import java.awt.Frame;
-import java.util.Map;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * @author kmorin <kmorin(a)codelutin.com>
- * @since 1.0.2
- */
-public class CreateMelagAction extends AbstractTuttiAction<SpeciesBatchUIModel, SpeciesBatchUI, SpeciesBatchUIHandler> {
-
- protected Map<SpeciesBatchRowModel, Float> selectedRows = Maps.newHashMap();
-
- protected Float melagWeight = null;
-
- protected Float sampleMelagWeight = null;
-
- protected Float sortedWeight = null;
-
- public CreateMelagAction(SpeciesBatchUIHandler handler) {
- super(handler, false);
- }
-
- @Override
- protected boolean prepareAction() throws Exception {
- boolean result = super.prepareAction();
-
- int[] selectedRowIndexes = handler.getTable().getSelectedRows();
-
- SpeciesBatchTableModel tableModel = handler.getTableModel();
-
- // sum of the weights already entered by the user
- Float alreadyKnownWeights = 0f;
- sortedWeight = 0f;
-
- for (int selectedRowIndex : selectedRowIndexes) {
- SpeciesBatchRowModel selectedRow =
- tableModel.getEntry(selectedRowIndex);
-
- Float sampleWeight = null;
- if (selectedRow.getFinestCategory().getCategoryWeight() != null) {
- alreadyKnownWeights += selectedRow.getFinestCategory().getCategoryWeight();
-
- } else if (selectedRow.getFinestCategory().getComputedWeight() != null) {
- alreadyKnownWeights += selectedRow.getFinestCategory().getComputedWeight();
-
- } else if (selectedRow.getWeight() != null) {
- sampleWeight = selectedRow.getWeight();
-
- } else {
- sampleWeight = 0f;
- if (selectedRow.getFrequency() != null) {
- for (SpeciesFrequencyRowModel frequency : selectedRow.getFrequency()) {
- if (frequency.getWeight() == null) {
- sampleWeight = 0f;
- break;
- }
- sampleWeight += frequency.getWeight();
- }
- }
- }
-
- if (sampleWeight != null) {
- if (sampleWeight == 0f) {
- JOptionPane.showMessageDialog(
- getUI(),
- _("tutti.createMelag.error.message", selectedRowIndex + 1),
- _("tutti.createMelag.error.title"),
- JOptionPane.ERROR_MESSAGE);
-
- handler.getTable().getSelectionModel().setSelectionInterval(selectedRowIndex, selectedRowIndex);
- result = false;
- break;
-
- } else {
- sortedWeight += sampleWeight;
- }
- }
-
- selectedRows.put(selectedRow, sampleWeight);
- }
-
- if (result) {
- melagWeight = openMelagWeightDialog();
-
- if (melagWeight != null) {
- // substract the weights that the user already entered
- // they must not be used to compute the other weights
- sampleMelagWeight = melagWeight - alreadyKnownWeights;
- }
- }
-
- return result && melagWeight != null;
- }
-
- protected Float openMelagWeightDialog() {
- Frame frame = SwingUtil.getParentContainer(getUI(), Frame.class);
-
- final EnterMelagWeightDialog dialog = new EnterMelagWeightDialog(frame,
- getConfig().getShortcutClosePopup());
- SwingUtil.center(frame, dialog);
- dialog.pack();
- dialog.setVisible(true);
-
- Float result = null;
- if (dialog.getEditor().getModel() != null) {
- result = dialog.getEditor().getModel().floatValue();
- }
- return result;
- }
-
- @Override
- protected void doAction() throws Exception {
- for (SpeciesBatchRowModel batch : selectedRows.keySet()) {
- Float sampleWeight = selectedRows.get(batch);
- if (sampleWeight != null) {
- Float weight = sampleMelagWeight * sampleWeight / sortedWeight;
- batch.getFinestCategory().setCategoryWeight(weight);
- }
- String comment = batch.getComment();
- if (StringUtils.isBlank(comment)) {
- comment = "";
-
- } else {
- comment += "\n";
- }
- comment += "issu d'un MELAG de " + melagWeight + "kg";
- batch.setComment(comment);
- }
- getHandler().saveRows(selectedRows.keySet());
- }
-
- @Override
- protected void releaseAction() {
- super.releaseAction();
- //FIXME-TC No release action is not design to refresh ui...
-// getHandler().getTable().repaint();
- selectedRows.clear();
- melagWeight = null;
- sortedWeight = null;
- }
-
- @Override
- public void postSuccessAction() {
- super.postSuccessAction();
- getHandler().getTable().repaint();
-
- }
-}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateSpeciesMelagAction.java (from rev 661, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateSpeciesMelagAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateSpeciesMelagAction.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -0,0 +1,183 @@
+
+package fr.ifremer.tutti.ui.swing.content.operation.catches.species;
+
+/*
+ * #%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 com.google.common.collect.Maps;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
+import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
+import jaxx.runtime.SwingUtil;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.swing.JOptionPane;
+import java.awt.Frame;
+import java.util.Map;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.0.2
+ */
+public class CreateSpeciesMelagAction extends AbstractTuttiAction<SpeciesBatchUIModel, SpeciesBatchUI, SpeciesBatchUIHandler> {
+
+ protected Map<SpeciesBatchRowModel, Float> selectedRows = Maps.newHashMap();
+
+ protected Float melagWeight = null;
+
+ protected Float sampleMelagWeight = null;
+
+ protected Float sortedWeight = null;
+
+ public CreateSpeciesMelagAction(SpeciesBatchUIHandler handler) {
+ super(handler, false);
+ }
+
+ @Override
+ protected boolean prepareAction() throws Exception {
+ boolean result = super.prepareAction();
+
+ int[] selectedRowIndexes = handler.getTable().getSelectedRows();
+
+ SpeciesBatchTableModel tableModel = handler.getTableModel();
+
+ // sum of the weights already entered by the user
+ Float alreadyKnownWeights = 0f;
+ sortedWeight = 0f;
+
+ for (int selectedRowIndex : selectedRowIndexes) {
+ SpeciesBatchRowModel selectedRow =
+ tableModel.getEntry(selectedRowIndex);
+
+ Float sampleWeight = null;
+ if (selectedRow.getFinestCategory().getCategoryWeight() != null) {
+ alreadyKnownWeights += selectedRow.getFinestCategory().getCategoryWeight();
+
+ } else if (selectedRow.getFinestCategory().getComputedWeight() != null) {
+ alreadyKnownWeights += selectedRow.getFinestCategory().getComputedWeight();
+
+ } else if (selectedRow.getWeight() != null) {
+ sampleWeight = selectedRow.getWeight();
+
+ } else {
+ sampleWeight = 0f;
+ if (selectedRow.getFrequency() != null) {
+ for (SpeciesFrequencyRowModel frequency : selectedRow.getFrequency()) {
+ if (frequency.getWeight() == null) {
+ sampleWeight = 0f;
+ break;
+ }
+ sampleWeight += frequency.getWeight();
+ }
+ }
+ }
+
+ if (sampleWeight != null) {
+ if (sampleWeight == 0f) {
+ JOptionPane.showMessageDialog(
+ getUI(),
+ _("tutti.createMelag.error.message", selectedRowIndex + 1),
+ _("tutti.createMelag.error.title"),
+ JOptionPane.ERROR_MESSAGE);
+
+ handler.getTable().getSelectionModel().setSelectionInterval(selectedRowIndex, selectedRowIndex);
+ result = false;
+ break;
+
+ } else {
+ sortedWeight += sampleWeight;
+ }
+ }
+
+ selectedRows.put(selectedRow, sampleWeight);
+ }
+
+ if (result) {
+ melagWeight = openMelagWeightDialog();
+
+ if (melagWeight != null) {
+ // substract the weights that the user already entered
+ // they must not be used to compute the other weights
+ sampleMelagWeight = melagWeight - alreadyKnownWeights;
+ }
+ }
+
+ return result && melagWeight != null;
+ }
+
+ protected Float openMelagWeightDialog() {
+ Frame frame = SwingUtil.getParentContainer(getUI(), Frame.class);
+
+ final EnterMelagWeightDialog dialog = new EnterMelagWeightDialog(frame,
+ getConfig().getShortcutClosePopup());
+ SwingUtil.center(frame, dialog);
+ dialog.pack();
+ dialog.setVisible(true);
+
+ Float result = null;
+ if (dialog.getEditor().getModel() != null) {
+ result = dialog.getEditor().getModel().floatValue();
+ }
+ return result;
+ }
+
+ @Override
+ protected void doAction() throws Exception {
+ for (SpeciesBatchRowModel batch : selectedRows.keySet()) {
+ Float sampleWeight = selectedRows.get(batch);
+ if (sampleWeight != null) {
+ Float weight = sampleMelagWeight * sampleWeight / sortedWeight;
+ batch.getFinestCategory().setCategoryWeight(weight);
+ }
+ String comment = batch.getComment();
+ if (StringUtils.isBlank(comment)) {
+ comment = "";
+
+ } else {
+ comment += "\n";
+ }
+ comment += "issu d'un MELAG de " + melagWeight + "kg";
+ batch.setComment(comment);
+ }
+ getHandler().saveRows(selectedRows.keySet());
+ }
+
+ @Override
+ protected void releaseAction() {
+ super.releaseAction();
+ //FIXME-TC No release action is not design to refresh ui...
+// getHandler().getTable().repaint();
+ selectedRows.clear();
+ melagWeight = null;
+ sortedWeight = null;
+ }
+
+ @Override
+ public void postSuccessAction() {
+ super.postSuccessAction();
+ getHandler().getTable().repaint();
+
+ }
+}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RenameSpeciesBatchAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RenameSpeciesBatchAction.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RenameSpeciesBatchAction.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -59,7 +59,7 @@
SpeciesBatchRowModel row = tableModel.getEntry(table.getSelectedRow());
SpeciesBatchUIModel model = handler.getModel();
- List<Species> speciesList = Lists.newArrayList(model.getAllSpecies());
+ List<Species> speciesList = Lists.newArrayList(getDataContext().getReferentSpeciesWithSurveyCode());
speciesList.removeAll(
model.getSpeciesUsed().get(
row.getSortedUnsortedCategoryValue()));
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategory.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategory.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategory.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -1,162 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.species;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 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 org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-
-import java.io.Serializable;
-
-/**
- * Represents a sample category value in the species batch table.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class SampleCategory<C extends Serializable> implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Sample category type.
- *
- * @since 0.3
- */
- protected SampleCategoryType categoryType;
-
- /**
- * Sample category value.
- *
- * @since 0.3
- */
- protected C categoryValue;
-
- /**
- * Sample category weight.
- *
- * @since 0.3
- */
- protected Float categoryWeight;
-
- /**
- * Sample computed weight.
- *
- * @since 1.0
- */
- protected Float computedWeight;
-
- /**
- * Is this sample a subsample ?
- * Available only if the category is the finest category of the row
- *
- * @since 1.0
- */
- protected boolean subSample;
-
- /**
- * Has the row only one frequency ?
- * Available only if the category is the finest category of the row
- *
- * @since 1.0
- */
- protected boolean onlyOneFrequency;
-
- public static <C extends Serializable> SampleCategory<C> newSample(SampleCategoryType categoryType) {
- SampleCategory<C> result = new SampleCategory<C>();
- result.setCategoryType(categoryType);
- return result;
- }
-
- protected SampleCategory() {
- }
-
- public SampleCategoryType getCategoryType() {
- return categoryType;
- }
-
- public void setCategoryType(SampleCategoryType categoryType) {
- this.categoryType = categoryType;
- }
-
- public C getCategoryValue() {
- return categoryValue;
- }
-
- public void setCategoryValue(C categoryValue) {
- this.categoryValue = categoryValue;
- }
-
- public Float getCategoryWeight() {
- return categoryWeight;
- }
-
- public void setCategoryWeight(Float categoryWeight) {
- this.categoryWeight = categoryWeight;
- }
-
- public Float getComputedWeight() {
- return computedWeight;
- }
-
- public void setComputedWeight(Float computedWeight) {
- this.computedWeight = computedWeight;
- }
-
- public boolean isSubSample() {
- return subSample;
- }
-
- public void setSubSample(boolean subSample) {
- this.subSample = subSample;
- }
-
- public boolean hasOnlyOneFrequency() {
- return onlyOneFrequency;
- }
-
- public void setOnlyOneFrequency(boolean onlyOneFrequency) {
- this.onlyOneFrequency = onlyOneFrequency;
- }
-
- public boolean isValid() {
- return categoryValue != null;
- }
-
- public boolean isEmpty() {
- return categoryValue == null
- && categoryWeight == null
- && computedWeight == null;
- }
-
- public boolean isEmptyOrValid() {
- return isEmpty() || isValid();
- }
-
- @Override
- public String toString() {
- return new ReflectionToStringBuilder(this).
- appendSuper(super.toString()).
- toString();
- }
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryComponent.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryComponent.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -1,271 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.species;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 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.util.TuttiUIUtil;
-import jaxx.runtime.swing.editor.NumberEditor;
-import org.nuiton.util.decorator.Decorator;
-
-import javax.swing.AbstractCellEditor;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTable;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.event.AncestorEvent;
-import javax.swing.event.AncestorListener;
-import javax.swing.table.TableCellEditor;
-import javax.swing.table.TableCellRenderer;
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.io.Serializable;
-import javax.swing.JComponent;
-import jaxx.runtime.JAXXUtil;
-
-/**
- * To render and edit a {@link SampleCategory}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class SampleCategoryComponent {
-
- public static <C extends Serializable> TableCellRenderer newRender(
- TableCellRenderer renderer,
- Decorator<C> decorator,
- Color computedDataColor) {
- return new SampleCategoryRenderer<C>(renderer, decorator, computedDataColor);
- }
-
- public static <C extends Serializable> TableCellEditor newEditor(Decorator<C> decorator) {
- return new SampleCategoryEditor<C>(decorator);
- }
-
- /**
- * SampleCategory cell editor.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
- public static class SampleCategoryEditor<C extends Serializable> extends AbstractCellEditor
- implements TableCellEditor, FocusListener, AncestorListener {
-
- private static final long serialVersionUID = 1L;
-
- protected final NumberEditor numberEditor;
-
- protected final JPanel editor;
-
- protected final JLabel editorLabel;
-
- protected final Decorator<C> categoryDecorator;
-
- public SampleCategoryEditor(Decorator<C> categoryDecorator) {
- this.categoryDecorator = categoryDecorator;
- numberEditor = new NumberEditor();
- numberEditor.getTextField().setHorizontalAlignment(SwingConstants.RIGHT);
- numberEditor.getTextField().setBorder(null);
- numberEditor.getTextField().addFocusListener(this);
- numberEditor.getTextField().addAncestorListener(this);
- numberEditor.setModelType(Float.class);
- numberEditor.setUseSign(false);
- numberEditor.init();
-
- editor = new JPanel(new BorderLayout());
- editor.add(BorderLayout.WEST, editorLabel = new JLabel());
- editor.add(BorderLayout.CENTER, numberEditor);
- }
-
- @Override
- public Component getTableCellEditorComponent(JTable table,
- Object value,
- boolean isSelected,
- int row,
- int column) {
-
- SampleCategory<C> sampleCategory = (SampleCategory<C>) value;
-
- C categoryValue = sampleCategory == null ? null : sampleCategory.getCategoryValue();
- Float number = sampleCategory == null ? null : sampleCategory.getCategoryWeight();
-
- numberEditor.setModel(number);
-
- // Check nullity and set the text that will be selected with the current value
- if (number == null) {
- numberEditor.setModelText("");
- } else {
- numberEditor.setModelText(String.valueOf(number));
- }
-
- String label = sampleCategory == null ? "-" :
- categoryDecorator.toString(categoryValue);
-
- editorLabel.setText(label);
- return editor;
- }
-
- @Override
- public Float getCellEditorValue() {
- return (Float) numberEditor.getModel();
- }
-
- @Override
- public void focusGained(FocusEvent e) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- numberEditor.getTextField().requestFocus();
- numberEditor.getTextField().selectAll();
- }
- });
- }
-
- @Override
- public void focusLost(FocusEvent e) {
- }
-
- @Override
- public void ancestorAdded(AncestorEvent event) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- numberEditor.getTextField().requestFocus();
- numberEditor.getTextField().selectAll();
- }
- });
- }
-
- @Override
- public void ancestorRemoved(AncestorEvent event) {
- }
-
- @Override
- public void ancestorMoved(AncestorEvent event) {
- }
-
- @Override
- public boolean stopCellEditing() {
- boolean result = super.stopCellEditing();
- // Reset previous data to avoid keeping it on other cell edition
- if (result) {
- resetEditor();
- }
- return result;
- }
-
- @Override
- public void cancelCellEditing() {
- resetEditor();
- super.cancelCellEditing();
- }
-
- protected void resetEditor() {
- numberEditor.setModel(null);
- // Use empty string, otherwise there is a NPE in NumberEditorHandler
- numberEditor.setModelText("");
- editorLabel.setText("-");
- }
- }
-
- /**
- * To render a {@link SampleCategory} in a table cell.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
- public static class SampleCategoryRenderer<C extends Serializable> implements TableCellRenderer {
-
- protected final TableCellRenderer delegate;
-
- protected final Decorator<C> categoryDecorator;
-
- protected final Color computedWeightColor;
-
- public SampleCategoryRenderer(TableCellRenderer delegate,
- Decorator<C> categoryDecorator,
- Color computedWeightColor) {
- this.delegate = delegate;
- this.categoryDecorator = categoryDecorator;
- this.computedWeightColor = computedWeightColor;
- }
-
- @Override
- public Component getTableCellRendererComponent(JTable table,
- Object value,
- boolean isSelected,
- boolean hasFocus,
- int row,
- int column) {
-
- SampleCategory<C> sampleCategory = (SampleCategory<C>) value;
-
- String text = null;
- if (sampleCategory != null) {
- C categoryValue = sampleCategory.getCategoryValue();
- if (categoryValue != null) {
- Float number = sampleCategory.getCategoryWeight();
- Float computedNumber = sampleCategory.getComputedWeight();
-
- text = "<html><span style='white-space: nowrap;'>" + categoryDecorator.toString(categoryValue) + " /";
-
- if (sampleCategory.isSubSample()) {
- text += "/";
- }
- text += " ";
-
- if (number != null) {
- text += JAXXUtil.getStringValue(number);
-
- } else if (computedNumber != null) {
- if (sampleCategory.hasOnlyOneFrequency()) {
- text += TuttiUIUtil.getWeightStringValue(computedNumber);
-
- } else {
- String color = Integer.toHexString(computedWeightColor.getRGB()).substring(2);
- text += "<em style='color: #" + color + "'>" +
- TuttiUIUtil.getWeightStringValue(computedNumber) + "</em>";
- }
- } else {
- text += "-";
- }
-
- text += "</span></html>";
- }
- }
-
- JComponent result =
- (JComponent) delegate.getTableCellRendererComponent(table,
- text,
- isSelected,
- hasFocus,
- row,
- column);
- result.setToolTipText(text);
-
- return result;
- }
- }
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryType.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryType.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryType.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -1,98 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.species;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 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 com.google.common.collect.Maps;
-import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
-import fr.ifremer.tutti.service.DecoratorService;
-
-import java.util.EnumMap;
-
-import static org.nuiton.i18n.I18n._;
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * All sample category types.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public enum SampleCategoryType implements DecoratorService.LabelAware {
- sortedUnsorted(
- n_("tutti.sampleCategoryType.sortedUnsorted"),
- SampleCategoryEnum.sortedUnsorted),
- size(
- n_("tutti.sampleCategoryType.size"),
- SampleCategoryEnum.size),
- sex(
- n_("tutti.sampleCategoryType.sex"),
- SampleCategoryEnum.sex),
- maturity(
- n_("tutti.sampleCategoryType.maturity"),
- SampleCategoryEnum.maturity),
- age(
- n_("tutti.sampleCategoryType.age"),
- SampleCategoryEnum.age);
-
- private final String i18nKey;
-
- private final SampleCategoryEnum type;
-
- private SampleCategoryType(String i18nKey, SampleCategoryEnum type) {
- this.i18nKey = i18nKey;
- this.type = type;
- }
-
- @Override
- public String getLabel() {
- return _(i18nKey);
- }
-
- public SampleCategoryEnum getType() {
- return type;
- }
-
- public static SampleCategoryType valueOf(SampleCategoryEnum type) {
- SampleCategoryType result = enumToType.get(type);
- return result;
- }
-
- @Override
- public String toString() {
- return getLabel();
- }
-
- public static final EnumMap<SampleCategoryEnum, SampleCategoryType> enumToType;
-
- static {
- enumToType = Maps.newEnumMap(SampleCategoryEnum.class);
- enumToType.put(SampleCategoryEnum.sortedUnsorted, sortedUnsorted);
- enumToType.put(SampleCategoryEnum.size, size);
- enumToType.put(SampleCategoryEnum.sex, sex);
- enumToType.put(SampleCategoryEnum.maturity, maturity);
- enumToType.put(SampleCategoryEnum.age, age);
-
- }
-}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -30,9 +30,10 @@
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
-import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategory;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -26,7 +26,9 @@
import com.google.common.collect.Sets;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategory;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryColumnIdentifier;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
import org.jdesktop.swingx.table.TableColumnModelExt;
@@ -43,80 +45,40 @@
private static final long serialVersionUID = 1L;
- public static class SampleColumnIdentifier<R> extends ColumnIdentifier<R> {
-
- private static final long serialVersionUID = 1L;
-
- public static <R> SampleColumnIdentifier<R> newId(String propertyName,
- String weightPropertyName,
- SampleCategoryType sampleCategoryType,
- String headerI18nKey,
- String headerTipI18nKey) {
- return new SampleColumnIdentifier<R>(propertyName,
- weightPropertyName,
- sampleCategoryType,
- headerI18nKey,
- headerTipI18nKey);
- }
-
- private final SampleCategoryType sampleCategoryType;
-
- private final String weightPropertyName;
-
- protected SampleColumnIdentifier(String propertyName,
- String weightPropertyName,
- SampleCategoryType sampleCategoryType,
- String headerI18nKey,
- String headerTipI18nKey
- ) {
- super(propertyName, headerI18nKey, headerTipI18nKey);
- this.weightPropertyName = weightPropertyName;
- this.sampleCategoryType = sampleCategoryType;
- }
-
- public void setWeightValue(R entry, Object value) {
- TuttiUIUtil.setProperty(entry, weightPropertyName, value);
- }
-
- public SampleCategoryType getSampleCategoryType() {
- return sampleCategoryType;
- }
- }
-
public static final ColumnIdentifier<SpeciesBatchRowModel> SPECIES = ColumnIdentifier.newId(
SpeciesBatchRowModel.PROPERTY_SPECIES,
n_("tutti.editSpeciesBatch.table.header.species"),
n_("tutti.editSpeciesBatch.table.header.species"));
- public static final ColumnIdentifier<SpeciesBatchRowModel> SORTED_UNSORTED_CATEGORY = SampleColumnIdentifier.newId(
+ public static final ColumnIdentifier<SpeciesBatchRowModel> SORTED_UNSORTED_CATEGORY = SampleCategoryColumnIdentifier.newId(
SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY,
SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY_WEIGHT,
SampleCategoryType.sortedUnsorted,
n_("tutti.editSpeciesBatch.table.header.sortedUnsortedCategory"),
n_("tutti.editSpeciesBatch.table.header.sortedUnsortedCategory"));
- public static final ColumnIdentifier<SpeciesBatchRowModel> SIZE_CATEGORY = SampleColumnIdentifier.newId(
+ public static final ColumnIdentifier<SpeciesBatchRowModel> SIZE_CATEGORY = SampleCategoryColumnIdentifier.newId(
SpeciesBatchRowModel.PROPERTY_SIZE_CATEGORY,
SpeciesBatchRowModel.PROPERTY_SIZE_CATEGORY_WEIGHT,
SampleCategoryType.size,
n_("tutti.editSpeciesBatch.table.header.sizeCategory"),
n_("tutti.editSpeciesBatch.table.header.sizeCategory"));
- public static final ColumnIdentifier<SpeciesBatchRowModel> SEX_CATEGORY = SampleColumnIdentifier.newId(
+ public static final ColumnIdentifier<SpeciesBatchRowModel> SEX_CATEGORY = SampleCategoryColumnIdentifier.newId(
SpeciesBatchRowModel.PROPERTY_SEX_CATEGORY,
SpeciesBatchRowModel.PROPERTY_SEX_CATEGORY_WEIGHT,
SampleCategoryType.sex,
n_("tutti.editSpeciesBatch.table.header.sexCategory"),
n_("tutti.editSpeciesBatch.table.header.sexCategory"));
- public static final ColumnIdentifier<SpeciesBatchRowModel> MATURITY_CATEGORY = SampleColumnIdentifier.newId(
+ public static final ColumnIdentifier<SpeciesBatchRowModel> MATURITY_CATEGORY = SampleCategoryColumnIdentifier.newId(
SpeciesBatchRowModel.PROPERTY_MATURITY_CATEGORY,
SpeciesBatchRowModel.PROPERTY_MATURITY_CATEGORY_WEIGHT,
SampleCategoryType.maturity,
n_("tutti.editSpeciesBatch.table.header.maturityCategory"),
n_("tutti.editSpeciesBatch.table.header.maturityCategory"));
- public static final ColumnIdentifier<SpeciesBatchRowModel> AGE_CATEGORY = SampleColumnIdentifier.newId(
+ public static final ColumnIdentifier<SpeciesBatchRowModel> AGE_CATEGORY = SampleCategoryColumnIdentifier.newId(
SpeciesBatchRowModel.PROPERTY_AGE_CATEGORY,
SpeciesBatchRowModel.PROPERTY_AGE_CATEGORY_WEIGHT,
SampleCategoryType.age,
@@ -195,7 +157,7 @@
SpeciesBatchRowModel entry) {
if (sampleCols.contains(propertyName)) {
- ((SampleColumnIdentifier<SpeciesBatchRowModel>) propertyName).setWeightValue(entry, aValue);
+ ((SampleCategoryColumnIdentifier<SpeciesBatchRowModel>) propertyName).setWeightValue(entry, aValue);
} else {
super.setValueAt(aValue, rowIndex, columnIndex, propertyName, entry);
}
@@ -237,7 +199,7 @@
} else if (sampleCols.contains(propertyName)) {
- SampleColumnIdentifier<SpeciesBatchRowModel> samplePropertyName = (SampleColumnIdentifier<SpeciesBatchRowModel>) propertyName;
+ SampleCategoryColumnIdentifier<SpeciesBatchRowModel> samplePropertyName = (SampleCategoryColumnIdentifier<SpeciesBatchRowModel>) propertyName;
// can only edit if a category value is setted
SpeciesBatchRowModel entry = getEntry(rowIndex);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-03-20 23:23:30 UTC (rev 662)
@@ -170,14 +170,14 @@
_help: {"tutti.editSpeciesBatch.action.renameSpeciesBatch.help"};
}
-#createMelag {
+#createSpeciesMelag {
actionIcon: batch-rename;
- text: "tutti.editSpeciesBatch.action.createMelag";
- toolTipText: "tutti.editSpeciesBatch.action.createMelag.tip";
- i18nMnemonic: "tutti.editSpeciesBatch.action.createMelag.mnemonic";
- _tuttiAction: {CreateMelagAction.class};
- enabled: {!model.isTableViewModeLeaf() && model.isCreateMelagEnabled()};
- _help: {"tutti.editSpeciesBatch.action.createMelag.help"};
+ text: "tutti.editSpeciesBatch.action.createSpeciesMelag";
+ toolTipText: "tutti.editSpeciesBatch.action.createSpeciesMelag.tip";
+ i18nMnemonic: "tutti.editSpeciesBatch.action.createSpeciesMelag.mnemonic";
+ _tuttiAction: {CreateSpeciesMelagAction.class};
+ enabled: {!model.isTableViewModeLeaf() && model.isCreateSpeciesMelagEnabled()};
+ _help: {"tutti.editSpeciesBatch.action.createSpeciesMelag.help"};
}
#createSpeciesBatchButton {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-03-20 23:23:30 UTC (rev 662)
@@ -27,6 +27,9 @@
<import>
fr.ifremer.tutti.ui.swing.TuttiHelpBroker
+ fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode
+ fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType
+
fr.ifremer.tutti.ui.swing.util.TuttiUI
fr.ifremer.tutti.ui.swing.util.attachment.ButtonAttachment
fr.ifremer.tutti.ui.swing.util.editor.TuttiComputedOrNotDataEditor
@@ -83,7 +86,7 @@
<JMenuItem id='removeSpeciesBatchMenu'/>
<JMenuItem id='removeSpeciesSubBatchMenu'/>
<JMenuItem id='renameSpeciesBatchMenu'/>
- <JMenuItem id='createMelag'/>
+ <JMenuItem id='createSpeciesMelag'/>
</JPopupMenu>
<Table id='form' fill='both' constraints='BorderLayout.NORTH'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -34,9 +34,6 @@
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
-import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
-import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
-import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
@@ -44,6 +41,10 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategory;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryComponent;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.FrequencyCellComponent;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.CreateSpeciesBatchUI;
@@ -61,9 +62,7 @@
import fr.ifremer.tutti.ui.swing.util.editor.TuttiComputedOrNotDataTableCell;
import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
-import jaxx.runtime.JAXXUtil;
import jaxx.runtime.SwingUtil;
-import jaxx.runtime.context.JAXXContextEntryDef;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
@@ -99,16 +98,12 @@
*/
public class SpeciesBatchUIHandler extends AbstractTuttiBatchTableUIHandler<SpeciesBatchRowModel, SpeciesBatchUIModel, SpeciesBatchUI> {
- /** Logger. */
+ /**
+ * Logger.
+ */
private static final Log log =
LogFactory.getLog(SpeciesBatchUIHandler.class);
- public static JAXXContextEntryDef<List<Caracteristic>> FREQUENCY_LENGTH_CONTEXT_ENTRY =
- JAXXUtil.newListContextEntryDef("frequencyLength");
-
- public static JAXXContextEntryDef<List<Species>> SPECIES_REFERENT_CONTEXT_ENTRY =
- JAXXUtil.newListContextEntryDef("speciesReferent");
-
public static final Set<String> SAMPLING_PROPERTIES = Sets.newHashSet(
SpeciesBatchRowModel.PROPERTY_SAMPLE_CATEGORY,
SpeciesBatchRowModel.PROPERTY_SPECIES,
@@ -128,23 +123,23 @@
public SpeciesBatchUIHandler(TuttiUI<?, ?> parentUi,
SpeciesBatchUI ui) {
super(parentUi, ui,
- SpeciesBatchRowModel.PROPERTY_SPECIES,
- SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY,
- SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY_WEIGHT,
- SpeciesBatchRowModel.PROPERTY_SIZE_CATEGORY,
- SpeciesBatchRowModel.PROPERTY_SIZE_CATEGORY_WEIGHT,
- SpeciesBatchRowModel.PROPERTY_SEX_CATEGORY,
- SpeciesBatchRowModel.PROPERTY_SEX_CATEGORY_WEIGHT,
- SpeciesBatchRowModel.PROPERTY_MATURITY_CATEGORY,
- SpeciesBatchRowModel.PROPERTY_MATURITY_CATEGORY_WEIGHT,
- SpeciesBatchRowModel.PROPERTY_AGE_CATEGORY,
- SpeciesBatchRowModel.PROPERTY_AGE_CATEGORY_WEIGHT,
- SpeciesBatchRowModel.PROPERTY_WEIGHT,
- SpeciesBatchRowModel.PROPERTY_NUMBER,
- SpeciesBatchRowModel.PROPERTY_COMMENT,
- SpeciesBatchRowModel.PROPERTY_ATTACHMENT,
- SpeciesBatchRowModel.PROPERTY_FREQUENCY,
- SpeciesBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM);
+ SpeciesBatchRowModel.PROPERTY_SPECIES,
+ SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY,
+ SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY_WEIGHT,
+ SpeciesBatchRowModel.PROPERTY_SIZE_CATEGORY,
+ SpeciesBatchRowModel.PROPERTY_SIZE_CATEGORY_WEIGHT,
+ SpeciesBatchRowModel.PROPERTY_SEX_CATEGORY,
+ SpeciesBatchRowModel.PROPERTY_SEX_CATEGORY_WEIGHT,
+ SpeciesBatchRowModel.PROPERTY_MATURITY_CATEGORY,
+ SpeciesBatchRowModel.PROPERTY_MATURITY_CATEGORY_WEIGHT,
+ SpeciesBatchRowModel.PROPERTY_AGE_CATEGORY,
+ SpeciesBatchRowModel.PROPERTY_AGE_CATEGORY_WEIGHT,
+ SpeciesBatchRowModel.PROPERTY_WEIGHT,
+ SpeciesBatchRowModel.PROPERTY_NUMBER,
+ SpeciesBatchRowModel.PROPERTY_COMMENT,
+ SpeciesBatchRowModel.PROPERTY_ATTACHMENT,
+ SpeciesBatchRowModel.PROPERTY_FREQUENCY,
+ SpeciesBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM);
tableFilters = new EnumMap<TableViewMode, RowFilter<SpeciesBatchTableModel, Integer>>(TableViewMode.class);
tableFilters.put(TableViewMode.ALL, new RowFilter<SpeciesBatchTableModel, Integer>() {
@@ -202,7 +197,7 @@
if (log.isInfoEnabled()) {
log.info("Get species batch for fishingOperation: " +
- bean.getId());
+ bean.getId());
}
rows = Lists.newArrayList();
@@ -232,15 +227,15 @@
Preconditions.checkState(
aBatch.getSampleCategoryType() == SampleCategoryEnum.sortedUnsorted,
"Root species batch must be a sortedUnsorted sample " +
- "category but was:" + aBatch.getSampleCategoryType());
+ "category but was:" + aBatch.getSampleCategoryType());
SpeciesBatchRowModel rootRow =
loadSpeciesBatch(aBatch, null, rows);
if (log.isDebugEnabled()) {
log.debug("Loaded root batch " +
- decorate(rootRow.getSpecies(), DecoratorService.FROM_PROTOCOL) + " - " +
- decorate(rootRow.getSortedUnsortedCategoryValue()));
+ decorate(rootRow.getSpecies(), DecoratorService.FROM_PROTOCOL) + " - " +
+ decorate(rootRow.getSortedUnsortedCategoryValue()));
}
}
}
@@ -314,7 +309,7 @@
showInformationMessage(
"[ Captures - Espèces ] " +
- "Sauvegarde des modifications de " + row + '.');
+ "Sauvegarde des modifications de " + row + '.');
saveRow(row);
@@ -404,39 +399,6 @@
SpeciesBatchUIModel model = new SpeciesBatchUIModel(catchesUIModel);
model.setTableViewMode(TableViewMode.ALL);
ui.setContextValue(model);
-
- List<Caracteristic> lengthCaracterics;
-
- TuttiProtocol protocol;
-
- if (context.isProtocolFilled()) {
-
- // get loaded protocol
-
- protocol = getDataContext().getProtocol();
-
- lengthCaracterics = Lists.newArrayListWithCapacity(
- protocol.sizeLengthClassesPmfmId());
-
- Map<String, Caracteristic> allCaractericsById =
- TuttiEntities.splitById(getDataContext().getCaracteristics());
-
- if (!protocol.isLengthClassesPmfmIdEmpty()) {
- for (String id : protocol.getLengthClassesPmfmId()) {
- lengthCaracterics.add(allCaractericsById.get(id));
- }
- }
-
- } else {
-
- // use all caracteristics
- lengthCaracterics = Lists.newArrayList(
- getDataContext().getCaracteristics());
- }
-
- // use only the referent here, if the user needs a synonym, he will
- // click on the button to select another species
- FREQUENCY_LENGTH_CONTEXT_ENTRY.setContextValue(ui, lengthCaracterics);
}
@Override
@@ -451,56 +413,16 @@
Map<Integer, SampleCategoryEnum> categoryEnumMap =
SampleCategoryEnum.toIdMapping();
- List<Species> speciesUniverse = getDataContext().getReferentSpecies();
List<SampleCategoryEnum> samplingOrder = Lists.newArrayList();
List<Integer> samplingOrderIds = getConfig().getSamplingOrderIds();
for (Integer id : samplingOrderIds) {
samplingOrder.add(categoryEnumMap.get(id));
}
-
- List<Species> allSpecies;
-
- boolean protocolFilled = context.isProtocolFilled();
- if (protocolFilled) {
-
- // get loaded protocol
-
- TuttiProtocol protocol = getDataContext().getProtocol();
- Preconditions.checkNotNull(protocol,
- "Could not find protocol in ui context");
-
- // fill available species from protocol
-
- allSpecies = Lists.newArrayList();
- if (!protocol.isSpeciesEmpty()) {
-
- // split by taxonId
- Map<String, Species> map = TuttiEntities.splitByTaxonId(speciesUniverse);
-
- for (SpeciesProtocol protocolSpecy : protocol.getSpecies()) {
- String taxonId = String.valueOf(protocolSpecy.getSpeciesReferenceTaxonId());
- Species species = map.get(taxonId);
- species.setSurveyCode(protocolSpecy.getSpeciesSurveyCode());
- allSpecies.add(species);
- }
- }
-
- } else {
-
- // no protocol, use default values
-
- allSpecies = Lists.newArrayList(speciesUniverse);
-
- }
-
if (log.isInfoEnabled()) {
log.info("Will use sampling order: " + samplingOrder);
- log.info("Will use " + allSpecies.size() + " species.");
}
- getModel().setAllSpecies(allSpecies);
-
JXTable table = getTable();
// can show / hide some columns in model
@@ -521,17 +443,17 @@
{ // Species column
addColumnToModel(columnModel,
- null,
- newTableCellRender(Species.class, DecoratorService.FROM_PROTOCOL),
- SpeciesBatchTableModel.SPECIES);
+ null,
+ newTableCellRender(Species.class, DecoratorService.FROM_PROTOCOL),
+ SpeciesBatchTableModel.SPECIES);
}
{ // SortedUnsortedCategory column
addSampleCategoryColumnToModel(columnModel,
- SpeciesBatchTableModel.SORTED_UNSORTED_CATEGORY,
- caracteristicDecorator,
- defaultRenderer);
+ SpeciesBatchTableModel.SORTED_UNSORTED_CATEGORY,
+ caracteristicDecorator,
+ defaultRenderer);
}
for (SampleCategoryEnum sampleCategoryType : samplingOrder) {
@@ -542,9 +464,9 @@
{ // SizeCategory column
addSampleCategoryColumnToModel(columnModel,
- SpeciesBatchTableModel.SIZE_CATEGORY,
- caracteristicDecorator,
- defaultRenderer);
+ SpeciesBatchTableModel.SIZE_CATEGORY,
+ caracteristicDecorator,
+ defaultRenderer);
}
break;
case sex:
@@ -552,9 +474,9 @@
{ // SexCategory column
addSampleCategoryColumnToModel(columnModel,
- SpeciesBatchTableModel.SEX_CATEGORY,
- caracteristicDecorator,
- defaultRenderer);
+ SpeciesBatchTableModel.SEX_CATEGORY,
+ caracteristicDecorator,
+ defaultRenderer);
}
break;
case maturity:
@@ -562,9 +484,9 @@
{ // MaturityCategory column
addSampleCategoryColumnToModel(columnModel,
- SpeciesBatchTableModel.MATURITY_CATEGORY,
- caracteristicDecorator,
- defaultRenderer);
+ SpeciesBatchTableModel.MATURITY_CATEGORY,
+ caracteristicDecorator,
+ defaultRenderer);
}
break;
@@ -574,9 +496,9 @@
{ // AgeCategory column
addSampleCategoryColumnToModel(columnModel,
- SpeciesBatchTableModel.AGE_CATEGORY,
- getDecorator(Float.class, null),
- defaultRenderer);
+ SpeciesBatchTableModel.AGE_CATEGORY,
+ getDecorator(Float.class, null),
+ defaultRenderer);
}
break;
@@ -587,42 +509,42 @@
{ // Weight column
addColumnToModel(columnModel,
- TuttiComputedOrNotDataTableCell.newEditor(
- Float.class, false, true, 3, computedDataColor),
- TuttiComputedOrNotDataTableCell.newRender(
- defaultRenderer, true, 3, computedDataColor),
- SpeciesBatchTableModel.WEIGHT);
+ TuttiComputedOrNotDataTableCell.newEditor(
+ Float.class, false, true, 3, computedDataColor),
+ TuttiComputedOrNotDataTableCell.newRender(
+ defaultRenderer, true, 3, computedDataColor),
+ SpeciesBatchTableModel.WEIGHT);
}
{ // Number column (from frequencies)
addColumnToModel(columnModel,
- FrequencyCellComponent.newEditor(ui, computedDataColor),
- FrequencyCellComponent.newRender(computedDataColor),
- SpeciesBatchTableModel.COMPUTED_NUMBER);
+ FrequencyCellComponent.newEditor(ui, computedDataColor),
+ FrequencyCellComponent.newRender(computedDataColor),
+ SpeciesBatchTableModel.COMPUTED_NUMBER);
}
{ // Comment column
addColumnToModel(columnModel,
- CommentCellEditor.newEditor(ui),
- CommentCellRenderer.newRender(),
- SpeciesBatchTableModel.COMMENT);
+ CommentCellEditor.newEditor(ui),
+ CommentCellRenderer.newRender(),
+ SpeciesBatchTableModel.COMMENT);
}
{ // File column
addColumnToModel(columnModel,
- AttachmentCellEditor.newEditor(ui),
- AttachmentCellRenderer.newRender(getDecorator(Attachment.class, null)),
- SpeciesBatchTableModel.ATTACHMENT);
+ AttachmentCellEditor.newEditor(ui),
+ AttachmentCellRenderer.newRender(getDecorator(Attachment.class, null)),
+ SpeciesBatchTableModel.ATTACHMENT);
}
{ // Species to confirm column
addBooleanColumnToModel(columnModel,
- SpeciesBatchTableModel.SPECIES_TO_CONFIRM,
- getTable());
+ SpeciesBatchTableModel.SPECIES_TO_CONFIRM,
+ getTable());
}
// create table model
@@ -753,7 +675,7 @@
int rowIndex = table.getSelectedRow();
Preconditions.checkState(rowIndex != -1,
- "Cant split batch if no batch selected");
+ "Cant split batch if no batch selected");
SpeciesBatchTableModel tableModel = getTableModel();
@@ -818,10 +740,10 @@
SpeciesBatchRowModel newBatch = tableModel.createNewRow();
loadBatchRow(parentBatch,
- newBatch,
- sampleCategoryEnum,
- row.getCategoryValue(),
- row.getWeight());
+ newBatch,
+ sampleCategoryEnum,
+ row.getCategoryValue(),
+ row.getWeight());
recomputeRowValidState(newBatch);
newBatches.add(newBatch);
@@ -909,10 +831,10 @@
if (log.isInfoEnabled()) {
log.info("Persist new species batch with parentId: " +
- parentBatchId);
+ parentBatchId);
}
catchBean = persistenceService.createSpeciesBatch(catchBean,
- parentBatchId);
+ parentBatchId);
row.setId(catchBean.getId());
} else {
if (log.isInfoEnabled()) {
@@ -982,15 +904,15 @@
// can split if selected batch is a leaf
enableSplit = row.isBatchLeaf()
- && selectedRowCount == 1
- && row.getComputedNumber() == null;
+ && selectedRowCount == 1
+ && row.getComputedNumber() == null;
}
if (enableRename) {
// can rename if selected batch is a parent
enableRename = row.isBatchRoot()
- && selectedRowCount == 1;
+ && selectedRowCount == 1;
}
if (enableRemove) {
@@ -1003,7 +925,7 @@
// can remove sub batch if selected batch is not a leaf
enableRemoveSub = !row.isBatchLeaf()
- && selectedRowCount == 1;
+ && selectedRowCount == 1;
}
if (enableCreateMelag) {
@@ -1036,11 +958,11 @@
model.setRemoveSpeciesBatchEnabled(enableRemove);
model.setRemoveSpeciesSubBatchEnabled(enableRemoveSub);
model.setRenameSpeciesBatchEnabled(enableRename);
- model.setCreateMelagEnabled(enableCreateMelag);
+ model.setCreateSpeciesMelagEnabled(enableCreateMelag);
}
public void collectChildren(SpeciesBatchRowModel row,
- Set<SpeciesBatchRowModel> collectedRows) {
+ Set<SpeciesBatchRowModel> collectedRows) {
if (!row.isBatchLeaf()) {
@@ -1069,9 +991,10 @@
// the species of the parent is set to the children in loadBatchRow
if (parentRow == null && context.isProtocolFilled()) {
// get the surveycode from the species list of the model
- int i = getModel().getAllSpecies().indexOf(newRow.getSpecies());
+ List<Species> speciesList = getDataContext().getReferentSpeciesWithSurveyCode();
+ int i = speciesList.indexOf(newRow.getSpecies());
if (i > -1) {
- newRow.setSpecies(getModel().getAllSpecies().get(i));
+ newRow.setSpecies(speciesList.get(i));
}
}
@@ -1083,10 +1006,10 @@
"Can't have a batch with no sample category, but was: " + aBatch);
loadBatchRow(parentRow,
- newRow,
- sampleCategoryEnum,
- aBatch.getSampleCategoryValue(),
- aBatch.getSampleCategoryWeight());
+ newRow,
+ sampleCategoryEnum,
+ aBatch.getSampleCategoryValue(),
+ aBatch.getSampleCategoryWeight());
rows.add(newRow);
@@ -1156,11 +1079,11 @@
Decorator<C> decorator,
TableCellRenderer defaultRenderer) {
addColumnToModel(columnModel,
- SampleCategoryComponent.newEditor(decorator),
- SampleCategoryComponent.newRender(defaultRenderer,
- decorator,
- getConfig().getColorComputedWeights()),
- columnIdentifier);
+ SampleCategoryComponent.newEditor(decorator),
+ SampleCategoryComponent.newRender(defaultRenderer,
+ decorator,
+ getConfig().getColorComputedWeights()),
+ columnIdentifier);
}
public void removeFromSpeciesUsed(SpeciesBatchRowModel row) {
@@ -1172,7 +1095,7 @@
}
SpeciesBatchUIModel model = getModel();
model.getSpeciesUsed().remove(row.getSortedUnsortedCategoryValue(),
- row.getSpecies());
+ row.getSpecies());
if (row.isBatchRoot()) {
model.setRootNumber(model.getRootNumber() - 1);
@@ -1185,12 +1108,12 @@
Preconditions.checkNotNull(row.getSortedUnsortedCategoryValue());
if (log.isDebugEnabled()) {
log.debug("Add to speciesUsed: " +
- decorate(row.getSortedUnsortedCategoryValue()) +
- " - " + decorate(row.getSpecies()));
+ decorate(row.getSortedUnsortedCategoryValue()) +
+ " - " + decorate(row.getSpecies()));
}
SpeciesBatchUIModel model = getModel();
model.getSpeciesUsed().put(row.getSortedUnsortedCategoryValue(),
- row.getSpecies());
+ row.getSpecies());
model.setRootNumber(model.getRootNumber() + 1);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -24,7 +24,6 @@
* #L%
*/
-import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
@@ -33,6 +32,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode;
import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
@@ -49,8 +49,6 @@
public static final String PROPERTY_TABLE_VIEW_MODE = "tableViewMode";
- public static final String PROPERTY_ALL_SPECIES = "allSpecies";
-
public static final String PROPERTY_CREATE_SPECIES_BATCH_ENABLED = "createSpeciesBatchEnabled";
public static final String PROPERTY_SPLIT_SPECIES_BATCH_ENABLED = "splitSpeciesBatchEnabled";
@@ -61,7 +59,7 @@
public static final String PROPERTY_REMOVE_SPECIES_BATCH_ENABLED = "removeSpeciesBatchEnabled";
- public static final String PROPERTY_CREATE_MELAG_ENABLED = "createMelagEnabled";
+ public static final String PROPERTY_CREATE_SPECIES_MELAG_ENABLED = "createMelagEnabled";
public static final String PROPERTY_TABLE_VIEW_MODE_ALL = "tableViewModeAll";
@@ -74,62 +72,54 @@
public static final String PROPERTY_LEAF_NUMBER = "leafNumber";
/**
- * All usable species (sets by protocol).
+ * Can user create a new species batch ?
*
* @since 0.3
*/
- protected List<Species> allSpecies;
+ protected boolean createSpeciesBatchEnabled;
/**
- * Species already used in some batches.
+ * Can user split a selected species batch ?
*
* @since 0.3
*/
- protected final Multimap<CaracteristicQualitativeValue, Species>
- speciesUsed = ArrayListMultimap.create();
+ protected boolean splitSpeciesBatchEnabled;
/**
- * What to show in the table.
+ * Can user remove a selected species batch?
*
* @since 0.3
*/
- protected TableViewMode tableViewMode;
+ protected boolean removeSpeciesBatchEnabled;
/**
- * Can user create a new species batch ?
+ * Can user remove a selected species sub batches?
*
* @since 0.3
*/
- protected boolean createSpeciesBatchEnabled;
+ protected boolean removeSpeciesSubBatchEnabled;
/**
- * Can user split a selected species batch ?
+ * Can user create a melag from the selected species?
*
* @since 0.3
*/
- protected boolean splitSpeciesBatchEnabled;
+ protected boolean createSpeciesMelagEnabled = true;
/**
- * Can user remove a selected species batch?
+ * Can user rename the selected species?
*
* @since 0.3
*/
- protected boolean removeSpeciesBatchEnabled;
+ protected boolean renameSpeciesBatchEnabled;
/**
- * Can user remove a selected species sub batches?
+ * What to show in the table.
*
* @since 0.3
*/
- protected boolean removeSpeciesSubBatchEnabled;
+ protected TableViewMode tableViewMode;
- /**
- * Can user create a melag from the selected species?
- *
- * @since 0.3
- */
- protected boolean createMelagEnabled = true;
-
/** @since 1.0 */
protected int rootNumber;
@@ -138,8 +128,6 @@
protected final List<Attachment> attachment = Lists.newArrayList();
- private boolean renameSpeciesBatchEnabled;
-
private String rootBatchId;
public SpeciesBatchUIModel(EditCatchesUIModel catchesUIModel) {
@@ -261,18 +249,8 @@
return TableViewMode.ROOT.equals(tableViewMode);
}
- public List<Species> getAllSpecies() {
- return allSpecies;
- }
-
- public void setAllSpecies(List<Species> allSpecies) {
- Object oldValue = getAllSpecies();
- this.allSpecies = allSpecies;
- firePropertyChange(PROPERTY_ALL_SPECIES, oldValue, allSpecies);
- }
-
public Multimap<CaracteristicQualitativeValue, Species> getSpeciesUsed() {
- return speciesUsed;
+ return catchesUIModel.getSpeciesUsed();
}
public int getRootNumber() {
@@ -345,14 +323,14 @@
return renameSpeciesBatchEnabled;
}
- public boolean isCreateMelagEnabled() {
- return createMelagEnabled;
+ public boolean isCreateSpeciesMelagEnabled() {
+ return createSpeciesMelagEnabled;
}
- public void setCreateMelagEnabled(boolean createMelagEnabled) {
- Object oldValue = isCreateMelagEnabled();
- this.createMelagEnabled = createMelagEnabled;
- firePropertyChange(PROPERTY_CREATE_MELAG_ENABLED, oldValue, createMelagEnabled);
+ public void setCreateSpeciesMelagEnabled(boolean createSpeciesMelagEnabled) {
+ Object oldValue = isCreateSpeciesMelagEnabled();
+ this.createSpeciesMelagEnabled = createSpeciesMelagEnabled;
+ firePropertyChange(PROPERTY_CREATE_SPECIES_MELAG_ENABLED, oldValue, createSpeciesMelagEnabled);
}
public void setRootBatchId(String rootBatchId) {
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/TableViewMode.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/TableViewMode.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/TableViewMode.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -1,52 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.species;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 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%
- */
-
-/**
- * What to show in the species table?
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public enum TableViewMode {
- /**
- * Show all nodes of sampling.
- *
- * @since 0.3
- */
- ALL,
- /**
- * Show only leaves of sampling.
- *
- * @since 0.3
- */
- LEAF,
- /**
- * Show onlyroot nodes of sampling.
- *
- * @since 0.3
- */
- ROOT
-}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -179,8 +179,7 @@
initUI(ui);
List<Caracteristic> lengthStepCaracterics =
- SpeciesBatchUIHandler.FREQUENCY_LENGTH_CONTEXT_ENTRY.getContextValue(ui);
- Preconditions.checkNotNull(lengthStepCaracterics);
+ Lists.newArrayList(getDataContext().getLengthStepCaracteristics());
lengthStepCaracteristics = TuttiEntities.splitById(lengthStepCaracterics);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx 2013-03-20 23:23:30 UTC (rev 662)
@@ -32,7 +32,7 @@
fr.ifremer.tutti.ui.swing.TuttiHelpBroker
fr.ifremer.tutti.ui.swing.TuttiUIContext
- fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategoryType
+ fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType
fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
fr.ifremer.tutti.ui.swing.util.TuttiUI
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -150,9 +150,6 @@
}
});
-// SwingValidatorUtil.installUI(ui.getErrorTable(),
-// new SwingValidatorMessageTableRenderer());
-
listenValidatorValid(ui.getValidator(), getModel());
}
@@ -218,7 +215,7 @@
// compute which species can still be used
- List<Species> allSpecies = batchModel.getAllSpecies();
+ List<Species> allSpecies = getDataContext().getReferentSpeciesWithSurveyCode();
speciesToUse.addAll(allSpecies);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -25,8 +25,8 @@
*/
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategory;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategoryType;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategory;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.jaxx 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.jaxx 2013-03-20 23:23:30 UTC (rev 662)
@@ -27,7 +27,7 @@
<import>
fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
- fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategoryType
+ fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType
fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI
fr.ifremer.tutti.ui.swing.TuttiHelpBroker
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -31,8 +31,8 @@
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategory;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategoryType;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategory;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java 2013-03-20 23:23:30 UTC (rev 662)
@@ -25,7 +25,7 @@
*/
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategoryType;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryType;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-03-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-03-20 23:23:30 UTC (rev 662)
@@ -460,12 +460,12 @@
tutti.editProtocol.title.edit.protocol=
tutti.editProtocol.warn.clone=
tutti.editProtocol.warn.import=
-tutti.editSpeciesBatch.action.createMelag=
-tutti.editSpeciesBatch.action.createMelag.mnemonic=
-tutti.editSpeciesBatch.action.createMelag.tip=
tutti.editSpeciesBatch.action.createSpeciesBatch=
tutti.editSpeciesBatch.action.createSpeciesBatch.mnemonic=
tutti.editSpeciesBatch.action.createSpeciesBatch.tip=
+tutti.editSpeciesBatch.action.createSpeciesMelag=
+tutti.editSpeciesBatch.action.createSpeciesMelag.mnemonic=
+tutti.editSpeciesBatch.action.createSpeciesMelag.tip=
tutti.editSpeciesBatch.action.removeSpeciesBatch=
tutti.editSpeciesBatch.action.removeSpeciesBatch.mnemonic=
tutti.editSpeciesBatch.action.removeSpeciesBatch.tip=
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-19 15:30:18 UTC (rev 661)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-03-20 23:23:30 UTC (rev 662)
@@ -458,12 +458,12 @@
tutti.editProtocol.title.edit.protocol=Éditer un protocol de saisie existant
tutti.editProtocol.warn.clone=Le protocole que vous venez de cloner ne sera sauvegardé que lorsque vous cliquerez sur le bouton "Enregistrer".
tutti.editProtocol.warn.import=Le protocole que vous venez d'importer ne sera sauvegardé que lorsque vous cliquerez sur le bouton "Enregistrer".
-tutti.editSpeciesBatch.action.createMelag=Espèces d'un MELAG
-tutti.editSpeciesBatch.action.createMelag.mnemonic=C
-tutti.editSpeciesBatch.action.createMelag.tip=Calcul des poids des lots appartenant à un MELAG
tutti.editSpeciesBatch.action.createSpeciesBatch=Créer un lot pour une espèce
tutti.editSpeciesBatch.action.createSpeciesBatch.mnemonic=C
tutti.editSpeciesBatch.action.createSpeciesBatch.tip=Créer un nouveau lot pour une espèce
+tutti.editSpeciesBatch.action.createSpeciesMelag=Espèces d'un MELAG
+tutti.editSpeciesBatch.action.createSpeciesMelag.mnemonic=C
+tutti.editSpeciesBatch.action.createSpeciesMelag.tip=Calcul des poids des lots appartenant à un MELAG
tutti.editSpeciesBatch.action.removeSpeciesBatch=Supprimer le lot
tutti.editSpeciesBatch.action.removeSpeciesBatch.mnemonic=S
tutti.editSpeciesBatch.action.removeSpeciesBatch.tip=Supprimer le lot courant (celui de la ligne sélectionnée) et tous ces fils
1
0
r661 - trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service
by kmorin@users.forge.codelutin.com 19 Mar '13
by kmorin@users.forge.codelutin.com 19 Mar '13
19 Mar '13
Author: kmorin
Date: 2013-03-19 16:30:18 +0100 (Tue, 19 Mar 2013)
New Revision: 661
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/661
Log:
refs #2156 [CAPTURE] - Esp?\195?\168ces - Erreur de r?\195?\169cup?\195?\169ration des captures quand un lot a ?\195?\169t?\195?\169 cat?\195?\169goris?\195?\169 par age
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-03-19 13:10:52 UTC (rev 660)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-03-19 15:30:18 UTC (rev 661)
@@ -757,7 +757,11 @@
if (sm != null) {
SampleCategoryEnum sampleCategory = enumeration.getSampleCategoryByPmfmId(sm.getPmfm().getId());
if (sampleCategory != null) {
- setSampleCategoryQualitative(target, sm.getPmfm().getId(), sm.getNumericalValue(), sm.getAlphanumericalValue(), sm.getQualitativeValue().getId());
+ Integer qualitativeId = null;
+ if (sm.getQualitativeValue() != null) {
+ qualitativeId = sm.getQualitativeValue().getId();
+ }
+ setSampleCategoryQualitative(target, sm.getPmfm().getId(), sm.getNumericalValue(), sm.getAlphanumericalValue(), qualitativeId);
}
}
1
0
r660 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split java/fr/ifremer/tutti/ui/swing/util resources/fr/ifremer/tutti/ui/swing/content/operation resources/i18n
by kmorin@users.forge.codelutin.com 19 Mar '13
by kmorin@users.forge.codelutin.com 19 Mar '13
19 Mar '13
Author: kmorin
Date: 2013-03-19 14:10:52 +0100 (Tue, 19 Mar 2013)
New Revision: 660
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/660
Log:
- use bean filterable combo boxes
- make substratas and location not mandatory
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.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/FishingOperationsUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.css 2013-03-19 13:09:00 UTC (rev 659)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.css 2013-03-19 13:10:52 UTC (rev 660)
@@ -28,12 +28,6 @@
bean: {model};
}
-BeanComboBox {
- showReset: true;
- i18nPrefix: "tutti.property.";
- bean: {model};
-}
-
#fishingOperationsTopPanel {
_help: {"tutti.fishingOperations.help"};
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx 2013-03-19 13:09:00 UTC (rev 659)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx 2013-03-19 13:10:52 UTC (rev 660)
@@ -33,7 +33,6 @@
fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
fr.ifremer.tutti.ui.swing.util.TuttiUI
- jaxx.runtime.swing.editor.bean.BeanComboBox
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
static org.nuiton.i18n.I18n._
@@ -66,9 +65,9 @@
<!-- Cruise fishingOperations -->
<row>
<cell anchor='west' weightx='1.0'>
- <BeanComboBox id='fishingOperationComboBox'
- constructorParams='this'
- genericType='FishingOperation'/>
+ <BeanFilterableComboBox id='fishingOperationComboBox'
+ constructorParams='this'
+ genericType='FishingOperation'/>
</cell>
<cell anchor='east'>
<JButton id='newFishingOperationButton'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-03-19 13:09:00 UTC (rev 659)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-03-19 13:10:52 UTC (rev 660)
@@ -120,9 +120,9 @@
List<FishingOperation> fishingOperations = model.getFishingOperation();
- initBeanComboBox(ui.getFishingOperationComboBox(),
- fishingOperations,
- model.getSelectedFishingOperation());
+ initBeanFilterableComboBox(ui.getFishingOperationComboBox(),
+ fishingOperations,
+ model.getSelectedFishingOperation());
model.addPropertyChangeListener(FishingOperationsUIModel.PROPERTY_SELECTED_FISHING_OPERATION, new PropertyChangeListener() {
@Override
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.css 2013-03-19 13:09:00 UTC (rev 659)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.css 2013-03-19 13:10:52 UTC (rev 660)
@@ -28,12 +28,6 @@
bean: {model};
}
-BeanComboBox {
- showReset: true;
- i18nPrefix: "tutti.property.";
- bean: {model};
-}
-
NumberEditor {
autoPopup: {handler.getConfig().isAutoPopupNumberEditor()};
showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx 2013-03-19 13:09:00 UTC (rev 659)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx 2013-03-19 13:10:52 UTC (rev 660)
@@ -39,7 +39,6 @@
org.jdesktop.swingx.JXTable
- jaxx.runtime.swing.editor.bean.BeanComboBox
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
jaxx.runtime.swing.editor.NumberEditor
@@ -102,9 +101,9 @@
<JLabel id='sortedUnsortedCategoryLabel'/>
</cell>
<cell weightx='1.0' columns='2'>
- <BeanComboBox id='sortedUnsortedCategoryComboBox'
- constructorParams='this'
- genericType='CaracteristicQualitativeValue'/>
+ <BeanFilterableComboBox id='sortedUnsortedCategoryComboBox'
+ constructorParams='this'
+ genericType='CaracteristicQualitativeValue'/>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java 2013-03-19 13:09:00 UTC (rev 659)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java 2013-03-19 13:10:52 UTC (rev 660)
@@ -107,9 +107,9 @@
Caracteristic caracteristic =
persistenceService.getSortedUnsortedCaracteristic();
- initBeanComboBox(ui.getSortedUnsortedCategoryComboBox(),
- caracteristic.getQualitativeValue(),
- null);
+ initBeanFilterableComboBox(ui.getSortedUnsortedCategoryComboBox(),
+ caracteristic.getQualitativeValue(),
+ null);
getModel().addPropertyChangeListener(CreateSpeciesBatchUIModel.PROPERTY_SPECIES, new PropertyChangeListener() {
@Override
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-03-19 13:09:00 UTC (rev 659)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-03-19 13:10:52 UTC (rev 660)
@@ -44,7 +44,6 @@
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.swing.editor.NumberEditor;
-import jaxx.runtime.swing.editor.bean.BeanComboBox;
import jaxx.runtime.swing.editor.bean.BeanDoubleList;
import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
import jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
@@ -560,54 +559,6 @@
* Prépare un component de choix d'entités pour un type d'entité donné et
* pour un service de persistance donné.
*
- * @param comboBox le component graphique à initialiser
- */
- protected <E extends Serializable> void initBeanComboBox(
- BeanComboBox<E> comboBox,
- List<E> data,
- E selectedData) {
-
- initBeanComboBox(comboBox, data, selectedData, null);
- }
-
- protected <E extends Serializable> void initBeanComboBox(
- BeanComboBox<E> comboBox,
- List<E> data,
- E selectedData,
- String decoratorContext) {
-
- Preconditions.checkNotNull(comboBox, "No comboBox!");
-
- Class<E> beanType = comboBox.getBeanType();
-
- Preconditions.checkNotNull(beanType, "No beanType on the combobox!");
-
- Decorator<E> decorator = getDecorator(beanType, decoratorContext);
-
- if (data == null) {
- data = Lists.newArrayList();
- }
-
- if (log.isInfoEnabled()) {
- log.info("entity comboBox list [" + beanType.getName() + "] : " +
- (data == null ? 0 : data.size()));
- }
-
- // add data list to combo box
- comboBox.init((JXPathDecorator<E>) decorator, data);
-
- comboBox.setSelectedItem(selectedData);
-
- if (log.isDebugEnabled()) {
- log.debug("combo [" + beanType.getName() + "] : " +
- comboBox.getData().size());
- }
- }
-
- /**
- * Prépare un component de choix d'entités pour un type d'entité donné et
- * pour un service de persistance donné.
- *
* @param list le component graphique à initialiser
* @param data la liste des données à mettre dans la liste de gauche
* @param selectedData la liste des données à mettre dans la liste de droite
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-19 13:09:00 UTC (rev 659)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-03-19 13:10:52 UTC (rev 660)
@@ -33,30 +33,12 @@
<field name='strata'>
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[ strata != null || subStrata != null || location != null ]]>
+ <![CDATA[ strata != null ]]>
</param>
<message>tutti.validator.error.fishingOperation.strataLocation.required</message>
</field-validator>
</field>
- <field name='subStrata'>
- <field-validator type="fieldexpression" short-circuit="true">
- <param name="expression">
- <![CDATA[ strata != null || subStrata != null || location != null ]]>
- </param>
- <message>tutti.validator.error.fishingOperation.strataLocation.required</message>
- </field-validator>
- </field>
-
- <field name='location'>
- <field-validator type="fieldexpression" short-circuit="true">
- <param name="expression">
- <![CDATA[ strata != null || subStrata != null || location != null ]]>
- </param>
- <message>tutti.validator.error.fishingOperation.strataLocation.required</message>
- </field-validator>
- </field>
-
<field name="gearShootingStartDate">
<field-validator type="fieldexpression" short-circuit="true">
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-19 13:09:00 UTC (rev 659)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-03-19 13:10:52 UTC (rev 660)
@@ -89,24 +89,6 @@
</field-validator>
</field>
- <field name='subStrata'>
- <field-validator type="fieldexpression" short-circuit="true">
- <param name="expression">
- <![CDATA[ strata != null || subStrata != null || location != null ]]>
- </param>
- <message>tutti.validator.error.fishingOperation.strataLocation.required</message>
- </field-validator>
- </field>
-
- <field name='location'>
- <field-validator type="fieldexpression" short-circuit="true">
- <param name="expression">
- <![CDATA[ strata != null || subStrata != null || location != null ]]>
- </param>
- <message>tutti.validator.error.fishingOperation.strataLocation.required</message>
- </field-validator>
- </field>
-
<field name="gearShootingStartDate">
<field-validator type="required" short-circuit="true">
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-19 13:09:00 UTC (rev 659)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-03-19 13:10:52 UTC (rev 660)
@@ -826,7 +826,7 @@
tutti.validator.error.fishingOperation.gear.required=L'engin est obligatoire
tutti.validator.error.fishingOperation.stationNumber.required=Le numéro de station est obligatoire
tutti.validator.error.fishingOperation.stationNumber.too.long=Valeur trop longue (limitée à %s caractères)
-tutti.validator.error.fishingOperation.strataLocation.required=La strate, sous-strate ou la localité doit être renseignée
+tutti.validator.error.fishingOperation.strataLocation.required=La strate doit être renseignée
tutti.validator.error.fishingOperation.trawlDistance.required=La distance est obligatoire
tutti.validator.error.fishingOperation.trawlDistance.tooLong=La distance du trait dépasse 3 milles marin (5556 m), merci de vérifier les coordonnées
tutti.validator.error.fishingOperation.trawlNetNumber.required=Le numéro de poche est obligatoire
1
0
Author: kmorin
Date: 2013-03-19 14:09:00 +0100 (Tue, 19 Mar 2013)
New Revision: 659
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/659
Log:
use latest jaxx snapshot
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-19 10:55:24 UTC (rev 658)
+++ trunk/pom.xml 2013-03-19 13:09:00 UTC (rev 659)
@@ -130,7 +130,7 @@
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
<licensePluginVersion>1.4</licensePluginVersion>
- <jaxxVersion>2.5.14</jaxxVersion>
+ <jaxxVersion>2.5.15-SNAPSHOT</jaxxVersion>
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.7</xworkVersion>
1
0
r658 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency
by kmorin@users.forge.codelutin.com 19 Mar '13
by kmorin@users.forge.codelutin.com 19 Mar '13
19 Mar '13
Author: kmorin
Date: 2013-03-19 11:55:24 +0100 (Tue, 19 Mar 2013)
New Revision: 658
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/658
Log:
fixes #2158 [CAPTURE] - Esp?\195?\168ces - ?\195?\169dition des mensurations d'esp?\195?\168ce hors protocole
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-19 10:36:27 UTC (rev 657)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-19 10:55:24 UTC (rev 658)
@@ -495,7 +495,7 @@
SpeciesFrequencyUIModel model = getModel();
SpeciesFrequencyUIModel.ConfigurationMode mode = SpeciesFrequencyUIModel.ConfigurationMode.SIMPLE;
- if (protocol != null) {
+ if (lengthStepCaracteristic == null && protocol != null) {
Integer taxonId = speciesBatch.getSpecies().getReferenceTaxonId();
SpeciesProtocol speciesProtocol = this.speciesProtocol.get(taxonId);
if (speciesProtocol == null || speciesProtocol.getLengthStepPmfmId() == null) {
1
0
See <http://ci.nuiton.org/jenkins/job/tutti/537/changes>
Changes:
[maven-release] [maven-release-plugin] prepare for next development iteration
[maven-release] [maven-release-plugin] prepare release tutti-1.1.1
[maven-release] fix space
------------------------------------------
[...truncated 537 lines...]
location: package fr.ifremer.tutti
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[27,49] error: package fr.ifremer.tutti.persistence.entities.data does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[615,25] error: cannot find symbol
[ERROR] symbol: class IdAware
location: class AbstractTuttiUIHandler<M,UI>
where M,UI are type-variables:
M extends Object declared in class AbstractTuttiUIHandler
UI extends TuttiUI<M,?> declared in class AbstractTuttiUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[96,19] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[98,19] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[100,31] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[102,26] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[104,19] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[106,26] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[108,49] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[112,28] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[115,17] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[151,42] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[166,43] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[181,45] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[216,16] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[220,42] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[224,16] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[228,35] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[236,28] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[240,22] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[244,56] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[248,16] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[252,23] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[256,59] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[264,16] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[268,39] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[272,23] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[276,48] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[62,14] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[74,14] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[82,34] error: cannot find symbol
[ERROR] symbol: class SpeciesProtocol
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[86,63] error: cannot find symbol
[ERROR] symbol: class SpeciesProtocol
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[98,11] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[102,27] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[162,11] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[166,34] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>:[116,29] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>:[120,29] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>:[132,37] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>:[139,29] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>:[450,26] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>:[466,26] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>:[510,34] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>:[530,26] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[388,57] error: cannot find symbol
[ERROR] symbol: class SpeciesProtocol
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[495,67] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[495,11] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[510,49] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[511,39] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[513,44] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[137,20] error: cannot find symbol
[ERROR] symbol: class RessourceClassLoader
location: class TuttiUIContext
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[27,23] error: cannot find symbol
[ERROR] symbol: class TuttiBusinessException
location: package fr.ifremer.tutti
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[28,35] error: package fr.ifremer.tutti.persistence does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[27,35] error: package fr.ifremer.tutti.persistence does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[689,11] error: cannot find symbol
[ERROR] symbol: class RessourceClassLoader
location: class TuttiUIContext
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[58,14] error: cannot find symbol
[ERROR] symbol: class Program
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[60,14] error: cannot find symbol
[ERROR] symbol: class Cruise
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[62,14] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[64,19] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[66,19] error: cannot find symbol
[ERROR] symbol: class Person
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[68,19] error: cannot find symbol
[ERROR] symbol: class Species
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[70,19] error: cannot find symbol
[INFO] 100 errors
[INFO] -------------------------------------------------------------
sessionEnded
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tutti ............................................. SUCCESS [24.653s]
[INFO] Tutti :: Persistence .............................. SUCCESS [53.606s]
[INFO] Tutti :: Service .................................. SUCCESS [10.654s]
[INFO] Tutti :: UI ....................................... FAILURE [1:15.128s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:46.915s
[INFO] Finished at: Mon Mar 18 17:34:26 CET 2013
[INFO] Final Memory: 58M/166M
[INFO] ------------------------------------------------------------------------
Projects to build: [MavenProject: fr.ifremer:tutti:1.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-persistence:1.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-service:1.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-ui-swing:1.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml]>
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-service/builds/2013-03-18_17-31-29/archive/fr.ifremer.tutti/tutti-service/1.2-SNAPSHOT/tutti-service-1.2-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-ui-swing/builds/2013-03-18_17-31-29/archive/fr.ifremer.tutti/tutti-ui-swing/1.2-SNAPSHOT/tutti-ui-swing-1.2-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/license/…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-ui-swing/builds/2013-03-18_17-31-29/archive/fr.ifremer.tutti/tutti-ui-swing/1.2-SNAPSHOT/tutti-ui-swing-1.2-SNAPSHOT-third-party.properties
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-03-18_17-31-29/archive/fr.ifremer/tutti/1.2-SNAPSHOT/tutti-1.2-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-1.2-SNAPSHOT-s…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-03-18_17-31-29/archive/fr.ifremer/tutti/1.2-SNAPSHOT/tutti-1.2-SNAPSHOT-site_fr.xml
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-persistence/builds/2013-03-18_17-31-29/archive/fr.ifremer.tutti/tutti-persistence/1.2-SNAPSHOT/tutti-persistence-1.2-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/tu…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-persistence/builds/2013-03-18_17-31-29/archive/fr.ifremer.tutti/tutti-persistence/1.2-SNAPSHOT/tutti-persistence-1.2-SNAPSHOT.jar
Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project tutti-ui-swing: Compilation failure
cause : Compilation failure
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project tutti-ui-swing: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:729)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
Sending e-mails to: tutti-commits(a)list.forge.codelutin.com chemit+release(a)codelutin.com
channel stopped
1
1
19 Mar '13
See <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/537/…>
Changes:
[maven-release] [maven-release-plugin] prepare for next development iteration
[maven-release] [maven-release-plugin] prepare release tutti-1.1.1
------------------------------------------
[...truncated 99 lines...]
[INFO] -------------------------------------------------------------
[ERROR] bootstrap class path not set in conjunction with -source 1.6
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[29,44] error: package fr.ifremer.tutti.persistence.entities does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[30,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[28,35] error: package fr.ifremer.tutti.persistence does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[30,23] error: cannot find symbol
[ERROR] symbol: class TuttiTechnicalException
location: package fr.ifremer.tutti
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[31,44] error: package fr.ifremer.tutti.persistence.entities does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[29,44] error: package fr.ifremer.tutti.persistence.entities does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[30,53] error: package fr.ifremer.tutti.persistence.entities.protocol does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[31,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[32,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[27,23] error: cannot find symbol
[ERROR] symbol: class TuttiTechnicalException
location: package fr.ifremer.tutti
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[28,44] error: package fr.ifremer.tutti.persistence.entities does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[38,136] error: cannot find symbol
[ERROR] symbol: class IdAware
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[45,67] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[27,53] error: package fr.ifremer.tutti.persistence.entities.protocol does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[28,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[29,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
projectFailed fr.ifremer.tutti:tutti-ui-swing:1.2-SNAPSHOT
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[38,74] error: cannot find symbol
[ERROR] symbol: class SpeciesProtocol
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>:[3,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>:[4,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[31,44] error: package fr.ifremer.tutti.persistence.entities does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[32,53] error: package fr.ifremer.tutti.persistence.entities.protocol does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[33,53] error: package fr.ifremer.tutti.persistence.entities.protocol does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[34,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[35,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[29,23] error: cannot find symbol
[ERROR] symbol: class TuttiIOUtil
location: package fr.ifremer.tutti
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[30,23] error: cannot find symbol
[ERROR] symbol: class TuttiTechnicalException
location: package fr.ifremer.tutti
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[31,35] error: package fr.ifremer.tutti.persistence does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[32,49] error: package fr.ifremer.tutti.persistence.entities.data does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[33,49] error: package fr.ifremer.tutti.persistence.entities.data does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[127,39] error: cannot find symbol
[ERROR] symbol: class ProgressionModel
location: class AbstractTuttiAction<M,UI,H>
where M,UI,H are type-variables:
M extends AbstractBean declared in class AbstractTuttiAction
UI extends TuttiUI<M,?> declared in class AbstractTuttiAction
H extends AbstractTuttiUIHandler<M,UI> declared in class AbstractTuttiAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[131,14] error: cannot find symbol
[ERROR] symbol: class ProgressionModel
location: class AbstractTuttiAction<M,UI,H>
where M,UI,H are type-variables:
M extends AbstractBean declared in class AbstractTuttiAction
UI extends TuttiUI<M,?> declared in class AbstractTuttiAction
H extends AbstractTuttiUIHandler<M,UI> declared in class AbstractTuttiAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[30,53] error: package fr.ifremer.tutti.persistence.entities.protocol does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[31,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[32,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[33,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[34,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[35,56] error: package fr.ifremer.tutti.persistence.entities.referential does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[28,23] error: cannot find symbol
[ERROR] symbol: class TuttiTechnicalException
location: package fr.ifremer.tutti
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[27,49] error: package fr.ifremer.tutti.persistence.entities.data does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[615,25] error: cannot find symbol
[ERROR] symbol: class IdAware
location: class AbstractTuttiUIHandler<M,UI>
where M,UI are type-variables:
M extends Object declared in class AbstractTuttiUIHandler
UI extends TuttiUI<M,?> declared in class AbstractTuttiUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[96,19] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[98,19] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[100,31] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[102,26] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[104,19] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[106,26] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[108,49] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[112,28] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[115,17] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[151,42] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[166,43] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[181,45] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[216,16] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[220,42] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[224,16] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[228,35] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[236,28] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[240,22] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[244,56] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[248,16] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[252,23] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[256,59] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[264,16] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[268,39] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[272,23] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[276,48] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[62,14] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[74,14] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[82,34] error: cannot find symbol
[ERROR] symbol: class SpeciesProtocol
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[86,63] error: cannot find symbol
[ERROR] symbol: class SpeciesProtocol
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[98,11] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[102,27] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[162,11] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[166,34] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolSpeciesRowModel
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>:[116,29] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>:[120,29] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>:[132,37] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>:[139,29] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>:[450,26] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>:[466,26] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>:[510,34] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>:[530,26] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUI
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[388,57] error: cannot find symbol
[ERROR] symbol: class SpeciesProtocol
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[495,67] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[495,11] error: cannot find symbol
[ERROR] symbol: class Species
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[510,49] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[511,39] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[513,44] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class EditProtocolUIHandler
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[137,20] error: cannot find symbol
[ERROR] symbol: class RessourceClassLoader
location: class TuttiUIContext
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[27,23] error: cannot find symbol
[ERROR] symbol: class TuttiBusinessException
location: package fr.ifremer.tutti
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[28,35] error: package fr.ifremer.tutti.persistence does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[27,35] error: package fr.ifremer.tutti.persistence does not exist
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[689,11] error: cannot find symbol
[ERROR] symbol: class RessourceClassLoader
location: class TuttiUIContext
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[58,14] error: cannot find symbol
[ERROR] symbol: class Program
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[60,14] error: cannot find symbol
[ERROR] symbol: class Cruise
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[62,14] error: cannot find symbol
[ERROR] symbol: class TuttiProtocol
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[64,19] error: cannot find symbol
[ERROR] symbol: class Caracteristic
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[66,19] error: cannot find symbol
[ERROR] symbol: class Person
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[68,19] error: cannot find symbol
[ERROR] symbol: class Species
location: class TuttiDataContext
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[70,19] error: cannot find symbol
[INFO] 100 errors
[INFO] -------------------------------------------------------------
1
1
r657 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species
by kmorin@users.forge.codelutin.com 19 Mar '13
by kmorin@users.forge.codelutin.com 19 Mar '13
19 Mar '13
Author: kmorin
Date: 2013-03-19 11:36:27 +0100 (Tue, 19 Mar 2013)
New Revision: 657
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/657
Log:
fixes #2159 [CAPTURE] - Esp?\195?\168ces - La suppression de toutes les mensurations ne met pas ?\195?\160 jour la cellule du tableau
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-18 16:19:09 UTC (rev 656)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-19 10:36:27 UTC (rev 657)
@@ -853,16 +853,18 @@
public void updateTotalFromFrequencies(SpeciesBatchRowModel row) {
List<SpeciesFrequencyRowModel> frequency = row.getFrequency();
+ Integer totalNumber = 0;
+ boolean onlyOneFrequency = false;
if (CollectionUtils.isNotEmpty(frequency)) {
- Integer totalNumber = 0;
for (SpeciesFrequencyRowModel frequencyModel : frequency) {
if (frequencyModel.getNumber() != null) {
totalNumber += frequencyModel.getNumber();
}
}
- row.setComputedNumber(totalNumber);
- row.getFinestCategory().setOnlyOneFrequency(frequency.size() == 1);
+ onlyOneFrequency = frequency.size() == 1;
}
+ row.setComputedNumber(totalNumber);
+ row.getFinestCategory().setOnlyOneFrequency(onlyOneFrequency);
}
1
0
r656 - in trunk: . tutti-persistence tutti-service tutti-ui-swing
by maven-release@users.forge.codelutin.com 18 Mar '13
by maven-release@users.forge.codelutin.com 18 Mar '13
18 Mar '13
Author: maven-release
Date: 2013-03-18 17:19:09 +0100 (Mon, 18 Mar 2013)
New Revision: 656
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/656
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-18 16:19:01 UTC (rev 655)
+++ trunk/pom.xml 2013-03-18 16:19:09 UTC (rev 656)
@@ -33,7 +33,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.1.1</version>
+ <version>1.2-SNAPSHOT</version>
<modules>
<module>tutti-persistence</module>
@@ -89,12 +89,12 @@
</developers>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-1.1.1</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-1.1.1
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-1.1.1
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</developerConnection>
</scm>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2013-03-18 16:19:01 UTC (rev 655)
+++ trunk/tutti-persistence/pom.xml 2013-03-18 16:19:09 UTC (rev 656)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.1.1</version>
+ <version>1.2-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2013-03-18 16:19:01 UTC (rev 655)
+++ trunk/tutti-service/pom.xml 2013-03-18 16:19:09 UTC (rev 656)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.1.1</version>
+ <version>1.2-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-03-18 16:19:01 UTC (rev 655)
+++ trunk/tutti-ui-swing/pom.xml 2013-03-18 16:19:09 UTC (rev 656)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.1.1</version>
+ <version>1.2-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0