branch feature/7591_Correction_migration_entites_d_un_parent_a_un_autre updated (01f3824 -> d2a81c3)
This is an automated email from the git hooks/post-receive script. New change to branch feature/7591_Correction_migration_entites_d_un_parent_a_un_autre in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git from 01f3824 Fix activity lonline trip move action new d2a81c3 Fix trip/route/activity transfer via context menu : move the entity from a node to another closing it (except if it's a trip) at the same time The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit d2a81c3b460093e216bc8b5fc0ce38242102c8b8 Author: Samuel Maisonneuve <maisonneuve@codelutin.com> Date: Tue Aug 2 12:08:53 2016 +0200 Fix trip/route/activity transfer via context menu : move the entity from a node to another closing it (except if it's a trip) at the same time refs #7591 Summary of changes: .../actions/ChangeActivityRouteActionListener.java | 32 ++--------------- .../actions/ChangeActivityTripActionListener.java | 40 ++++------------------ .../actions/ChangeRouteTripActionListener.java | 39 ++++----------------- .../actions/ChangeTripProgramActionListener.java | 22 +++--------- .../ui/tree/actions/NodeChangeActionListener.java | 18 ++-------- 5 files changed, 22 insertions(+), 129 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7591_Correction_migration_entites_d_un_parent_a_un_autre in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit d2a81c3b460093e216bc8b5fc0ce38242102c8b8 Author: Samuel Maisonneuve <maisonneuve@codelutin.com> Date: Tue Aug 2 12:08:53 2016 +0200 Fix trip/route/activity transfer via context menu : move the entity from a node to another closing it (except if it's a trip) at the same time refs #7591 --- .../actions/ChangeActivityRouteActionListener.java | 32 ++--------------- .../actions/ChangeActivityTripActionListener.java | 40 ++++------------------ .../actions/ChangeRouteTripActionListener.java | 39 ++++----------------- .../actions/ChangeTripProgramActionListener.java | 22 +++--------- .../ui/tree/actions/NodeChangeActionListener.java | 18 ++-------- 5 files changed, 22 insertions(+), 129 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityRouteActionListener.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityRouteActionListener.java index ec42ecb..6287d15 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityRouteActionListener.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityRouteActionListener.java @@ -66,9 +66,9 @@ public class ChangeActivityRouteActionListener extends NodeChangeActionListener } @Override - protected void closeParent(String oldParentId) { + protected void closeNode(String activityId) { ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - applicationContext.getOpenDataManager().closeRoute(oldParentId); + applicationContext.getOpenDataManager().closeActivitySeine(activityId); } @Override @@ -83,32 +83,4 @@ public class ChangeActivityRouteActionListener extends NodeChangeActionListener return position; } - @Override - protected void openParent(ObserveNode activitiesNode) { - - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - - ObserveNode routeNode = activitiesNode.getParent(); - String routeId = routeNode.getId(); - - ObserveNode routesNode = routeNode.getParent(); - ObserveNode tripNode = routesNode.getParent(); - String tripId = tripNode.getId(); - - applicationContext.getOpenDataManager().openRoute(tripId, routeId); - - getTreeHelper().reloadNode(tripNode, true); - } - - @Override - protected void openChild(ObserveNode activitiesNode, ObserveNode activityNode) { - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - - ObserveNode routeNode = activitiesNode.getParent(); - - applicationContext.getOpenDataManager().openActivitySeine(routeNode.getId(), activityNode.getId()); - - getTreeHelper().reloadNode(routeNode, true); - } - } diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityTripActionListener.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityTripActionListener.java index 2a232cf..e24f9ea 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityTripActionListener.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityTripActionListener.java @@ -52,6 +52,12 @@ public class ChangeActivityTripActionListener extends NodeChangeActionListener { } @Override + protected void closeNode(String activityId) { + ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); + applicationContext.getOpenDataManager().closeActivityLongline(activityId); + } + + @Override protected ObserveNode getParentNode(ObserveNode node) { return node.getParent().getParent(); } @@ -66,12 +72,6 @@ public class ChangeActivityTripActionListener extends NodeChangeActionListener { } @Override - protected void closeParent(String oldParentId) { - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - applicationContext.getOpenDataManager().closeTripLongline(oldParentId); - } - - @Override protected int moveNodeToParent(String nodeId, String parentNodeId) { int position; @@ -83,32 +83,4 @@ public class ChangeActivityTripActionListener extends NodeChangeActionListener { return position; } - @Override - protected void openParent(ObserveNode activitiesNode) { - - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - - ObserveNode tripLonglineNode = activitiesNode.getParent(); - String tripLonglineId = tripLonglineNode.getId(); - - ObserveNode programNode = tripLonglineNode.getParent(); - String programId = programNode.getId(); - - applicationContext.getOpenDataManager().openTripLongline(programId, tripLonglineId); - - getTreeHelper().reloadNode(programNode, true); - } - - @Override - protected void openChild(ObserveNode activitiesNode, ObserveNode activityNode) { - - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - - ObserveNode tripNode = activitiesNode.getParent(); - - applicationContext.getOpenDataManager().openActivityLongline(tripNode.getId(), activityNode.getId()); - - getTreeHelper().reloadNode(tripNode, true); - - } } diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeRouteTripActionListener.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeRouteTripActionListener.java index d723dd5..3843988 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeRouteTripActionListener.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeRouteTripActionListener.java @@ -52,6 +52,12 @@ public class ChangeRouteTripActionListener extends NodeChangeActionListener { } @Override + protected void closeNode(String routeId) { + ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); + applicationContext.getOpenDataManager().closeRoute(routeId); + } + + @Override protected ObserveNode getParentNode(ObserveNode node) { return node.getParent().getParent(); } @@ -66,12 +72,6 @@ public class ChangeRouteTripActionListener extends NodeChangeActionListener { } @Override - protected void closeParent(String oldParentId) { - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - applicationContext.getOpenDataManager().closeTripSeine(oldParentId); - } - - @Override protected int moveNodeToParent(String nodeId, String parentNodeId) { int position; @@ -82,31 +82,4 @@ public class ChangeRouteTripActionListener extends NodeChangeActionListener { return position; } - - @Override - protected void openParent(ObserveNode routesNode) { - - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - - ObserveNode tripNode = routesNode.getParent(); - String tripId = tripNode.getId(); - - ObserveNode programNode = tripNode.getParent(); - String programId = programNode.getId(); - - applicationContext.getOpenDataManager().openTripSeine(programId, tripId); - - getTreeHelper().reloadNode(programNode, true); - } - - @Override - protected void openChild(ObserveNode routesNode, ObserveNode routeNode) { - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - - ObserveNode tripNode = routesNode.getParent(); - - applicationContext.getOpenDataManager().openRoute(tripNode.getId(), routeNode.getId()); - - getTreeHelper().reloadNode(tripNode, true); - } } diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java index cad7f9b..101736d 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java @@ -52,6 +52,11 @@ public class ChangeTripProgramActionListener extends NodeChangeActionListener { } @Override + protected void closeNode(String tripId) { + // Don't do anything : trip should stay open when being transfered + } + + @Override protected ObserveNode getParentNode(ObserveNode node) { return node.getParent(); } @@ -62,12 +67,6 @@ public class ChangeTripProgramActionListener extends NodeChangeActionListener { } @Override - protected void closeParent(String oldParentId) { - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - applicationContext.getOpenDataManager().closeProgram(oldParentId); - } - - @Override protected int moveNodeToParent(String nodeId, String parentNodeId) { int position; @@ -84,15 +83,4 @@ public class ChangeTripProgramActionListener extends NodeChangeActionListener { return position; } - - @Override - protected void openParent(ObserveNode programNode) { - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - applicationContext.getOpenDataManager().openProgram(programNode.getId()); - } - - @Override - protected void openChild(ObserveNode parentNode, ObserveNode childNode) { - // don't need to do anything since closing a program doesn't close its open trip (if there is one) - } } diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/NodeChangeActionListener.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/NodeChangeActionListener.java index adb92ae..188e6f5 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/NodeChangeActionListener.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/NodeChangeActionListener.java @@ -66,12 +66,10 @@ public abstract class NodeChangeActionListener implements ActionListener { ObserveNode node = treeHelper.getSelectedNode(); ObserveNode oldParentNode = getParentNode(node); - String oldParentId = oldParentNode.getId(); ObserveNode grandParentNode = oldParentNode.getParent(); ObserveNode newParentNode = getNewParentNode(grandParentNode, parentNodeId); - boolean wasOpen = node.isOpen(); - closeParent(oldParentId); + closeNode(node.getId()); int position = moveNodeToParent(nodeId, parentNodeId); @@ -91,12 +89,6 @@ public abstract class NodeChangeActionListener implements ActionListener { newNode = node; } - openParent(newParentNode); - - if (wasOpen) { - openChild(newParentNode, node); - } - treeHelper.selectNode(newNode); } @@ -105,15 +97,11 @@ public abstract class NodeChangeActionListener implements ActionListener { return treeHelper; } + protected abstract void closeNode(String nodeId); + protected abstract ObserveNode getParentNode(ObserveNode node); protected abstract ObserveNode getNewParentNode(ObserveNode grandParentNode, String parentNodeId); - protected abstract void closeParent(String oldParentId); - protected abstract int moveNodeToParent(String nodeId, String parentNodeId); - - protected abstract void openParent(ObserveNode parentNode); - - protected abstract void openChild(ObserveNode parentNode, ObserveNode childNode); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm