Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: a00d55a2 by Tony CHEMIT at 2018-03-28T11:07:05Z fix dependency version - - - - - 3368d62e by Tony CHEMIT at 2018-03-28T11:07:22Z use next tooltit version - - - - - ba0c1ba6 by Tony CHEMIT at 2018-03-28T11:07:45Z can create new data at last - - - - - 84d9c371 by Tony CHEMIT at 2018-03-28T11:08:03Z fix measurement render - - - - - 4 changed files: - client/pom.xml - client/src/main/java/fr/ird/observe/client/ui/content/table/GearUseFeatureMeasurementCellRenderer.java - client/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTree.java - pom.xml Changes: ===================================== client/pom.xml ===================================== --- a/client/pom.xml +++ b/client/pom.xml @@ -626,7 +626,7 @@ <dependency> <groupId>org.jetbrains</groupId> <artifactId>annotations</artifactId> - <version>RELEASE</version> + <version>15.0</version> </dependency> </dependencies> ===================================== client/src/main/java/fr/ird/observe/client/ui/content/table/GearUseFeatureMeasurementCellRenderer.java ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/content/table/GearUseFeatureMeasurementCellRenderer.java +++ b/client/src/main/java/fr/ird/observe/client/ui/content/table/GearUseFeatureMeasurementCellRenderer.java @@ -23,7 +23,6 @@ package fr.ird.observe.client.ui.content.table; */ import fr.ird.observe.client.ui.util.UIHelper; -import fr.ird.observe.dto.referential.GearCaracteristicDto; import fr.ird.observe.dto.referential.GearCaracteristicReference; import fr.ird.observe.dto.referential.GearCaracteristicTypeHelper; import java.awt.Component; @@ -41,9 +40,8 @@ import javax.swing.table.TableCellRenderer; */ public class GearUseFeatureMeasurementCellRenderer implements TableCellRenderer { - protected final int caracteristicColumn; - - protected final Map<String, TableCellRenderer> renderersByCaracteristicTypeId; + private final int caracteristicColumn; + private final Map<String, TableCellRenderer> renderersByCaracteristicTypeId; public GearUseFeatureMeasurementCellRenderer(int caracteristicColumn, DefaultTableCellRenderer renderer) { @@ -90,7 +88,7 @@ public class GearUseFeatureMeasurementCellRenderer implements TableCellRenderer tableCellRenderer = table.getDefaultRenderer(Object.class); } else { - String gearCaracteristicTypeId = caracteristicRef.getPropertyValue(GearCaracteristicDto.PROPERTY_GEAR_CARACTERISTIC_TYPE); + String gearCaracteristicTypeId = caracteristicRef.getGearCaracteristicTypeId(); tableCellRenderer = renderersByCaracteristicTypeId.get(gearCaracteristicTypeId); ===================================== client/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTree.java ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTree.java +++ b/client/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTree.java @@ -10,19 +10,18 @@ package fr.ird.observe.client.ui.tree.navigation; * 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.ird.observe.spi.DtoModelHelper; import fr.ird.observe.client.ObserveSwingApplicationContext; import fr.ird.observe.client.db.ClientDataContext; import fr.ird.observe.client.db.ObserveSwingDataSource; @@ -43,7 +42,6 @@ import fr.ird.observe.client.ui.tree.navigation.nodes.seine.RoutesSeineNavigatio import fr.ird.observe.client.ui.tree.navigation.nodes.seine.SetSeineNavigationTreeNode; import fr.ird.observe.client.ui.tree.navigation.nodes.seine.TripSeineNavigationTreeNode; import fr.ird.observe.dto.IdDto; -import fr.ird.observe.dto.referential.ReferentialLocale; import fr.ird.observe.dto.data.longline.ActivityLonglineDto; import fr.ird.observe.dto.data.longline.ActivityLonglineReference; import fr.ird.observe.dto.data.longline.SetLonglineDto; @@ -63,12 +61,13 @@ import fr.ird.observe.dto.data.seine.TripSeineReference; import fr.ird.observe.dto.referential.ProgramDto; import fr.ird.observe.dto.referential.ProgramHelper; import fr.ird.observe.dto.referential.ProgramReference; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.List; -import java.util.Objects; -import java.util.Set; +import fr.ird.observe.dto.referential.ReferentialLocale; +import fr.ird.observe.spi.DtoModelHelper; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jdesktop.swingx.JXTree; + import javax.swing.SwingUtilities; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeWillExpandListener; @@ -76,10 +75,12 @@ import javax.swing.tree.DefaultTreeSelectionModel; import javax.swing.tree.ExpandVetoException; import javax.swing.tree.TreePath; import javax.swing.tree.TreeSelectionModel; -import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jdesktop.swingx.JXTree; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; +import java.util.Objects; +import java.util.Set; /** * Created on 14/11/16. @@ -112,7 +113,7 @@ public class NavigationTree extends JXTree { addTreeWillExpandListener(new TreeWillExpandListener() { @Override - public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException { + public void treeWillExpand(TreeExpansionEvent event) { if (!(getModel() instanceof NavigationTreeModel)) { return; } @@ -357,6 +358,7 @@ public class NavigationTree extends JXTree { getTreeModel().nodeChanged(node); if (deep) { // repaint childs nodes + @SuppressWarnings("unchecked") Enumeration<NavigationTreeNodeSupport<?>> e = node.children(); while (e.hasMoreElements()) { NavigationTreeNodeSupport<?> child = e.nextElement(); @@ -397,31 +399,22 @@ public class NavigationTree extends JXTree { // noeud en mode creation NavigationTreeNodeSupport result; - //FIXME Create empty reference if (TripSeineDto.class.equals(type)) { -// result = new TripSeineNavigationTreeNode(new TripSeineReference(null, null, null, 0, null, null)); - result = null; + result = new TripSeineNavigationTreeNode(new TripSeineReference(new TripSeineDto(), null, null, parentNode.getId(), 0, null, null)); } else if (RouteDto.class.equals(type)) { -// result = new RouteSeineNavigationTreeNode(new RouteReference(null, null)); - result = null; + result = new RouteSeineNavigationTreeNode(new RouteReference(new RouteDto(), null, null)); } else if (ActivitySeineDto.class.equals(type)) { -// result = new ActivitySeineNavigationTreeNode(new ActivitySeineReference(null, null, null, null)); - result = null; + result = new ActivitySeineNavigationTreeNode(new ActivitySeineReference(new ActivitySeineDto(), null, null, null, null)); } else if (SetSeineDto.class.equals(type)) { -// result = new SetSeineNavigationTreeNode(new SetSeineReference(null)); - result = null; + result = new SetSeineNavigationTreeNode(new SetSeineReference(new SetSeineDto(), null)); } else if (FloatingObjectDto.class.equals(type)) { -// result = new FloatingObjectSeineNavigationTreeNode(new FloatingObjectReference(null)); - result = null; + result = new FloatingObjectSeineNavigationTreeNode(new FloatingObjectReference(new FloatingObjectDto(), null)); } else if (TripLonglineDto.class.equals(type)) { -// result = new TripLonglineNavigationTreeNode(new TripLonglineReference(null, null, null, null, 0, null, null)); - result = null; + result = new TripLonglineNavigationTreeNode(new TripLonglineReference(new TripLonglineDto(), null, null, parentNode.getId(), null, 0, null, null)); } else if (ActivityLonglineDto.class.equals(type)) { -// result = new ActivityLonglineNavigationTreeNode(new ActivityLonglineReference(null, null, null, null)); - result = null; + result = new ActivityLonglineNavigationTreeNode(new ActivityLonglineReference(new ActivityLonglineDto(), null, null, null, null)); } else if (SetLonglineDto.class.equals(type)) { -// result = new SetLonglineNavigationTreeNode(new SetLonglineReference(null)); - result = null; + result = new SetLonglineNavigationTreeNode(new SetLonglineReference(new SetLonglineDto(), null)); } else { throw new IllegalStateException("Can't use type to create unsaved node: " + type.getName()); } ===================================== pom.xml ===================================== --- a/pom.xml +++ b/pom.xml @@ -152,7 +152,7 @@ <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format> <buildDate>${maven.build.timestamp}</buildDate> - <observeToolkitVersion>1.4</observeToolkitVersion> + <observeToolkitVersion>1.5-SNAPSHOT</observeToolkitVersion> <eugenePluginVersion>3.0-alpha-13</eugenePluginVersion> <processorPluginVersion>1.3</processorPluginVersion> View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/7f8c7c2d523d3b580f131b8e413... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/7f8c7c2d523d3b580f131b8e413... You're receiving this email because of your account on gitlab.com.