|
From: <de...@us...> - 2012-07-13 06:52:05
|
Revision: 7491
http://fudaa.svn.sourceforge.net/fudaa/?rev=7491&view=rev
Author: deniger
Date: 2012-07-13 06:51:55 +0000 (Fri, 13 Jul 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionBrancheCreator.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionPrevalidateModifyRelationSection.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/AbstractModellingOpenTopNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListBranchesAddNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListBranchesNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCasiersAddNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCasiersNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCondInitNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListNoeudsAddNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListNoeudsNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListSectionAddNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListSectionsNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTGNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTINodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTRNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModelePNUMNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingScenarioORESNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingScenarioPCALNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingOpenEMHNodeAction.java
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionBrancheCreator.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionBrancheCreator.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionBrancheCreator.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -238,7 +238,7 @@
dcsp.addElemSeuilAvecPdc(new ElemSeuilAvecPdc(ccm));
dcsp.setFormulePdc(EnumFormulePdc.BORDA);
branche.addInfosEMH(dcsp);
- addDefaultsSectionSansGeometrie(ccm, name, sousModele, branche, 0);//distance forcee a 0
+ addDefaultsSectionProfils(ccm, name, sousModele, branche, 0);//distance forcee a 0
return branche;
}
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionPrevalidateModifyRelationSection.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionPrevalidateModifyRelationSection.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionPrevalidateModifyRelationSection.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -225,7 +225,7 @@
if (branche == null) {
msgs.add(log.addSevereError("ChangeEMH.BrancheUnknown", nom, brancheNom));
} else if (sectionType != null && !authorizedSection.get(branche.getBrancheType()).contains(sectionType)) {
- msgs.add(log.addSevereError("AddEMH.BrancheSaintVenantNotSupportThisSection", nom, brancheNom, sectionType.geti18n()));
+ msgs.add(log.addSevereError("ChangeEMH.BrancheNotSupportThisSection", nom, brancheNom, sectionType.geti18n()));
}
double abscisseHydraulique = content.getAbscisseHydraulique();
Pair<String, Object[]> valueError = xpProperty.getValidator().getValidateErrorParamForValue(abscisseHydraulique);
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/AbstractModellingOpenTopNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/AbstractModellingOpenTopNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/AbstractModellingOpenTopNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -40,7 +40,6 @@
public void openNewTopComponent(Node[] activatedNodes) {
TopComponent openNew = openNew(activatedNodes[0]);
- topComponentClass = openNew.getClass();
activeInMode(openNew, getMode(openNew));
}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListBranchesAddNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListBranchesAddNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListBranchesAddNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -3,6 +3,7 @@
import org.fudaa.fudaa.crue.modelling.list.AbstractModellingListTopComponent;
import org.fudaa.fudaa.crue.modelling.list.ModellingListBrancheAddTopComponent;
import org.fudaa.fudaa.crue.modelling.list.ModellingListNoeudAddTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent;
@@ -34,6 +35,11 @@
return new ModellingListBrancheAddTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingListBrancheAddTopComponent.class;
+ }
+
private static TopComponent create(final Long uiId) {
final ModellingListBrancheAddTopComponent topComponent = new ModellingListBrancheAddTopComponent();
topComponent.setSousModeleUid(uiId);
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListBranchesNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListBranchesNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListBranchesNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -1,7 +1,9 @@
package org.fudaa.fudaa.crue.modelling.action;
import org.fudaa.fudaa.crue.modelling.list.AbstractModellingListTopComponent;
+import org.fudaa.fudaa.crue.modelling.list.ModellingListBrancheAddTopComponent;
import org.fudaa.fudaa.crue.modelling.list.ModellingListBrancheTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -20,6 +22,11 @@
return new ModellingListBrancheTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingListBrancheTopComponent.class;
+ }
+
public static class Reopen extends ModellingListBranchesNodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCasiersAddNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCasiersAddNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCasiersAddNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -2,6 +2,7 @@
import org.fudaa.fudaa.crue.modelling.list.AbstractModellingListTopComponent;
import org.fudaa.fudaa.crue.modelling.list.ModellingListCasierAddTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent;
@@ -29,6 +30,11 @@
}
@Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingListCasierAddTopComponent.class;
+ }
+
+ @Override
protected AbstractModellingListTopComponent create() {
return new ModellingListCasierAddTopComponent();
}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCasiersNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCasiersNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCasiersNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -2,6 +2,7 @@
import org.fudaa.fudaa.crue.modelling.list.AbstractModellingListTopComponent;
import org.fudaa.fudaa.crue.modelling.list.ModellingListCasierTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -20,6 +21,11 @@
return new ModellingListCasierTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingListCasierTopComponent.class;
+ }
+
public static class Reopen extends ModellingListCasiersNodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCondInitNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCondInitNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListCondInitNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -1,8 +1,8 @@
package org.fudaa.fudaa.crue.modelling.action;
import org.fudaa.fudaa.crue.modelling.calcul.AbstractModeleTopComponent;
-import org.fudaa.fudaa.crue.modelling.list.AbstractModellingListTopComponent;
import org.fudaa.fudaa.crue.modelling.calcul.ModellingListCiniTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -21,6 +21,11 @@
return new ModellingListCiniTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingListCiniTopComponent.class;
+ }
+
public static class Reopen extends ModellingListCondInitNodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListNoeudsAddNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListNoeudsAddNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListNoeudsAddNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -2,6 +2,7 @@
import org.fudaa.fudaa.crue.modelling.list.AbstractModellingListTopComponent;
import org.fudaa.fudaa.crue.modelling.list.ModellingListNoeudAddTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent;
@@ -33,6 +34,11 @@
return new ModellingListNoeudAddTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingListNoeudAddTopComponent.class;
+ }
+
private static TopComponent create(final Long uiId) {
final ModellingListNoeudAddTopComponent modellingListNoeudTopComponent = new ModellingListNoeudAddTopComponent();
modellingListNoeudTopComponent.setSousModeleUid(uiId);
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListNoeudsNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListNoeudsNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListNoeudsNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -2,6 +2,7 @@
import org.fudaa.fudaa.crue.modelling.list.AbstractModellingListTopComponent;
import org.fudaa.fudaa.crue.modelling.list.ModellingListNoeudTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -19,6 +20,11 @@
return new ModellingListNoeudTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingListNoeudTopComponent.class;
+ }
+
public static class Reopen extends ModellingListNoeudsNodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListSectionAddNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListSectionAddNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListSectionAddNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -2,6 +2,7 @@
import org.fudaa.fudaa.crue.modelling.list.AbstractModellingListTopComponent;
import org.fudaa.fudaa.crue.modelling.list.ModellingListSectionAddTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent;
@@ -33,6 +34,11 @@
return new ModellingListSectionAddTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingListSectionAddTopComponent.class;
+ }
+
private static TopComponent create(final Long uiId) {
final ModellingListSectionAddTopComponent top = new ModellingListSectionAddTopComponent();
top.setSousModeleUid(uiId);
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListSectionsNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListSectionsNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingListSectionsNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -2,6 +2,7 @@
import org.fudaa.fudaa.crue.modelling.list.AbstractModellingListTopComponent;
import org.fudaa.fudaa.crue.modelling.list.ModellingListSectionTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -20,6 +21,11 @@
return new ModellingListSectionTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingListSectionTopComponent.class;
+ }
+
public static class Reopen extends ModellingListSectionsNodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTGNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTGNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTGNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -2,6 +2,7 @@
import org.fudaa.fudaa.crue.modelling.calcul.AbstractModeleTopComponent;
import org.fudaa.fudaa.crue.modelling.calcul.ModellingModeleOPTGTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -20,6 +21,11 @@
return new ModellingModeleOPTGTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingModeleOPTGTopComponent.class;
+ }
+
public static class Reopen extends ModellingModeleOPTGNodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTINodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTINodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTINodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -2,6 +2,7 @@
import org.fudaa.fudaa.crue.modelling.calcul.AbstractModeleTopComponent;
import org.fudaa.fudaa.crue.modelling.calcul.ModellingModeleOPTITopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -20,6 +21,11 @@
return new ModellingModeleOPTITopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingModeleOPTITopComponent.class;
+ }
+
public static class Reopen extends ModellingModeleOPTINodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTRNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTRNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModeleOPTRNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -2,6 +2,7 @@
import org.fudaa.fudaa.crue.modelling.calcul.AbstractModeleTopComponent;
import org.fudaa.fudaa.crue.modelling.calcul.ModellingModeleOPTRTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -20,6 +21,11 @@
return new ModellingModeleOPTRTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingModeleOPTRTopComponent.class;
+ }
+
public static class Reopen extends ModellingModeleOPTRNodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModelePNUMNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModelePNUMNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingModelePNUMNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -2,6 +2,7 @@
import org.fudaa.fudaa.crue.modelling.calcul.AbstractModeleTopComponent;
import org.fudaa.fudaa.crue.modelling.calcul.ModellingModelePNUMTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -20,6 +21,11 @@
return new ModellingModelePNUMTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingModelePNUMTopComponent.class;
+ }
+
public static class Reopen extends ModellingModelePNUMNodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingScenarioORESNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingScenarioORESNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingScenarioORESNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -1,6 +1,7 @@
package org.fudaa.fudaa.crue.modelling.action;
import org.fudaa.fudaa.crue.modelling.calcul.ModellingScenarioORESTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -19,6 +20,11 @@
return new ModellingScenarioORESTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingScenarioORESTopComponent.class;
+ }
+
public static class Reopen extends ModellingScenarioORESNodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingScenarioPCALNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingScenarioPCALNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingScenarioPCALNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -1,6 +1,7 @@
package org.fudaa.fudaa.crue.modelling.action;
import org.fudaa.fudaa.crue.modelling.calcul.ModellingScenarioPCALTopComponent;
+import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/**
@@ -19,6 +20,11 @@
return new ModellingScenarioPCALTopComponent();
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ return ModellingScenarioPCALTopComponent.class;
+ }
+
public static class Reopen extends ModellingScenarioPCALNodeAction {
public Reopen() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingOpenEMHNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingOpenEMHNodeAction.java 2012-07-12 21:56:07 UTC (rev 7490)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingOpenEMHNodeAction.java 2012-07-13 06:51:55 UTC (rev 7491)
@@ -43,6 +43,12 @@
return top;
}
+ @Override
+ protected Class getExpectedTopComponentClass(Node selectedNode) {
+ EMH emh = selectedNode.getLookup().lookup(EMH.class);
+ return getClass(emh);
+ }
+
public static void open(EMH emh, boolean reopen) {
if (emh == null) {
return;
@@ -59,6 +65,7 @@
}
private AbstractModellingEMHTopComponent create(EMH emh) {
+ //TODO voir si on peut partir de la class et creer par introspection
EnumCatEMH catType = emh.getCatType();
switch (catType) {
case NOEUD:
@@ -74,6 +81,22 @@
throw new UnsupportedOperationException("Not supported yet.");
}
+ private Class getClass(EMH emh) {
+ EnumCatEMH catType = emh.getCatType();
+ switch (catType) {
+ case NOEUD:
+ return ModellingEMHNoeudTopComponent.class;
+ case SECTION:
+ return ModellingEMHSectionTopComponent.class;
+ case CASIER:
+ return ModellingEMHCasierTopComponent.class;
+ case BRANCHE:
+ //TODO a continuer pour les types de branches:
+ return ModellingEMHBrancheTopComponent.class;
+ }
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
@Override
protected String getMode(TopComponent top) {
Class<? extends TopComponent> aClass = top.getClass();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-07-13 08:28:16
|
Revision: 7492
http://fudaa.svn.sourceforge.net/fudaa/?rev=7492&view=rev
Author: deniger
Date: 2012-07-13 08:28:05 +0000 (Fri, 13 Jul 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionBrancheCreator.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionChangeActivity.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionCreateEMH.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionDelete.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCLimMScenario.java
trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/CondInitNodeFactory.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/ModellingListCiniTopComponent.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/EMHModificationProcessor.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/global/GlobalContainerNode.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/list/AbstractModellingListTopComponent.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/services/EnumModification.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/OpenEMHAction.java
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/modelling-oresWsmode.xml
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionBrancheCreator.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionBrancheCreator.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionBrancheCreator.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -97,15 +97,28 @@
return null;
}
- protected CatEMHBranche createBranche(EMHSousModele sousModele, EnumBrancheType brancheType, CatEMHNoeud noeudAmont,
+ /**
+ * @param initBrancheName si non null, sera utilisé. Dans ce cas, on suppose que le nom est unique.
+ * @param sousModele
+ * @param brancheType
+ * @param noeudAmont
+ * @param noeudAval
+ * @param ccm
+ * @param distance
+ * @return
+ */
+ protected CatEMHBranche createBranche(String initBrancheName, EMHSousModele sousModele, EnumBrancheType brancheType, CatEMHNoeud noeudAmont,
CatEMHNoeud noeudAval,
CrueConfigMetier ccm, double distance) {
if (!isDistanceValid(brancheType, distance, ccm)) {
return null;
}
final EMHScenario scenario = sousModele.getParent().getParent();
- String brancheName = sectionCreator.getUniqueNomFinder().findNewName(EnumCatEMH.BRANCHE, scenario);
- CatEMHBranche branche = createBranche(brancheName, brancheType, ccm, sousModele, distance);
+ String brancheName = initBrancheName;
+ if (brancheName == null) {
+ brancheName = sectionCreator.getUniqueNomFinder().findNewName(EnumCatEMH.BRANCHE, scenario);
+ }
+ CatEMHBranche branche = createBrancheInstance(brancheName, brancheType, ccm, sousModele, distance);
CatEMHNoeud noeudAmontToUse = noeudAmont;
CatEMHNoeud noeudAvalToUse = noeudAval;
if (noeudAmontToUse == null) {
@@ -122,7 +135,7 @@
}
- private CatEMHBranche createBranche(String name, EnumBrancheType brancheType, CrueConfigMetier ccm, EMHSousModele sousModele,
+ private CatEMHBranche createBrancheInstance(String name, EnumBrancheType brancheType, CrueConfigMetier ccm, EMHSousModele sousModele,
double distance) {
switch (brancheType) {
case EMHBrancheBarrageFilEau:
@@ -164,7 +177,7 @@
private CatEMHBranche createEMHBrancheBarrageGenerique(String name, CrueConfigMetier ccm, EMHSousModele sousModele,
double distance) {
EMHBrancheBarrageGenerique branche = new EMHBrancheBarrageGenerique(name);
- addDefaultsSectionProfils(ccm, name, sousModele, branche, distance);
+ addDefaultsSectionSansGeometrie(ccm, name, sousModele, branche, distance);
final DonCalcSansPrtBrancheBarrageGenerique dcsp = new DonCalcSansPrtBrancheBarrageGenerique(ccm);
dcsp.setRegimeDenoye(loiCreator.createLoiFF(name, sousModele.getParent().getParent(), EnumTypeLoi.LoiQpilZam, ccm));
dcsp.setRegimeNoye(loiCreator.createLoiFF(name, sousModele.getParent().getParent(), EnumTypeLoi.LoiQDz, ccm));
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionChangeActivity.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionChangeActivity.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionChangeActivity.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -7,6 +7,7 @@
import java.util.Collection;
import org.fudaa.ctulu.CtuluLog;
import org.fudaa.dodico.crue.config.CrueConfigMetier;
+import org.fudaa.dodico.crue.metier.emh.DonCLimMScenario;
import org.fudaa.dodico.crue.metier.emh.EMH;
import org.fudaa.dodico.crue.metier.emh.EMHModeleBase;
import org.fudaa.dodico.crue.metier.emh.OrdCalcScenario;
@@ -34,11 +35,11 @@
}
private void updateOCAL(EMHModeleBase modele) {
- OrdCalcScenario ordCalcScenario = modele.getParent().getOrdCalcScenario();
+ DonCLimMScenario dclm = modele.getParent().getDonCLimMScenario();
Collection<EMH> emhs = modele.getParent().getAllSimpleEMH();
for (EMH emh : emhs) {
if (!emh.getActuallyActive()) {
- ordCalcScenario.removeEMH(emh);
+ dclm.removeEMHFromCalcul(emh);
}
}
}
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionCreateEMH.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionCreateEMH.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionCreateEMH.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -78,7 +78,7 @@
if (!brancheTypeWithDistanceNotNull.contains(brancheType)) {
distanceToUse = 0;
}
- createBranche = brancheCreator.createBranche(defaultSousModele, brancheType, noeudAmont, noeudAval, crueConfigMetier, distanceToUse);
+ createBranche = brancheCreator.createBranche(null, defaultSousModele, brancheType, noeudAmont, noeudAval, crueConfigMetier, distanceToUse);
new EditionOPTIChanged().propagateChange(defaultSousModele.getParent(), crueConfigMetier);
return createBranche;
}
@@ -187,7 +187,7 @@
for (ListBrancheContent data : branches) {
CatEMHNoeud noeudAmont = noeudsByNoms.get(data.getNoeudAmont());
CatEMHNoeud noeudAval = noeudsByNoms.get(data.getNoeudAval());
- CatEMHBranche branche = brancheCreator.createBranche(sousModele, data.getType(), noeudAmont, noeudAval, ccm, data.getLongueur());
+ CatEMHBranche branche = brancheCreator.createBranche(data.getNom(), sousModele, data.getType(), noeudAmont, noeudAval, ccm, data.getLongueur());
branche.setCommentaire(data.getCommentaire());
}
new EditionOPTIChanged().propagateChange(sousModele.getParent(), ccm);
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionDelete.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionDelete.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/EditionDelete.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -297,7 +297,7 @@
if (completelyDeleted) {
scenario.getIdRegistry().unregister(section);
}
- scenario.getDonCLimMScenario().removeEMH(section);
+ scenario.getDonCLimMScenario().removeEMHFromCalcul(section);
res.nbSectionRemoved++;
}
@@ -305,6 +305,6 @@
private static void removeEMH(EMHScenario scenario, EMH toRemove) {
scenario.getIdRegistry().unregister(toRemove);
- scenario.getDonCLimMScenario().removeEMH(toRemove);
+ scenario.getDonCLimMScenario().removeEMHFromCalcul(toRemove);
}
}
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCLimMScenario.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCLimMScenario.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCLimMScenario.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -1,7 +1,7 @@
/**
* *********************************************************************
* Module: DonCLimMScenario.java Author: deniger Purpose: Defines the Class DonCLimMScenario
- **********************************************************************
+ * *********************************************************************
*/
package org.fudaa.dodico.crue.metier.emh;
@@ -15,13 +15,12 @@
public class DonCLimMScenario extends DonCLimMCommon implements Sortable {
/**
- * @pdRoleInfo migr=no name=CalcPseudoPerm assc=donCLimMScenarioCalculPermanent coll=java.util.List impl=java.util.ArrayList
- * mult=0..* type=Composition
+ * @pdRoleInfo migr=no name=CalcPseudoPerm assc=donCLimMScenarioCalculPermanent coll=java.util.List impl=java.util.ArrayList mult=0..*
+ * type=Composition
*/
private java.util.List<CalcPseudoPerm> calcPseudoPerm;
/**
- * @pdRoleInfo migr=no name=CalcTrans assc=donCLimMScenarioCalculTransitoire coll=java.util.List impl=java.util.ArrayList
- * mult=0..* type=Composition
+ * @pdRoleInfo migr=no name=CalcTrans assc=donCLimMScenarioCalculTransitoire coll=java.util.List impl=java.util.ArrayList mult=0..* type=Composition
*/
private java.util.List<CalcTrans> calcTrans;
@@ -50,8 +49,7 @@
}
- @Override
- public void removeEMH(EMH emh) {
+ public void removeEMHFromCalcul(EMH emh) {
if (calcPseudoPerm != null) {
for (CalcPseudoPerm pseudoPerm : calcPseudoPerm) {
pseudoPerm.remove(emh);
@@ -89,6 +87,7 @@
/**
* @pdGenerated default setter
+ *
* @param newCalcPseudoPerm
*/
public void setCalcPseudoPerm(final java.util.List<CalcPseudoPerm> newCalcPseudoPerm) {
@@ -100,6 +99,7 @@
/**
* @pdGenerated default add
+ *
* @param newCalcPseudoPerm
*/
public void addCalcPseudoPerm(final CalcPseudoPerm newCalcPseudoPerm) {
@@ -116,6 +116,7 @@
/**
* @pdGenerated default remove
+ *
* @param oldCalcPseudoPerm
*/
public void removeCalcPseudoPerm(final CalcPseudoPerm oldCalcPseudoPerm) {
@@ -160,6 +161,7 @@
/**
* @pdGenerated default setter
+ *
* @param newCalcTrans
*/
public void setCalcTrans(final java.util.List<CalcTrans> newCalcTrans) {
@@ -171,6 +173,7 @@
/**
* @pdGenerated default add
+ *
* @param newCalcTrans
*/
public void addCalcTrans(final CalcTrans newCalcTrans) {
@@ -187,6 +190,7 @@
/**
* @pdGenerated default remove
+ *
* @param oldCalcTrans
*/
public void removeCalcTrans(final CalcTrans oldCalcTrans) {
Modified: trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml 2012-07-13 08:28:05 UTC (rev 7492)
@@ -108,6 +108,7 @@
<file name="modelling-optg.wsmode" url="modelling-optgWsmode.xml"/>
<file name="modelling-optr.wsmode" url="modelling-optrWsmode.xml"/>
<file name="modelling-opti.wsmode" url="modelling-optiWsmode.xml"/>
+ <file name="modelling-ores.wsmode" url="modelling-oresWsmode.xml"/>
<file name="modelling-pnum.wsmode" url="modelling-pnumWsmode.xml"/>
<file name="modelling-pcal.wsmode" url="modelling-pcalWsmode.xml"/>
<file name="post-editor.wsmode" url="post-editorWsmode.xml"/>
Copied: trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/modelling-oresWsmode.xml (from rev 7465, trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/modelling-optgWsmode.xml)
===================================================================
--- trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/modelling-oresWsmode.xml (rev 0)
+++ trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/modelling-oresWsmode.xml 2012-07-13 08:28:05 UTC (rev 7492)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mode version="2.4">
+ <name unique="modelling-ores"/>
+ <kind type="view"/>
+ <state type="separated"/>
+ <bounds x="250" y="50" width="536" height="436" />
+ <frame state="0"/>
+ <empty-behavior permanent="false"/>
+</mode>
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/CondInitNodeFactory.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/CondInitNodeFactory.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/CondInitNodeFactory.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -41,7 +41,7 @@
CrueConfigMetier ccm = modellingScenarioService.getSelectedProjet().getCoeurConfig().getCrueConfigMetier();
List<Node> nodes = new ArrayList<Node>();
if (methodeInterpol.isNoeudActiveRequireDPTI()) {
- nodes.add(buildNoeud(sousModele, ccm));
+ nodes.add(buildNoeud(methodeInterpol,sousModele, ccm));
}
if (methodeInterpol.isBrancheActiveRequireDPTI()) {
nodes.add(buildBranche(sousModele, ccm));
@@ -55,9 +55,8 @@
return nodes;
}
- private Node buildNoeud(EMHSousModele sousModele, CrueConfigMetier ccm) {
+ private Node buildNoeud(EnumMethodeInterpol methodeInterpol,EMHSousModele sousModele, CrueConfigMetier ccm) {
List<Node> nodes = createNodes(sousModele.getNoeuds(), ccm);
- EnumMethodeInterpol methodeInterpol = sousModele.getParent().getOrdPrtCIniModeleBase().getMethodeInterpol();
if (EnumMethodeInterpol.BAIGNOIRE.equals(methodeInterpol) && !nodes.isEmpty()) {
CondInitNode first = (CondInitNode) nodes.get(0);
final PropertySupportReflection main = (PropertySupportReflection) first.find(CondInitNode.PROP_VALUE);
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/ModellingListCiniTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/ModellingListCiniTopComponent.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/ModellingListCiniTopComponent.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -5,6 +5,7 @@
package org.fudaa.fudaa.crue.modelling.calcul;
import java.awt.BorderLayout;
+import java.awt.EventQueue;
import java.util.ArrayList;
import org.fudaa.dodico.crue.edition.bean.ListCommonProperties;
import java.util.List;
@@ -19,6 +20,8 @@
import org.fudaa.fudaa.crue.modelling.list.AbstractListContentNode;
import org.fudaa.fudaa.crue.modelling.list.ListNoeudContentNode;
import org.fudaa.fudaa.crue.modelling.listener.ExplorerManagerListenerHelper;
+import org.fudaa.fudaa.crue.modelling.services.EnumModification;
+import org.fudaa.fudaa.crue.modelling.services.ScenarioModificationEvent;
import org.openide.explorer.ExplorerManager;
import org.openide.explorer.view.OutlineView;
import org.openide.nodes.AbstractNode;
@@ -87,7 +90,14 @@
AbstractNode root = new AbstractNode(NodeChildrenHelper.createChildren(createNodes), Lookups.singleton(getModele()));
getExplorerManager().setRootContext(root);
helper.addListener();
- NodeHelper.expandAll(getExplorerManager(), outlineView);
+ EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ NodeHelper.expandAll(getExplorerManager(), outlineView);
+ }
+ });
+
return outlineView;
}
@@ -143,6 +153,7 @@
LogsDisplayer.displayError(res, getName());
}
if (!res.containsErrorOrSevereError()) {
+ modellingScenarioModificationService.setScenarioModified(new ScenarioModificationEvent(EnumModification.DPTI));
setModified(false);
}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/EMHModificationProcessor.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/EMHModificationProcessor.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/EMHModificationProcessor.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -20,6 +20,7 @@
if (emh.getUserActive() == newValue) {
return null;
}
+ emh.setUserActive(newValue);
EditionChangeActivity change = new EditionChangeActivity();
return change.propagateActivityChanged(modele, emh, ccm);
}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/global/GlobalContainerNode.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/global/GlobalContainerNode.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/global/GlobalContainerNode.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -139,11 +139,7 @@
null,
SystemAction.get(ModellingListSectionsNodeAction.Reopen.class),
SystemAction.get(ModellingListSectionsNodeAction.NewFrame.class),
- SystemAction.get(ModellingListSectionAddNodeAction.class),
- null,
- SystemAction.get(ModellingListCondInitNodeAction.Reopen.class),
- SystemAction.get(ModellingListCondInitNodeAction.NewFrame.class)
- };
+ SystemAction.get(ModellingListSectionAddNodeAction.class),};
}
}
@@ -166,7 +162,10 @@
SystemAction.get(ModellingModeleOPTINodeAction.NewFrame.class),
null,
SystemAction.get(ModellingModelePNUMNodeAction.Reopen.class),
- SystemAction.get(ModellingModelePNUMNodeAction.NewFrame.class)
+ SystemAction.get(ModellingModelePNUMNodeAction.NewFrame.class),
+ null,
+ SystemAction.get(ModellingListCondInitNodeAction.Reopen.class),
+ SystemAction.get(ModellingListCondInitNodeAction.NewFrame.class)
};
}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/list/AbstractModellingListTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/list/AbstractModellingListTopComponent.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/list/AbstractModellingListTopComponent.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -103,6 +103,7 @@
outlineView.getOutline().setRootVisible(false);
outlineView.getOutline().setToolTipText(null);
outlineView.setDefaultActionAllowed(true);
+ outlineView.setTreeSortable(false);
jContainerName = new JTextField();
jContainerName.setEditable(false);
jContainerName.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(3, 2, 5, 2),
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/services/EnumModification.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/services/EnumModification.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/services/EnumModification.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -10,5 +10,5 @@
*/
public enum EnumModification {
- EMH_ORDER, COMMENTAIRE, ACTIVITY, EMH_RELATION, EMH_NAME, EMH_CREATION, EMH_COMMENTAIRE, OPTG, OPTR, OPTI, ORES, PNUM, PCAL
+ EMH_ORDER, COMMENTAIRE, ACTIVITY, EMH_RELATION, EMH_NAME, EMH_CREATION, EMH_COMMENTAIRE, OPTG, OPTR, OPTI, ORES, PNUM, PCAL,DPTI
}
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/OpenEMHAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/OpenEMHAction.java 2012-07-13 06:51:55 UTC (rev 7491)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/OpenEMHAction.java 2012-07-13 08:28:05 UTC (rev 7492)
@@ -11,7 +11,6 @@
import org.fudaa.ebli.commun.EbliActionSimple;
import org.fudaa.fudaa.crue.common.helper.DialogHelper;
import org.fudaa.fudaa.crue.planimetry.controller.PlanimetryController;
-import org.openide.DialogDisplayer;
import org.openide.util.NbBundle;
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-07-17 14:37:38
|
Revision: 7502
http://fudaa.svn.sourceforge.net/fudaa/?rev=7502&view=rev
Author: deniger
Date: 2012-07-17 14:37:26 +0000 (Tue, 17 Jul 2012)
Log Message:
-----------
Support edition branche et changement de type
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBranchePdc.java
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/view/DefaultOutlineViewEditor.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ElemSeuilAduNode.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheBarrageFilEauPanel.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheBarrageGeneriquePanel.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheSeuilTransversalPanel.java
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBranchePdc.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBranchePdc.java 2012-07-16 21:57:21 UTC (rev 7501)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBranchePdc.java 2012-07-17 14:37:26 UTC (rev 7502)
@@ -1,28 +1,38 @@
-/***********************************************************************
- * Module: DonCalcSansPrtBranchePdc.java
- * Author: deniger
- * Purpose: Defines the Class DonCalcSansPrtBranchePdc
- ***********************************************************************/
-
+/**
+ * *********************************************************************
+ * Module: DonCalcSansPrtBranchePdc.java Author: deniger Purpose: Defines the Class DonCalcSansPrtBranchePdc
+ **********************************************************************
+ */
package org.fudaa.dodico.crue.metier.emh;
+import java.util.Collection;
+
/**
* Pour les branches type 1 Crue9
- *
+ *
* @pdOid d52cbe5d-73d9-423c-990f-e6ab61d710cc
*/
public class DonCalcSansPrtBranchePdc extends DonCalcSansPrt {
- /** @pdOid d2caaf75-5d42-421e-ad3a-ba495b6d3daa */
+
+ /**
+ * @pdOid d2caaf75-5d42-421e-ad3a-ba495b6d3daa
+ */
private LoiFF pdc;
- /** @pdOid 2043fea9-8823-4e85-a3d7-6570a09f74cb */
+ /**
+ * @pdOid 2043fea9-8823-4e85-a3d7-6570a09f74cb
+ */
public LoiFF getPdc() {
return pdc;
}
+ @Override
+ public void fillWithLoi(Collection<Loi> target) {
+ target.add(pdc);
+ }
+
/**
- * @param newPdc
- * @pdOid c5c4c95f-d374-44e7-8e65-cbaa5ebcfa1c
+ * @param newPdc @pdOid c5c4c95f-d374-44e7-8e65-cbaa5ebcfa1c
*/
public void setPdc(final LoiFF newPdc) {
if (this.pdc != null) {
@@ -32,5 +42,4 @@
pdc = newPdc;
this.pdc.register(this);
}
-
}
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/view/DefaultOutlineViewEditor.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/view/DefaultOutlineViewEditor.java 2012-07-16 21:57:21 UTC (rev 7501)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/view/DefaultOutlineViewEditor.java 2012-07-17 14:37:26 UTC (rev 7502)
@@ -9,10 +9,13 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import javax.swing.*;
import org.openide.explorer.ExplorerManager;
import org.openide.explorer.ExplorerUtils;
import org.openide.explorer.view.OutlineView;
+import org.openide.nodes.*;
import org.openide.util.Lookup;
import org.openide.util.NbBundle;
@@ -21,30 +24,122 @@
* @author Frédéric Deniger
*/
public abstract class DefaultOutlineViewEditor extends JPanel implements ExplorerManager.Provider, Lookup.Provider {
-
+
protected OutlineView view;
private ExplorerManager em = new ExplorerManager();
JButton btAdd;
JButton btPaste;
private Lookup lookup;
-
+ ExplorerManagerChangeListener explorerManagerChangeListener = new ExplorerManagerChangeListener();
+ CustomNodeListener customNodeListener = new CustomNodeListener();
+ CustomPropertyChangeListener customPropertyChangeListener = new CustomPropertyChangeListener();
+
+ public DefaultOutlineViewEditor() {
+ super(new BorderLayout(5, 5));
+ initView();
+ em.addPropertyChangeListener(explorerManagerChangeListener);
+ }
+
+ private class ExplorerManagerChangeListener implements PropertyChangeListener {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (ExplorerManager.PROP_ROOT_CONTEXT.equals(evt.getPropertyName())) {
+ explorerChanged((Node) evt.getOldValue());
+ }
+ }
+ }
+
+ private class CustomPropertyChangeListener implements PropertyChangeListener {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ changeInNode();
+ }
+ }
+
+ private class CustomNodeListener implements NodeListener {
+
+ @Override
+ public void childrenAdded(NodeMemberEvent nme) {
+ Node[] delta = nme.getDelta();
+ for (Node node : delta) {
+ removeListener(node);
+ installListener(node);
+ }
+ changeInNode();
+ }
+
+ @Override
+ public void childrenRemoved(NodeMemberEvent nme) {
+ Node[] delta = nme.getDelta();
+ for (Node node : delta) {
+ removeListener(node);
+ }
+ changeInNode();
+ }
+
+ @Override
+ public void childrenReordered(NodeReorderEvent nre) {
+ changeInNode();
+ }
+
+ @Override
+ public void nodeDestroyed(NodeEvent ne) {
+ changeInNode();
+ removeListener(ne.getNode());
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ changeInNode();
+ }
+ }
+
+ protected void explorerChanged(Node old) {
+ if (old != null) {
+ removeListener(old);
+ }
+ changeInNode();
+ em.getRootContext().addNodeListener(customNodeListener);
+ installListener(em.getRootContext());
+ }
+
+ protected void installListener(Node parentNode) {
+ parentNode.removePropertyChangeListener(customPropertyChangeListener);
+ parentNode.removeNodeListener(customNodeListener);
+ parentNode.addPropertyChangeListener(customPropertyChangeListener);
+ parentNode.addNodeListener(customNodeListener);
+ Node[] nodes = parentNode.getChildren().getNodes();
+ for (Node node : nodes) {
+ installListener(node);
+ }
+ }
+
+ protected void removeListener(Node parentNode) {
+ parentNode.removePropertyChangeListener(customPropertyChangeListener);
+ parentNode.removeNodeListener(customNodeListener);
+ Node[] nodes = parentNode.getChildren().getNodes();
+ for (Node node : nodes) {
+ removeListener(node);
+ }
+ }
+
+ protected void changeInNode() {
+ }
+
@Override
public Lookup getLookup() {
return lookup;
}
-
+
@Override
public ExplorerManager getExplorerManager() {
return em;
}
-
- public DefaultOutlineViewEditor() {
- super(new BorderLayout(5, 5));
- initView();
- }
-
+
protected abstract void addElement();
-
+
protected void initActions() {
ActionMap map = this.getActionMap();
final Action actionDelete = ExplorerUtils.actionDelete(em, false);
@@ -55,11 +150,11 @@
addRemove.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 3));
btAdd = new JButton(NbBundle.getMessage(DefaultOutlineViewEditor.class, "Add.Name"));
btAdd.addActionListener(new ActionListener() {
-
+
@Override
public void actionPerformed(ActionEvent e) {
addElement();
-
+
}
});
addRemove.add(btAdd);
@@ -76,20 +171,20 @@
ExplorerUtils.activateActions(em, true);
view.setNodePopupFactory(new CustomNodePopupFactory());
}
-
+
protected JButton createPastComponent() {
return null;
}
-
+
protected abstract void createOutlineView();
-
+
private void initView() {
createOutlineView();
add(view);
initActions();
}
protected boolean editable;
-
+
public void setEditable(boolean editable) {
this.editable = editable;
btAdd.setEnabled(editable);
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ElemSeuilAduNode.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ElemSeuilAduNode.java 2012-07-16 21:57:21 UTC (rev 7501)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ElemSeuilAduNode.java 2012-07-17 14:37:26 UTC (rev 7502)
@@ -7,6 +7,7 @@
import java.util.MissingResourceException;
import org.fudaa.dodico.crue.config.CrueConfigMetier;
import org.fudaa.dodico.crue.metier.emh.ElemSeuil;
+import org.fudaa.fudaa.crue.common.property.PropertyCrueUtils;
import org.fudaa.fudaa.crue.common.property.PropertyStringReadOnly;
import org.fudaa.fudaa.crue.modelling.perspective.PerspectiveServiceModelling;
import org.openide.nodes.Sheet;
@@ -30,6 +31,7 @@
Sheet res = super.createSheet();
Set set = res.get(Sheet.PROPERTIES);
PropertyStringReadOnly readOnly = new PropertyStringReadOnly("1", PROP_ADU, getAduDisplayName(), null);
+ PropertyCrueUtils.configureNoCustomEditor(readOnly);
set.put(readOnly);
return res;
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheBarrageFilEauPanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheBarrageFilEauPanel.java 2012-07-16 21:57:21 UTC (rev 7501)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheBarrageFilEauPanel.java 2012-07-17 14:37:26 UTC (rev 7502)
@@ -30,6 +30,7 @@
import org.fudaa.fudaa.crue.common.view.NodeEditionHelper;
import org.fudaa.fudaa.crue.common.view.PropertyEditorPanel;
import org.fudaa.fudaa.crue.modelling.perspective.PerspectiveServiceModelling;
+import org.openide.explorer.ExplorerManager;
import org.openide.explorer.view.OutlineView;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
@@ -42,7 +43,7 @@
* @author fred
*/
public class ModellingEMHBrancheBarrageFilEauPanel extends JPanel implements ModellingEMHBrancheSpecificEditor, Observer {
-
+
ModellingScenarioService modellingScenarioService = Lookup.getDefault().lookup(
ModellingScenarioService.class);
PerspectiveServiceModelling perspectiveServiceModelling = Lookup.getDefault().lookup(PerspectiveServiceModelling.class);
@@ -50,7 +51,7 @@
List<PropertyEditorPanel> properties;
JComboBox cbSectionPilote;
SeuilView seuilView;
-
+
ModellingEMHBrancheBarrageFilEauPanel(CatEMHBranche branche, ModellingEMHBrancheTopComponent parent) {
super(new BorderLayout(5, 15));
this.parent = parent;
@@ -63,16 +64,21 @@
createTopPanel(branche, dcsp);
add(seuilView);
}
-
+
+ @Override
+ public ExplorerManager getExplorerManager() {
+ return null;
+ }
+
private void createTopPanel(CatEMHBranche branche, DonCalcSansPrtBrancheBarrageFilEau dcsp) throws MissingResourceException {
JPanel top = new JPanel(new BuGridLayout(4, 10, 10));
add(top, BorderLayout.NORTH);
-
+
properties = PropertyEditorPanel.create(dcsp, getCcm(), DonCalcSansPrtBrancheNiveauxAssocies.PROP_QLIMINF,
DonCalcSansPrtBrancheNiveauxAssocies.PROP_QLIMSUP);
for (PropertyEditorPanel propertyEditorPanel : properties) {
propertyEditorPanel.addObserver(this);
-
+
}
PropertyEditorPanel first = properties.get(0);
top.add(new JLabel(first.getLabelName()));
@@ -81,36 +87,36 @@
cbSectionPilote = ModellingEMHBrancheBarrageGeneriquePanel.createSectionPilote(branche);
cbSectionPilote.addActionListener(parent.modifiedActionListener);
top.add(cbSectionPilote);
-
+
PropertyEditorPanel second = properties.get(1);
top.add(new JLabel(second.getLabelName()));
top.add(second.getComponent());
top.add(new JLabel(NbBundle.getMessage(ModellingEMHBrancheBarrageFilEauPanel.class, "LoiQpilZam.Label.DisplayName")));
JButton bt = new JButton(NbBundle.getMessage(ModellingEMHBrancheBarrageFilEauPanel.class, "LoiQpilZam.Button.DisplayName"));
bt.addActionListener(new ActionListener() {
-
+
@Override
public void actionPerformed(ActionEvent e) {
openLoiQpilZam();
}
});
-
+
top.add(bt);
}
-
+
public void openLoiQpilZam() {
DialogHelper.showInfo(" LoiQpilZam", "doit ouvrir l'éditeur de lois");
}
-
+
@Override
public void update(Observable o, Object arg) {
parent.setModified(true);
}
-
+
private CrueConfigMetier getCcm() {
return modellingScenarioService.getSelectedProjet().getPropDefinition();
}
-
+
@Override
public void setEditable(boolean editable) {
for (PropertyEditorPanel object : properties) {
@@ -119,7 +125,7 @@
cbSectionPilote.setEnabled(editable);
seuilView.setEditable(editable);
}
-
+
@Override
public void fillWithData(BrancheEditionContent content) {
DonCalcSansPrtBrancheBarrageFilEau dcsp = new DonCalcSansPrtBrancheBarrageFilEau(getCcm());
@@ -128,14 +134,14 @@
content.setSectionPilote((CatEMHSection) cbSectionPilote.getSelectedItem());
content.setDcsp(dcsp);
}
-
+
@Override
public JComponent getComponent() {
return this;
}
-
+
private class SeuilView extends DefaultOutlineViewEditor {
-
+
protected void initWith(DonCalcSansPrtBrancheBarrageFilEau dcsp) {
List<ElemSeuilAduNode> nodes = new ArrayList<ElemSeuilAduNode>();
if (dcsp != null) {
@@ -145,9 +151,16 @@
nodes.add(new ElemSeuilAduNode(elemSeuilAvecPdcNode, ccm, perspectiveServiceModelling));
}
}
+
getExplorerManager().setRootContext(NodeHelper.createNode(nodes, "ElemSeuilAvecPdc", false));
+ DefaultNodePasteType.updateIndexedDisplayName(getExplorerManager().getRootContext());
}
-
+
+ @Override
+ protected void changeInNode() {
+ parent.setModified(true);
+ }
+
List<ElemSeuil> getElemSeuil() {
List<ElemSeuil> res = new ArrayList<ElemSeuil>();
Node[] nodes = getExplorerManager().getRootContext().getChildren().getNodes();
@@ -157,12 +170,12 @@
}
return res;
}
-
+
@Override
protected JButton createPastComponent() {
JButton button = new JButton(NbBundle.getMessage(ModellingEMHBrancheSeuilTransversalPanel.class, "Paste.DisplayName"));
button.addActionListener(new ActionListener() {
-
+
@Override
public void actionPerformed(ActionEvent e) {
paste();
@@ -170,14 +183,14 @@
});
return button;
}
-
+
protected void paste() {
List<ElemSeuilAduNode> pastData = getPastData(getCcm(), perspectiveServiceModelling);
if (!pastData.isEmpty()) {
NodeEditionHelper.addNodesFromClipboard(getExplorerManager(), pastData);
}
}
-
+
@Override
protected void addElement() {
ElemSeuil elem = new ElemSeuil(getCcm());
@@ -186,11 +199,11 @@
children.add(new Node[]{elemPdtNode});
DefaultNodePasteType.updateIndexedDisplayName(getExplorerManager().getRootContext());
}
-
+
private CrueConfigMetier getCcm() {
return modellingScenarioService.getSelectedProjet().getPropDefinition();
}
-
+
@Override
protected void createOutlineView() {
view = new OutlineView(StringUtils.EMPTY);
@@ -208,7 +221,7 @@
view.setDropTarget(true);
}
}
-
+
public static List<ElemSeuilAduNode> getPastData(CrueConfigMetier ccm, PerspectiveServiceModelling perspective) {
try {
String toCopy = (String) Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor);
@@ -232,10 +245,10 @@
newContent.setCoefD(Double.parseDouble(strings[2]));
} catch (NumberFormatException numberFormatException) {
}
-
+
}
}
-
+
}
}
return contents;
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheBarrageGeneriquePanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheBarrageGeneriquePanel.java 2012-07-16 21:57:21 UTC (rev 7501)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheBarrageGeneriquePanel.java 2012-07-17 14:37:26 UTC (rev 7502)
@@ -24,6 +24,7 @@
import org.fudaa.fudaa.crue.common.services.ModellingScenarioService;
import org.fudaa.fudaa.crue.common.view.PropertyEditorPanel;
import org.fudaa.fudaa.crue.modelling.perspective.PerspectiveServiceModelling;
+import org.openide.explorer.ExplorerManager;
import org.openide.util.Lookup;
import org.openide.util.NbBundle;
@@ -81,6 +82,11 @@
add(bt);
}
+ @Override
+ public ExplorerManager getExplorerManager() {
+ return null;
+ }
+
public static JComboBox createSectionPilote(CatEMHBranche branche) {
List<CatEMHSection> sections = branche.getParent().getSections();
CatEMHSection sectionPilote = EMHHelper.getSectionPilote(branche);
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheSeuilTransversalPanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheSeuilTransversalPanel.java 2012-07-16 21:57:21 UTC (rev 7501)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheSeuilTransversalPanel.java 2012-07-17 14:37:26 UTC (rev 7502)
@@ -16,8 +16,6 @@
import java.util.List;
import javax.swing.*;
import org.apache.commons.lang.StringUtils;
-import org.fudaa.ctulu.CtuluLog;
-import org.fudaa.dodico.crue.common.BusinessMessages;
import org.fudaa.dodico.crue.config.CrueConfigMetier;
import org.fudaa.dodico.crue.edition.bean.BrancheEditionContent;
import org.fudaa.dodico.crue.metier.emh.*;
@@ -29,6 +27,7 @@
import org.fudaa.fudaa.crue.common.view.DefaultOutlineViewEditor;
import org.fudaa.fudaa.crue.common.view.NodeEditionHelper;
import org.fudaa.fudaa.crue.modelling.perspective.PerspectiveServiceModelling;
+import org.openide.explorer.ExplorerManager;
import org.openide.explorer.view.OutlineView;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
@@ -67,13 +66,18 @@
}
@Override
+ public ExplorerManager getExplorerManager() {
+ return null;
+ }
+
+ @Override
public void setEditable(boolean editable) {
seuilView.setEditable(editable);
}
@Override
public void fillWithData(BrancheEditionContent content) {
- DonCalcSansPrtBrancheSeuilLateral dcsp = new DonCalcSansPrtBrancheSeuilLateral();
+ DonCalcSansPrtBrancheSeuilTransversal dcsp = new DonCalcSansPrtBrancheSeuilTransversal();
dcsp.setFormulePdc((EnumFormulePdc) cbFormule.getSelectedItem());
dcsp.setElemSeuilAvecPdc(seuilView.getElemSeuilAvecPdc());
content.setDcsp(dcsp);
@@ -97,9 +101,15 @@
}
}
getExplorerManager().setRootContext(NodeHelper.createNode(nodes, "ElemSeuilAvecPdc", false));
+ DefaultNodePasteType.updateIndexedDisplayName(getExplorerManager().getRootContext());
}
@Override
+ protected void changeInNode() {
+ parent.setModified(true);
+ }
+
+ @Override
protected JButton createPastComponent() {
JButton button = new JButton(NbBundle.getMessage(ModellingEMHBrancheSeuilTransversalPanel.class, "Paste.DisplayName"));
button.addActionListener(new ActionListener() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-07-17 14:51:09
|
Revision: 7504
http://fudaa.svn.sourceforge.net/fudaa/?rev=7504&view=rev
Author: deniger
Date: 2012-07-17 14:50:58 +0000 (Tue, 17 Jul 2012)
Log Message:
-----------
Support edition branche et changement de type
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/UniqueNomFinder.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/validation/ValidationHelper.java
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/view/PropertyEditorPanel.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/list/PropertySupportSection.java
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/UniqueNomFinder.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/UniqueNomFinder.java 2012-07-17 14:50:26 UTC (rev 7503)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/edition/UniqueNomFinder.java 2012-07-17 14:50:58 UTC (rev 7504)
@@ -22,8 +22,8 @@
* @author deniger ( genesis)
*/
public class UniqueNomFinder {
+
private static final String SEPARATOR = "_";
-
private int minDigits = 4;
/**
@@ -226,8 +226,11 @@
public int findMaxIdentifier(Collection<String> noms, String prefix) {
int res = 0;
for (String nom : noms) {
- if (nom.startsWith(prefix)) {
+ if (!nom.equals(prefix) && nom.startsWith(prefix)) {
String suffix = nom.substring(prefix.length());
+ if (suffix.length() > 0 && suffix.charAt(0) == '_') {
+ suffix = suffix.substring(1);
+ }
int id = 0;
try {
id = Integer.parseInt(suffix);
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/validation/ValidationHelper.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/validation/ValidationHelper.java 2012-07-17 14:50:26 UTC (rev 7503)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/validation/ValidationHelper.java 2012-07-17 14:50:58 UTC (rev 7504)
@@ -10,6 +10,7 @@
import java.util.Set;
import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.fudaa.ctulu.CtuluLog;
import org.fudaa.ctulu.CtuluLogGroup;
@@ -112,6 +113,10 @@
validateObject(BusinessMessages.getString("valid.ElemSeuilAvecPdc", Integer.toString(++idx)), analyze, elemSeuil, propsContainer);
}
}
+ if (CollectionUtils.isEmpty(elemSeuils)) {
+ analyze.addSevereError("valid.ElemSeuilAvecPdcEmpy.Error");
+
+ }
} else if (o.getClass().equals(DonCalcSansPrtBrancheSeuilTransversal.class)) {
DonCalcSansPrtBrancheSeuilTransversal dcsp = (DonCalcSansPrtBrancheSeuilTransversal) o;
List<ElemSeuilAvecPdc> elemSeuils = dcsp.getElemSeuilAvecPdc();
@@ -121,6 +126,10 @@
validateObject(BusinessMessages.getString("valid.ElemSeuilAvecPdc", Integer.toString(++idx)), analyze, elemSeuil, propsContainer);
}
}
+ if (CollectionUtils.isEmpty(elemSeuils)) {
+ analyze.addSevereError("valid.ElemSeuilAvecPdcEmpy.Error");
+
+ }
} else if (o.getClass().equals(DonCalcSansPrtBrancheBarrageFilEau.class)) {
DonCalcSansPrtBrancheBarrageFilEau dcsp = (DonCalcSansPrtBrancheBarrageFilEau) o;
Collection<ElemSeuil> elemSeuils = dcsp.getElemSeuil();
@@ -130,6 +139,10 @@
validateObject(BusinessMessages.getString("valid.ElemSeuil", Integer.toString(++idx)), analyze, elemSeuil, propsContainer);
}
}
+ if (CollectionUtils.isEmpty(elemSeuils)) {
+ analyze.addSevereError("valid.ElemSeuilEmpy.Error");
+
+ }
}
}
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/view/PropertyEditorPanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/view/PropertyEditorPanel.java 2012-07-17 14:50:26 UTC (rev 7503)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/view/PropertyEditorPanel.java 2012-07-17 14:50:58 UTC (rev 7504)
@@ -4,19 +4,14 @@
*/
package org.fudaa.fudaa.crue.common.view;
-import com.memoire.bu.BuTextField;
import java.awt.BorderLayout;
-import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
import java.util.*;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.commons.beanutils.PropertyUtilsBean;
import org.apache.commons.lang.StringUtils;
import org.fudaa.ctulu.CtuluLog;
import org.fudaa.ctulu.CtuluLogLevel;
@@ -98,7 +93,7 @@
@Override
public void setEditable(boolean b) {
- cb.setEnabled(false);
+ cb.setEnabled(b);
}
@Override
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/list/PropertySupportSection.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/list/PropertySupportSection.java 2012-07-17 14:50:26 UTC (rev 7503)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/list/PropertySupportSection.java 2012-07-17 14:50:58 UTC (rev 7504)
@@ -114,10 +114,13 @@
public void setAsText(String string) {
setValue(string);
}
- String[] coeurs;
+ String[] sectionNames;
@Override
public String[] getTags() {
+ if (!canWrite()) {
+ return null;
+ }
List<String> sectionNames = new ArrayList<String>();
Node[] nodes = node.getParentNode().getChildren().getNodes();
for (Node casierNode : nodes) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-07-17 22:21:24
|
Revision: 7505
http://fudaa.svn.sourceforge.net/fudaa/?rev=7505&view=rev
Author: deniger
Date: 2012-07-17 22:21:16 +0000 (Tue, 17 Jul 2012)
Log Message:
-----------
Support edition branche et changement de type
Modified Paths:
--------------
trunk/soft/fudaa-crue/pom.xml
trunk/soft/fudaa-crue/ui-application/pom.xml
trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml
trunk/soft/fudaa-crue/ui-modelling/pom.xml
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheTopComponent.java
trunk/soft/fudaa-crue/ui-planimetry/nb-configuration.xml
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/PlanimetryVisuPanel.java
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dcspEditorWsmode.xml
trunk/soft/fudaa-crue/ui-loi/
trunk/soft/fudaa-crue/ui-loi/pom.xml
trunk/soft/fudaa-crue/ui-loi/src/
trunk/soft/fudaa-crue/ui-loi/src/main/
trunk/soft/fudaa-crue/ui-loi/src/main/java/
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/DcspEditorLoiTopComponent.form
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/DcspEditorLoiTopComponent.java
trunk/soft/fudaa-crue/ui-loi/src/main/nbm/
trunk/soft/fudaa-crue/ui-loi/src/main/nbm/manifest.mf
trunk/soft/fudaa-crue/ui-loi/src/main/nbm/module.xml
trunk/soft/fudaa-crue/ui-loi/src/main/resources/
trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/
trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/
trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/
trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/
trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/
trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties
trunk/soft/fudaa-crue/ui-loi/src/test/
trunk/soft/fudaa-crue/ui-loi/src/test/java/
trunk/soft/fudaa-crue/ui-loi/src/test/java/org/
trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/
trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/
trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/
trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/
trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestDcspEditorLoiTopComponent.java
Modified: trunk/soft/fudaa-crue/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/pom.xml 2012-07-17 14:50:58 UTC (rev 7504)
+++ trunk/soft/fudaa-crue/pom.xml 2012-07-17 22:21:16 UTC (rev 7505)
@@ -43,6 +43,7 @@
<module>ui-commandline</module>
<module>ui-wrapper</module>
<module>ui-planimetry</module>
+ <module>ui-loi</module>
</modules>
<dependencyManagement>
<dependencies>
@@ -170,6 +171,12 @@
</dependency>
<dependency>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
+ <artifactId>ui-loi</artifactId>
+ <version>${project.version}</version>
+ <type>nbm</type>
+ </dependency>
+ <dependency>
+ <groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>ui-post</artifactId>
<version>${project.version}</version>
<type>nbm</type>
Modified: trunk/soft/fudaa-crue/ui-application/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-application/pom.xml 2012-07-17 14:50:58 UTC (rev 7504)
+++ trunk/soft/fudaa-crue/ui-application/pom.xml 2012-07-17 22:21:16 UTC (rev 7505)
@@ -38,6 +38,11 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>ui-loi</artifactId>
+ <type>nbm</type>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>ui-common</artifactId>
<type>nbm</type>
</dependency>
Modified: trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml 2012-07-17 14:50:58 UTC (rev 7504)
+++ trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml 2012-07-17 22:21:16 UTC (rev 7505)
@@ -87,6 +87,8 @@
<file name="study-topLeft.wsmode" url="study-topLeftWsmode.xml"/>
<file name="study-topRight.wsmode" url="study-topRightWsmode.xml"/>
+ <file name="loi-dcspEditor.wsmode" url="loi-dcspEditorWsmode.xml"/>
+
<file name="modelling-editor.wsmode" url="modelling-editorWsmode.xml"/>
<file name="modelling-bottomLeft.wsmode" url="modelling-bottomLeftWsmode.xml"/>
<file name="modelling-bottomRight.wsmode" url="modelling-bottomRightWsmode.xml"/>
Copied: trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dcspEditorWsmode.xml (from rev 7500, trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/modelling-emhBrancheWsmode.xml)
===================================================================
--- trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dcspEditorWsmode.xml (rev 0)
+++ trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dcspEditorWsmode.xml 2012-07-17 22:21:16 UTC (rev 7505)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mode version="2.4">
+ <name unique="loi-dcspEditor"/>
+ <kind type="view"/>
+ <state type="separated"/>
+ <bounds x="250" y="50" width="400" height="400" />
+ <frame state="0"/>
+ <empty-behavior permanent="false"/>
+</mode>
Property changes on: trunk/soft/fudaa-crue/ui-loi
___________________________________________________________________
Added: svn:ignore
+ target
Added: trunk/soft/fudaa-crue/ui-loi/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/pom.xml (rev 0)
+++ trunk/soft/fudaa-crue/ui-loi/pom.xml 2012-07-17 22:21:16 UTC (rev 7505)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>fudaa-crue</artifactId>
+ <groupId>org.fudaa.soft.fudaa-crue</groupId>
+ <version>0.57-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>ui-loi</artifactId>
+ <packaging>nbm</packaging>
+
+ <name>Crue UI Loi</name>
+ <description>Permet l'édition des lois et profils
+ </description>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.netbeans.api</groupId>
+ <artifactId>org-netbeans-api-annotations-common</artifactId>
+ <version>${netbeans.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.netbeans.api</groupId>
+ <artifactId>org-openide-windows</artifactId>
+ <version>RELEASE712</version>
+ </dependency>
+ <dependency>
+ <groupId>org.netbeans.api</groupId>
+ <artifactId>org-openide-util</artifactId>
+ <version>RELEASE712</version>
+ </dependency>
+ <dependency>
+ <groupId>org.netbeans.api</groupId>
+ <artifactId>org-openide-util-lookup</artifactId>
+ <version>RELEASE712</version>
+ </dependency>
+ <dependency>
+ <groupId>org.netbeans.api</groupId>
+ <artifactId>org-openide-awt</artifactId>
+ <version>RELEASE712</version>
+ </dependency>
+ <dependency>
+ <groupId>org.netbeans.api</groupId>
+ <artifactId>org-netbeans-modules-settings</artifactId>
+ <version>RELEASE712</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.10</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>nbm-maven-plugin</artifactId>
+ <configuration>
+ <publicPackages>
+ <publicPackage>org.fudaa.fudaa.crue.loi</publicPackage>
+ <publicPackage>org.fudaa.fudaa.crue.loi.*</publicPackage>
+ </publicPackages>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <!-- to have the jar plugin pickup the nbm generated manifest -->
+ <useDefaultManifestFile>true</useDefaultManifestFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <url>http://repo1.maven.org/maven2/</url>
+ <id>junit_4</id>
+ <layout>default</layout>
+ <name>Repository for library Library[junit_4]</name>
+ </repository>
+ </repositories>
+</project>
Added: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/DcspEditorLoiTopComponent.form
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/DcspEditorLoiTopComponent.form (rev 0)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/DcspEditorLoiTopComponent.form 2012-07-17 22:21:16 UTC (rev 7505)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+</Form>
Added: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/DcspEditorLoiTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/DcspEditorLoiTopComponent.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/DcspEditorLoiTopComponent.java 2012-07-17 22:21:16 UTC (rev 7505)
@@ -0,0 +1,63 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.fudaa.fudaa.crue.loi;
+
+import org.netbeans.api.settings.ConvertAsProperties;
+import org.openide.util.NbBundle;
+import org.openide.windows.TopComponent;
+
+/**
+ * Editeur de lois.
+ */
+@ConvertAsProperties(dtd = "-//org.fudaa.fudaa.crue.loi//DcspEditorLoi//EN",
+autostore = false)
+@TopComponent.Description(preferredID = DcspEditorLoiTopComponent.TOPCOMPONENT_ID,
+persistenceType = TopComponent.PERSISTENCE_ALWAYS)
+@TopComponent.Registration(mode = DcspEditorLoiTopComponent.MODE, openAtStartup = false)
+public final class DcspEditorLoiTopComponent extends TopComponent {
+
+ public static final String MODE = "loi-dcspEditor"; //NOI18N
+ public static final String TOPCOMPONENT_ID = "DcspEditorLoiTopComponent"; //NOI18N
+
+ public DcspEditorLoiTopComponent() {
+ initComponents();
+ setName(NbBundle.getMessage(DcspEditorLoiTopComponent.class, "CTL_" + TOPCOMPONENT_ID));
+ setToolTipText(NbBundle.getMessage(DcspEditorLoiTopComponent.class, "HINT_" + TOPCOMPONENT_ID));
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The
+ * content of this method is always regenerated by the Form Editor.
+ */
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ setLayout(new java.awt.BorderLayout());
+ }// </editor-fold>//GEN-END:initComponents
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ // End of variables declaration//GEN-END:variables
+ @Override
+ public void componentOpened() {
+ // TODO add custom code on component opening
+ }
+
+ @Override
+ public void componentClosed() {
+ // TODO add custom code on component closing
+ }
+
+ void writeProperties(java.util.Properties p) {
+ // better to version settings since initial version as advocated at
+ // http://wiki.apidesign.org/wiki/PropertyFiles
+// p.setProperty("version", "1.0");
+ // TODO store your settings
+ }
+
+ void readProperties(java.util.Properties p) {
+// String version = p.getProperty("version");
+ // TODO read your settings according to their version
+ }
+}
Added: trunk/soft/fudaa-crue/ui-loi/src/main/nbm/manifest.mf
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/nbm/manifest.mf (rev 0)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/nbm/manifest.mf 2012-07-17 22:21:16 UTC (rev 7505)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+OpenIDE-Module-Localizing-Bundle: org/fudaa/loi/Bundle.properties
+OpenIDE-Module-Requires: org.openide.windows.WindowManager
Added: trunk/soft/fudaa-crue/ui-loi/src/main/nbm/module.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/nbm/module.xml (rev 0)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/nbm/module.xml 2012-07-17 22:21:16 UTC (rev 7505)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nbm>
+ <!--
+ <moduleType>autoload</moduleType>
+ <codeNameBase>org.fudaa.loi/1</codeNameBase>
+ <licenseName>Apache License, Version 2.0</licenseName>
+ <licenseFile>license.txt</licenseFile>
+ -->
+</nbm>
Copied: trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties (from rev 7480, trunk/soft/fudaa-crue/ui-planimetry/src/main/resources/org/fudaa/fudaa/crue/planimetry/Bundle.properties)
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties (rev 0)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties 2012-07-17 22:21:16 UTC (rev 7505)
@@ -0,0 +1,7 @@
+# Localized module labels. Defaults taken from POM (<name>, <description>, <groupId>) if unset.
+#OpenIDE-Module-Name=
+#OpenIDE-Module-Short-Description=
+#OpenIDE-Module-Long-Description=
+#OpenIDE-Module-Display-Category=
+CTL_DcspEditorLoiTopComponent=Editeur loi
+HINT_DcspEditorLoiTopComponent=Editeur loi
\ No newline at end of file
Added: trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestDcspEditorLoiTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestDcspEditorLoiTopComponent.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestDcspEditorLoiTopComponent.java 2012-07-17 22:21:16 UTC (rev 7505)
@@ -0,0 +1,30 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.fudaa.fudaa.crue.loi;
+
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+
+/**
+ *
+ * @author fred
+ */
+public class TestDcspEditorLoiTopComponent {
+
+ public static void display(JComponent jc) {
+ JFrame fr = new JFrame();
+ fr.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+ fr.setContentPane(jc);
+ fr.setSize(500, 600);
+ fr.setVisible(true);
+ }
+
+ public static void main(String[] args) {
+ DcspEditorLoiTopComponent top = new DcspEditorLoiTopComponent();
+// ModellingEMHNoeudComponentTest.configure(top, "B2", scenario);
+// top.setEditable(true);
+ display(top);
+ }
+}
Modified: trunk/soft/fudaa-crue/ui-modelling/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/pom.xml 2012-07-17 14:50:58 UTC (rev 7504)
+++ trunk/soft/fudaa-crue/ui-modelling/pom.xml 2012-07-17 22:21:16 UTC (rev 7505)
@@ -49,6 +49,11 @@
<type>nbm</type>
</dependency>
<dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ui-loi</artifactId>
+ <type>nbm</type>
+ </dependency>
+ <dependency>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>ui-common</artifactId>
<type>nbm</type>
@@ -146,7 +151,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheTopComponent.java 2012-07-17 14:50:58 UTC (rev 7504)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/emh/ModellingEMHBrancheTopComponent.java 2012-07-17 22:21:16 UTC (rev 7505)
@@ -50,7 +50,6 @@
public static final String MODE = "modelling-emhBranche";
public static final String TOPCOMPONENT_ID = "ModellingEMHBrancheTopComponent";
public static final String TOPCOMPONENT_ACTION = "CTL_" + TOPCOMPONENT_ID;
- public static final String TOPCOMPONENT_ACTION_DISPLAYNAME = "#" + TOPCOMPONENT_ACTION;
JCheckBox cbActive;
JComboBox cbAmont;
JComboBox cbAval;
Modified: trunk/soft/fudaa-crue/ui-planimetry/nb-configuration.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/nb-configuration.xml 2012-07-17 14:50:58 UTC (rev 7504)
+++ trunk/soft/fudaa-crue/ui-planimetry/nb-configuration.xml 2012-07-17 22:21:16 UTC (rev 7505)
@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-shared-configuration>
+<?xml version="1.0" encoding="UTF-8"?>
+<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
--->
- <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
+-->
+ <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
--->
- <netbeans.hint.jdkPlatform>JDK_1.6</netbeans.hint.jdkPlatform>
- </properties>
-</project-shared-configuration>
+-->
+ <netbeans.hint.jdkPlatform>JDK_1.6</netbeans.hint.jdkPlatform>
+ </properties>
+</project-shared-configuration>
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/PlanimetryVisuPanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/PlanimetryVisuPanel.java 2012-07-17 14:50:58 UTC (rev 7504)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/PlanimetryVisuPanel.java 2012-07-17 22:21:16 UTC (rev 7505)
@@ -213,20 +213,21 @@
public FSigLayerGroup getGroupGIS() {
return planimetryCalqueContext.getGroupExternController().getGroupExtern();
}
- boolean gisAlreadyCreation;
EditZonePanel editZonePanel;
public EditZonePanel getEditZonePanel() {
return editZonePanel;
}
+ JComponent gisEditionPalette;
public JComponent createGisEditionPalette() {
- assert gisAlreadyCreation == false;
- gisAlreadyCreation = true;
+ if (gisEditionPalette != null) {
+ return gisEditionPalette;
+ }
PlanimetryGISEditionAction action = new PlanimetryGISEditionAction(getArbreCalqueModel().getTreeSelectionModel(),
gisEditor_, getScene());
action.setUsedAsTab(true);
- final JComponent content = action.buildContentPane();
+ gisEditionPalette = action.buildContentPane();
action.updateBeforeShow();
editZonePanel = new EditZonePanel();
PlanimetryGisPaletteEdition palette = action.getPalette();
@@ -236,11 +237,11 @@
getPlanimetryVisuController().addEditAction(addNoeud);
getPlanimetryVisuController().addEditAction(addCasier);
getPlanimetryVisuController().addEditAction(addBranche);
- content.add(new JSeparator());
- content.add(add(addNoeud.buildToolButton(EbliComponentFactory.INSTANCE)));
- content.add(add(addBranche.buildToolButton(EbliComponentFactory.INSTANCE)));
- content.add(add(addCasier.buildToolButton(EbliComponentFactory.INSTANCE)));
- return content;
+ gisEditionPalette.add(new JSeparator());
+ gisEditionPalette.add(add(addNoeud.buildToolButton(EbliComponentFactory.INSTANCE)));
+ gisEditionPalette.add(add(addBranche.buildToolButton(EbliComponentFactory.INSTANCE)));
+ gisEditionPalette.add(add(addCasier.buildToolButton(EbliComponentFactory.INSTANCE)));
+ return gisEditionPalette;
}
public JComponent getMoveComponent() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-07-20 09:50:34
|
Revision: 7522
http://fudaa.svn.sourceforge.net/fudaa/?rev=7522&view=rev
Author: deniger
Date: 2012-07-20 09:50:24 +0000 (Fri, 20 Jul 2012)
Log Message:
-----------
ajout m?\195?\169thode utilitaires
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dcspEditorWsmode.xml
trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dlhyEditorWsmode.xml
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/LoiCourbeModel.java
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/LoiUiController.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/loi/DLHYTopComponent.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/loi/DcspEditorLoiTopComponent.java
Modified: trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dcspEditorWsmode.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dcspEditorWsmode.xml 2012-07-20 08:15:40 UTC (rev 7521)
+++ trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dcspEditorWsmode.xml 2012-07-20 09:50:24 UTC (rev 7522)
@@ -3,7 +3,7 @@
<name unique="loi-dcspEditor"/>
<kind type="view"/>
<state type="separated"/>
- <bounds x="250" y="50" width="650" height="850" />
+ <bounds x="250" y="50" width="850" height="850" />
<frame state="0"/>
<empty-behavior permanent="false"/>
</mode>
Modified: trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dlhyEditorWsmode.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dlhyEditorWsmode.xml 2012-07-20 08:15:40 UTC (rev 7521)
+++ trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/loi-dlhyEditorWsmode.xml 2012-07-20 09:50:24 UTC (rev 7522)
@@ -3,7 +3,7 @@
<name unique="loi-dlhyEditor"/>
<kind type="view"/>
<state type="separated"/>
- <bounds x="250" y="50" width="650" height="850" />
+ <bounds x="250" y="50" width="850" height="850" />
<frame state="0"/>
<empty-behavior permanent="false"/>
</mode>
Modified: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/LoiCourbeModel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/LoiCourbeModel.java 2012-07-20 08:15:40 UTC (rev 7521)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/LoiCourbeModel.java 2012-07-20 09:50:24 UTC (rev 7522)
@@ -212,7 +212,7 @@
}
if (!xrangeComputed) {
xMax = getX(0);
- xMin = yMax;
+ xMin = xMax;
for (int i = getNbValues() - 1; i > 0; i--) {
final double d = getX(i);
if (d > xMax) {
Modified: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/LoiUiController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/LoiUiController.java 2012-07-20 08:15:40 UTC (rev 7521)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/LoiUiController.java 2012-07-20 09:50:24 UTC (rev 7522)
@@ -1,6 +1,7 @@
package org.fudaa.fudaa.crue.loi;
import java.awt.Color;
+import java.awt.Dimension;
import java.awt.FlowLayout;
import java.util.Observable;
import java.util.Observer;
@@ -41,6 +42,14 @@
return infoController;
}
+ protected void configureTablePanel() {
+ tableGraphePanel.getTable().setModel(new LoiTableModel(tableGraphePanel));
+ tableGraphePanel.getTable().getColumnModel().getColumn(1).setPreferredWidth(120);
+ tableGraphePanel.getTable().getColumnModel().getColumn(2).setPreferredWidth(120);
+ tableGraphePanel.getTable().setPreferredSize(new Dimension(400, 600));
+ tableGraphePanel.setPreferredSize(new Dimension(300, 600));
+ }
+
EGGrapheSimpleModel getEGGrapheSimpleModel() {
return (EGGrapheSimpleModel) getGraphe().getModel();
}
@@ -69,7 +78,7 @@
panel = new EGFillePanel(graphe);
grapheModel.setSelectedComponent(courbe);
tableGraphePanel = new EGTableGraphePanel(true);
- tableGraphePanel.getTable().setModel(new LoiTableModel(tableGraphePanel));
+ configureTablePanel();
panel.majSelectionListener(tableGraphePanel);
tableGraphePanel.setGraphe(graphe);
@@ -130,6 +139,7 @@
@Override
public void update(Observable o, Object arg) {
tableGraphePanel.courbeContentChanged(courbe, false);
+ getGraphe().setXRangeIsModified();
getGraphe().fullRepaint();
}
});
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/loi/DLHYTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/loi/DLHYTopComponent.java 2012-07-20 08:15:40 UTC (rev 7521)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/loi/DLHYTopComponent.java 2012-07-20 09:50:24 UTC (rev 7522)
@@ -7,6 +7,7 @@
import com.memoire.bu.BuGridLayout;
import com.memoire.bu.BuResource;
import java.awt.BorderLayout;
+import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
@@ -49,38 +50,41 @@
@TopComponent.Description(preferredID = DLHYTopComponent.TOPCOMPONENT_ID, persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = DLHYTopComponent.MODE, openAtStartup = false)
public final class DLHYTopComponent extends AbstractModellingTopComponent implements ItemListener {
-
+
public static final String MODE = "loi-dlhyEditor"; //NOI18N
public static final String TOPCOMPONENT_ID = "DLHYTopComponent"; //NOI18N
LoiUiController loiUiController;
JTextField txtCommentaire;
JTextField txtNom;
JLabel lbNomValidation;
-
+
public DLHYTopComponent() {
initComponents();
setName(NbBundle.getMessage(DLHYTopComponent.class, "CTL_" + TOPCOMPONENT_ID));
setToolTipText(NbBundle.getMessage(DLHYTopComponent.class, "HINT_" + TOPCOMPONENT_ID));
loiUiController = new LoiUiController();
- add(loiUiController.getPanel());
add(loiUiController.getToolbar(), BorderLayout.NORTH);
- add(loiUiController.getTableGraphePanel(), BorderLayout.EAST);
-
+ loiUiController.getPanel().setPreferredSize(new Dimension(550, 350));
+ JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, loiUiController.getPanel(), loiUiController.getTableGraphePanel());
+ splitPane.setDividerLocation(550);
+ splitPane.setContinuousLayout(true);
+ add(splitPane);
+
JPanel nomComment = new JPanel(new BuGridLayout(3, 10, 10));
nomComment.add(new JLabel(NbBundle.getMessage(DLHYTopComponent.class, "Nom.DisplayName")));
final DocumentListener documentListener = super.createDocumentListener();
DocumentListener nameChanged = new DocumentListener() {
-
+
@Override
public void insertUpdate(DocumentEvent e) {
titleChanged();
}
-
+
@Override
public void removeUpdate(DocumentEvent e) {
titleChanged();
}
-
+
@Override
public void changedUpdate(DocumentEvent e) {
titleChanged();
@@ -123,11 +127,11 @@
Action delete;
Action duplicate;
Action create;
-
+
protected EMHScenario getScenario() {
return modellingScenarioModificationService.getModellingScenarioService().getScenarioLoaded();
}
-
+
protected void titleChanged() {
lbNomValidation.setText(StringUtils.EMPTY);
lbNomValidation.setIcon(null);
@@ -143,34 +147,34 @@
lbNomValidation.setIcon(LogIconTranslationProvider.getIcon(CtuluLogLevel.SEVERE));
}
}
-
+
protected String validateNom() {
String nom = txtNom.getText();
String error = ValidationPatternHelper.isNameValidei18nMessage(nom, currentLoi.getType());
return error;
}
-
+
private void createActions() {
delete = new EbliActionSimple(NbBundle.getMessage(DLHYTopComponent.class, "Delete.DisplayName"), BuResource.BU.getIcon("enlever"), "DELETE") {
-
+
@Override
public void actionPerformed(ActionEvent _e) {
delete();
}
};
delete.putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(DLHYTopComponent.class, "Delete.Description"));
-
+
duplicate = new EbliActionSimple(NbBundle.getMessage(DLHYTopComponent.class, "Duplicate.DisplayName"), BuResource.BU.getIcon("dupliquer"), "DUPLICATE") {
-
+
@Override
public void actionPerformed(ActionEvent _e) {
duplicate();
}
};
duplicate.putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(DLHYTopComponent.class, "Duplicate.Description"));
-
+
create = new EbliActionSimple(NbBundle.getMessage(DLHYTopComponent.class, "Create.DisplayName"), BuResource.BU.getIcon("creer"), "CREATE") {
-
+
@Override
public void actionPerformed(ActionEvent _e) {
create();
@@ -178,7 +182,7 @@
};
create.putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(DLHYTopComponent.class, "Create.Description"));
}
-
+
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
@@ -186,7 +190,7 @@
updateWithLoi();
}
}
-
+
@Override
public void setEditable(boolean b) {
editable = b;
@@ -197,12 +201,17 @@
duplicate.setEnabled(b);
create.setEnabled(b);
}
-
+
@Override
public void cancelModification() {
+ if (isNewLoi) {
+ isNewLoi = false;
+ currentLoi = (Loi) cbLois.getSelectedItem();
+ }
scenarioReloaded();
+ setModified(false);
}
-
+
@Override
protected void scenarioLoaded() {
Loi oldLoi = getCurrentLoi();
@@ -217,9 +226,9 @@
cbLois.setSelectedIndex(idx);
}
isNewLoi = false;
-
+
}
-
+
protected void updateWithLoi() {
Loi loi = getCurrentLoi();
txtCommentaire.setText(StringUtils.EMPTY);
@@ -232,7 +241,7 @@
}
loiUiController.setLoi(loi, getCcm());
loiUiController.getLoiModel().addObserver(new Observer() {
-
+
@Override
public void update(Observable o, Object arg) {
setModified(true);
@@ -241,12 +250,12 @@
loiUiController.setEditable(editable);
setModified(false);
}
-
+
@Override
protected void scenarioReloaded() {
scenarioLoaded();
}
-
+
@Override
protected void scenarioUnloaded() {
loiUiController.setLoi(null, null);
@@ -254,10 +263,10 @@
JComboBox cbLois;
Loi currentLoi;
boolean isNewLoi;
-
+
Loi getCurrentLoi() {
return currentLoi;
-
+
}
// protected boolean canModify(String action) {
@@ -287,7 +296,7 @@
cbLois.setEnabled(!modified);
}
boolean editable;
-
+
void delete() {
boolean used = currentLoi.getUsed();
if (used) {
@@ -304,13 +313,13 @@
DonLoiHYConteneur loiConteneur = getScenario().getLoiConteneur();
if (!isNewLoi) {
//TODO faire la recherche dans la boite
- int idx = Math.max(0, loiConteneur.getLois().indexOf(currentLoi) - 1);
+ DefaultComboBoxModel model = (DefaultComboBoxModel) cbLois.getModel();
+ int idx = Math.max(0, model.getIndexOf(model) - 1);
loiConteneur.removeLois(currentLoi);
currentLoi = null;
if (idx < loiConteneur.getLois().size()) {
currentLoi = loiConteneur.getLois().get(idx);
}
-
modellingScenarioModificationService.setScenarioModified(new ScenarioModificationEvent(EnumModification.DLHY));
} else {
//on sélectionne la loi disponible dans la combobox.
@@ -321,11 +330,12 @@
setModified(false);
}
}
-
+
void create() {
List<EnumTypeLoi> loisType = new ArrayList<EnumTypeLoi>(getCcm().getConfLoi().keySet());
loisType.remove(EnumTypeLoi.LoiZFK);
loisType.remove(EnumTypeLoi.LoiZFN);
+ loisType.remove(EnumTypeLoi.LoiPtProfil);
Collections.sort(loisType, ObjetNommeByIdComparator.INSTANCE);
JComboBox cb = new JComboBox(loisType.toArray(new EnumTypeLoi[loisType.size()]));
cb.setRenderer(new ObjetWithIdCellRenderer());
@@ -333,7 +343,7 @@
JPanel pn = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5));
pn.add(new JLabel(NbBundle.getMessage(DLHYTopComponent.class, "CreateLoi.TypeLabel")));
pn.add(cb);
- if (DialogHelper.showQuestion((String) create.getValue(Action.NAME), pn) && cb.getSelectedItem() != null) {
+ if (DialogHelper.showQuestionOkCancel((String) create.getValue(Action.NAME), pn) && cb.getSelectedItem() != null) {
EnumTypeLoi typeLoi = (EnumTypeLoi) cb.getSelectedItem();
isNewLoi = true;
currentLoi = LoiFactory.createLoi(typeLoi, getCcm());
@@ -342,7 +352,7 @@
setModified(true);
}
}
-
+
void duplicate() {
if (currentLoi == null) {
return;
@@ -353,7 +363,7 @@
updateWithLoi();
setModified(true);
}
-
+
@Override
public void valideModification() {
if (currentLoi == null) {
@@ -391,12 +401,12 @@
if (valideLoi.isNotEmpty()) {
LogsDisplayer.displayError(valideLoi, getName());
}
-
+
}
/**
- * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
- * regenerated by the Form Editor.
+ * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The
+ * content of this method is always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
@@ -412,12 +422,12 @@
// p.setProperty("version", "1.0");
// TODO store your settings
}
-
+
void readProperties(java.util.Properties p) {
// String version = p.getProperty("version");
// TODO read your settings according to their version
}
-
+
void selectLoi(Loi loiToActivate) {
if (isModified()) {
return;
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/loi/DcspEditorLoiTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/loi/DcspEditorLoiTopComponent.java 2012-07-20 08:15:40 UTC (rev 7521)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/loi/DcspEditorLoiTopComponent.java 2012-07-20 09:50:24 UTC (rev 7522)
@@ -11,6 +11,7 @@
import java.util.logging.Logger;
import javax.swing.JLabel;
import javax.swing.JPanel;
+import javax.swing.JSplitPane;
import javax.swing.JTextField;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
@@ -47,9 +48,11 @@
setName(NbBundle.getMessage(DcspEditorLoiTopComponent.class, "CTL_" + TOPCOMPONENT_ID));
setToolTipText(NbBundle.getMessage(DcspEditorLoiTopComponent.class, "HINT_" + TOPCOMPONENT_ID));
loiUiController = new LoiUiController();
- add(loiUiController.getPanel());
add(loiUiController.getToolbar(), BorderLayout.NORTH);
- add(loiUiController.getTableGraphePanel(), BorderLayout.EAST);
+ JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, loiUiController.getPanel(), loiUiController.getTableGraphePanel());
+ splitPane.setDividerLocation(550);
+ splitPane.setContinuousLayout(true);
+ add(splitPane);
JPanel nomComment = new JPanel(new BuGridLayout(2, 10, 10));
nomComment.add(new JLabel(NbBundle.getMessage(DcspEditorLoiTopComponent.class, "Description.DisplayName")));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-08-14 15:35:10
|
Revision: 7548
http://fudaa.svn.sourceforge.net/fudaa/?rev=7548&view=rev
Author: deniger
Date: 2012-08-14 15:35:03 +0000 (Tue, 14 Aug 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingVisualTopComponent.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingCloseAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/OrdResScenarioNode.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/services/ModellingValidCallable.java
trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/action/Bundle.properties
trunk/soft/fudaa-crue/ui-options/src/main/resources/default-coeurs.zip
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingVisualTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingVisualTopComponent.java 2012-08-14 00:25:15 UTC (rev 7547)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingVisualTopComponent.java 2012-08-14 15:35:03 UTC (rev 7548)
@@ -48,15 +48,15 @@
* Top component which displays something.
*/
@ConvertAsProperties(dtd = "-//org.fudaa.fudaa.crue.study//ModellingVisual//EN",
- autostore = false)
+autostore = false)
@TopComponent.Description(preferredID = ModellingVisualTopComponent.TOPCOMPONENT_ID,
- iconBase = "org/fudaa/fudaa/crue/modelling/rond-orange_16.png",
- persistenceType = TopComponent.PERSISTENCE_ALWAYS)
+iconBase = "org/fudaa/fudaa/crue/modelling/rond-orange_16.png",
+persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = "modelling-editor", openAtStartup = false, position = 4)
@ActionID(category = "Window", id = "org.fudaa.fudaa.crue.modelling.ModellingVisualTopComponent")
@ActionReference(path = "Menu/Window/Modelling")
@TopComponent.OpenActionRegistration(displayName = ModellingVisualTopComponent.TOPCOMPONENT_ACTION_DISPLAYNAME,
- preferredID = ModellingVisualTopComponent.TOPCOMPONENT_ID)
+preferredID = ModellingVisualTopComponent.TOPCOMPONENT_ID)
public final class ModellingVisualTopComponent extends AbstractModellingTopComponent implements LookupListener, ExplorerManager.Provider {
public static final String TOPCOMPONENT_ID = "ModellingVisualTopComponent";
@@ -115,7 +115,10 @@
@Override
public void cancelModification() {
- panel.getPlanimetryController().cancel();
+ //peut arriver si la panneau a été fermé.
+ if (panel != null) {
+ panel.getPlanimetryController().cancel();
+ }
setModified(false);
}
boolean isUpdatingFromHere;
@@ -184,7 +187,6 @@
this.repaint();
super.revalidate();
EventQueue.invokeLater(new Runnable() {
-
@Override
public void run() {
panel.getPlanimetryController().setEditable(false);
@@ -193,7 +195,6 @@
});
}
PropertyChangeListener visuChanged = new PropertyChangeListener() {
-
@Override
public void propertyChange(PropertyChangeEvent evt) {
setModified(panel.getPlanimetryController().getState().isModified());
@@ -266,8 +267,8 @@
}
/**
- * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of
- * this method is always regenerated by the Form Editor.
+ * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingCloseAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingCloseAction.java 2012-08-14 00:25:15 UTC (rev 7547)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingCloseAction.java 2012-08-14 15:35:03 UTC (rev 7548)
@@ -8,6 +8,7 @@
import org.fudaa.fudaa.crue.common.PerspectiveEnum;
import org.fudaa.fudaa.crue.common.helper.DialogHelper;
import org.fudaa.fudaa.crue.common.services.SelectedPerspectiveService;
+import org.fudaa.fudaa.crue.modelling.AbstractModellingTopComponent;
import org.fudaa.fudaa.crue.modelling.perspective.PerspectiveServiceModelling;
import org.fudaa.fudaa.crue.modelling.services.ModellingScenarioModificationService;
import org.openide.awt.ActionRegistration;
@@ -16,9 +17,11 @@
import org.openide.awt.ActionID;
import org.openide.util.Lookup;
import org.openide.util.NbBundle;
+import org.openide.windows.TopComponent;
+import org.openide.windows.WindowManager;
@ActionID(category = "View",
- id = "org.fudaa.fudaa.crue.modelling.ModellingClose")
+id = "org.fudaa.fudaa.crue.modelling.ModellingClose")
@ActionRegistration(displayName = "#CTL_ModellingClose")
@ActionReferences({
@ActionReference(path = "Menu/Modelling", position = 3333, separatorBefore = 3283, separatorAfter = 3383)
@@ -61,7 +64,13 @@
String close = org.openide.util.NbBundle.getMessage(ModellingCloseAction.class, "ModellingCloseAction.Close");
String cancel = org.openide.util.NbBundle.getMessage(ModellingCloseAction.class, "ModellingCloseAction.CancelClose");
Object showQuestion = DialogHelper.showQuestion((String) getValue(Action.NAME), message, new Object[]{close, cancel});
- return close.equals(showQuestion);
+ final boolean closeAsked = close.equals(showQuestion);
+ //we quit the modelling perspective even if the current view has modifications
+ if (closeAsked && isActivatedModified) {
+ AbstractModellingTopComponent activated = (AbstractModellingTopComponent) WindowManager.getDefault().getRegistry().getActivated();
+ activated.cancelModification();
+ }
+ return closeAsked;
}
@Override
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/OrdResScenarioNode.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/OrdResScenarioNode.java 2012-08-14 00:25:15 UTC (rev 7547)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/OrdResScenarioNode.java 2012-08-14 15:35:03 UTC (rev 7548)
@@ -4,10 +4,18 @@
*/
package org.fudaa.fudaa.crue.modelling.calcul;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
import java.util.List;
+import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.common.BusinessMessages;
+import org.fudaa.dodico.crue.common.CollectionCrueUtil;
+import org.fudaa.dodico.crue.metier.emh.OrdRes;
import org.fudaa.dodico.crue.metier.emh.OrdResScenario;
+import org.fudaa.dodico.crue.metier.transformer.TransformerHelper;
+import org.fudaa.fudaa.crue.common.property.AbstractNodeFirable;
import org.fudaa.fudaa.crue.common.property.PropertyNodeBuilder;
+import org.fudaa.fudaa.crue.common.property.PropertySupportReadWrite;
import org.fudaa.fudaa.crue.common.property.PropertySupportReflection;
import org.fudaa.fudaa.crue.modelling.node.AbstractModellingNodeFirable;
import org.fudaa.fudaa.crue.modelling.perspective.PerspectiveServiceModelling;
@@ -44,15 +52,34 @@
return sheet;
}
- private Sheet.Set createSet(Object in) {
+ private Sheet.Set createSet(OrdRes in) {
Sheet.Set set = new Sheet.Set();
set.setName(in.getClass().getSimpleName());
set.setDisplayName(BusinessMessages.geti18nForClass(in.getClass()));
- PropertyNodeBuilder nodeBuilder = new PropertyNodeBuilder();
- List<PropertySupportReflection> createFromPropertyDesc = nodeBuilder.createFromPropertyDesc(in, this);
- for (PropertySupportReflection propertySupportReflection : createFromPropertyDesc) {
- set.put(propertySupportReflection);
+ ArrayList<String> ddes = CollectionCrueUtil.getSortedList(TransformerHelper.toId(in.getDdes()));
+ for (String dde : ddes) {
+ set.put(new DdePropertySupport(this, in, dde));
}
return set;
}
+
+ public static class DdePropertySupport extends PropertySupportReadWrite<OrdRes, Boolean> {
+
+ private final String ddeName;
+
+ public DdePropertySupport(AbstractNodeFirable node, OrdRes ores, String ddeName) {
+ super(node, ores, Boolean.TYPE, ddeName, StringUtils.capitalize(ddeName));
+ this.ddeName = ddeName;
+ }
+
+ @Override
+ protected void setValueInInstance(Boolean newVal) {
+ getInstance().setDdeValue(ddeName, newVal.booleanValue());
+ }
+
+ @Override
+ public Boolean getValue() throws IllegalAccessException, InvocationTargetException {
+ return Boolean.valueOf(getInstance().getDdeValue(ddeName));
+ }
+ }
}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/services/ModellingValidCallable.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/services/ModellingValidCallable.java 2012-08-14 00:25:15 UTC (rev 7547)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/services/ModellingValidCallable.java 2012-08-14 15:35:03 UTC (rev 7548)
@@ -18,7 +18,7 @@
@Override
public CtuluLogGroup call() throws Exception {
- return ScenarioLoader.validateScenario(service.getScenarioLoaded(), service.getSelectedProjet().getPropDefinition(),
- service.getManagerScenarioLoaded().isCrue9());
+ return ScenarioLoader.validateScenario(service.getScenarioLoaded(), service.getSelectedProjet().getCoeurConfig(),
+ service.getManagerScenarioLoaded().isCrue9());
}
}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/action/Bundle.properties
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/action/Bundle.properties 2012-08-14 00:25:15 UTC (rev 7547)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/action/Bundle.properties 2012-08-14 15:35:03 UTC (rev 7548)
@@ -17,7 +17,7 @@
ModellingSaveAction.SucceedMessage=Sc\u00e9nario {0} sauv\u00e9
ModellingCloseAction.ActivatedIsModified=La vue active contient des donn\u00e9es non valid\u00e9es
ModellingCloseAction.IsModified=Des donn\u00e9es ne sont pas enregistr\u00e9es
-ModellingCloseAction.Confirm=Voulez-vous ignore les modification et fermer le sc\u00e9nario ?
+ModellingCloseAction.Confirm=Voulez-vous ignorer les modifications et fermer le sc\u00e9nario ?
ModellingCloseAction.Close=Fermer
ModellingCloseAction.CancelClose=Annuler la fermeture
ModellingListNoeudNodeAction.Name=Liste des noeuds
Modified: trunk/soft/fudaa-crue/ui-options/src/main/resources/default-coeurs.zip
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-08-15 13:26:09
|
Revision: 7552
http://fudaa.svn.sourceforge.net/fudaa/?rev=7552&view=rev
Author: deniger
Date: 2012-08-15 13:26:01 +0000 (Wed, 15 Aug 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/pom.xml
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/editor/SpinnerInplaceEditor.java
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/DialogHelper.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingFilesTopComponent.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/ConfigurationUI.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/ConfigureUIAction.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryController.java
trunk/soft/fudaa-crue/ui-study/pom.xml
trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/dialog/ManageManagerEMHContainerDialog.java
trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/services/GlobalStateManager.java
trunk/soft/fudaa-crue/ui-study/src/main/resources/org/fudaa/fudaa/crue/study/layer.xml
trunk/soft/fudaa-crue/ui-study/src/main/resources/org/fudaa/fudaa/crue/study/services/Bundle.properties
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/services/GlobalStateManagerRien.java
trunk/soft/fudaa-crue/ui-study/src/test/java/TestScrollPane.java
Modified: trunk/soft/fudaa-crue/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/pom.xml 2012-08-15 13:23:50 UTC (rev 7551)
+++ trunk/soft/fudaa-crue/pom.xml 2012-08-15 13:26:01 UTC (rev 7552)
@@ -94,7 +94,7 @@
<artifactId>swingx-all</artifactId>
<version>1.6.3</version>
</dependency>
-<!-- <dependency>
+ <!-- <dependency>
<groupId>net.java.dev.glazedlists</groupId>
<artifactId>glazedlists_java15</artifactId>
<version>1.8.0</version>
@@ -218,7 +218,7 @@
<type>nbm</type>
</dependency>
- <!-- Externes -->
+ <!-- Externes -->
<dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
@@ -234,6 +234,11 @@
<artifactId>xstream</artifactId>
<version>1.4.2</version>
</dependency>
+ <dependency>
+ <groupId>com.jidesoft</groupId>
+ <artifactId>jide-oss</artifactId>
+ <version>3.4.3</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<build>
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/editor/SpinnerInplaceEditor.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/editor/SpinnerInplaceEditor.java 2012-08-15 13:23:50 UTC (rev 7551)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/editor/SpinnerInplaceEditor.java 2012-08-15 13:26:01 UTC (rev 7552)
@@ -1,12 +1,24 @@
package org.fudaa.fudaa.crue.common.editor;
import java.awt.Component;
+import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.beans.PropertyEditor;
+import java.beans.PropertyVetoException;
+import java.beans.VetoableChangeListener;
+import java.text.ParseException;
+import java.util.HashSet;
+import java.util.Set;
import javax.swing.JComponent;
import javax.swing.JSpinner;
import javax.swing.KeyStroke;
import javax.swing.SpinnerNumberModel;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
import org.openide.explorer.propertysheet.InplaceEditor;
import org.openide.explorer.propertysheet.PropertyEnv;
import org.openide.explorer.propertysheet.PropertyModel;
@@ -15,7 +27,7 @@
*
* @author deniger ( genesis)
*/
-public class SpinnerInplaceEditor implements InplaceEditor {
+public class SpinnerInplaceEditor implements InplaceEditor, FocusListener {
private final JSpinner spinner;
private PropertyEditor editor = null;
@@ -23,9 +35,24 @@
public SpinnerInplaceEditor(SpinnerNumberModel model) {
this.spinner = new JSpinner(model);
+ spinner.getEditor().addFocusListener(this);
+
}
+ void componentEdited() {
+ }
+
@Override
+ public void focusLost(FocusEvent e) {
+ fire(COMMAND_SUCCESS);
+ }
+
+ @Override
+ public void focusGained(FocusEvent e) {
+// System.err.println("Yes");
+ }
+
+ @Override
public void connect(PropertyEditor propertyEditor, PropertyEnv env) {
editor = propertyEditor;
reset();
@@ -45,6 +72,10 @@
@Override
public Object getValue() {
+ try {
+ spinner.commitEdit();
+ } catch (ParseException parseException) {
+ }
return spinner.getValue();
}
@@ -94,14 +125,23 @@
public boolean isKnownComponent(Component component) {
return component == spinner || spinner.isAncestorOf(component);
}
+ Set<ActionListener> actionListeners = new HashSet<ActionListener>();
@Override
public void addActionListener(ActionListener actionListener) {
- //do nothing - not needed for this component
+ actionListeners.add(actionListener);
}
+ private void fire(String command) {
+ ActionEvent evt = new ActionEvent(this, 0, command);
+ for (ActionListener actionListener : actionListeners) {
+ actionListener.actionPerformed(evt);
+
+ }
+ }
+
@Override
public void removeActionListener(ActionListener actionListener) {
- //do nothing - not needed for this component
+ actionListeners.remove(actionListener);
}
}
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/DialogHelper.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/DialogHelper.java 2012-08-15 13:23:50 UTC (rev 7551)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/DialogHelper.java 2012-08-15 13:26:01 UTC (rev 7552)
@@ -1,6 +1,11 @@
package org.fudaa.fudaa.crue.common.helper;
+import java.awt.Component;
import java.awt.EventQueue;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.JComponent;
+import javax.swing.JScrollPane;
import org.fudaa.ctulu.gui.CtuluDialog;
import org.fudaa.ctulu.gui.CtuluDialogPanel;
import org.fudaa.fudaa.crue.common.CrueIconsProvider;
@@ -19,6 +24,33 @@
*/
public class DialogHelper {
+ public static < T extends JComponent> List<T> findComponent(JComponent parent, Class<T> type) {
+ List<T> res = new ArrayList<T>();
+ findComponent(parent, type, res);
+ return res;
+ }
+
+ public static < T extends JComponent> void findComponent(JComponent currentComponent, Class<T> type, List<T> target) {
+ if (currentComponent instanceof JScrollPane) {
+ findComponent((JComponent) ((JScrollPane) currentComponent).getViewport().getView(), type, target);
+ return;
+ }
+
+ if (type.isAssignableFrom(currentComponent.getClass())) {
+ target.add((T) currentComponent);
+ return;
+ }
+ Component[] components = currentComponent.getComponents();
+ if (components == null) {
+ return;
+ }
+ for (Component component : components) {
+ if (component instanceof JComponent) {
+ findComponent((JComponent) component, type, target);
+ }
+ }
+ }
+
public static void showDialogAndTable(final CtuluDialogPanel pn, final int dialogOption,
final JXTable table, final String dialogName, final String dialogTitle) {
@@ -29,7 +61,6 @@
s.setName(dialogName);
s.afficheDialogModal(new Runnable() {
-
@Override
public void run() {
UserPreferencesSaver.loadDialogLocationAndDimension(s);
@@ -84,7 +115,6 @@
public static void showInfo(final String title, final Object msg, boolean later) {
if (later) {
EventQueue.invokeLater(new Runnable() {
-
@Override
public void run() {
showInfo(title, msg);
@@ -202,7 +232,6 @@
protected static void loadTablePreferencesLater(final JXTable table) {
EventQueue.invokeLater(new Runnable() {
-
@Override
public void run() {
UserPreferencesSaver.loadTablePreferences(table);
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingFilesTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingFilesTopComponent.java 2012-08-15 13:23:50 UTC (rev 7551)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingFilesTopComponent.java 2012-08-15 13:26:01 UTC (rev 7552)
@@ -31,7 +31,7 @@
import org.openide.util.LookupListener;
/**
- * Top component which displays something.
+ * Contient l'arbres de calques. Devrait être renomé.
*/
@ConvertAsProperties(dtd = "-//org.fudaa.fudaa.crue.modelling//ModellingFilesTopComponent//EN",
autostore = false)
@@ -83,6 +83,9 @@
*/
@Override
protected void scenarioLoaded() {
+ if (scenarioVisuService.getPlanimetryVisuPanel() != null) {
+ scenarioVisuLoaded();
+ }
}
protected void scenarioVisuLoaded() {
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/ConfigurationUI.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/ConfigurationUI.java 2012-08-15 13:23:50 UTC (rev 7551)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/ConfigurationUI.java 2012-08-15 13:26:01 UTC (rev 7552)
@@ -115,6 +115,11 @@
}
OutlineView listView;
PropertySheetView sheetView;
+
+
+ public void validEdition(){
+
+ }
public void initComponents() {
setLayout(new BorderLayout(5, 5));
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/ConfigureUIAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/ConfigureUIAction.java 2012-08-15 13:23:50 UTC (rev 7551)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/ConfigureUIAction.java 2012-08-15 13:26:01 UTC (rev 7552)
@@ -2,14 +2,13 @@
import com.memoire.bu.BuResource;
import com.rits.cloning.Cloner;
-import com.sun.pdfview.font.ttf.HeadTable;
import java.awt.Dialog;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
-import javax.swing.JDialog;
-import org.fudaa.ebli.calque.BCalque;
+import javax.swing.JTable;
import org.fudaa.ebli.commun.EbliActionSimple;
+import org.fudaa.fudaa.crue.common.helper.DialogHelper;
import org.fudaa.fudaa.crue.planimetry.configuration.VisuConfiguration;
import org.fudaa.fudaa.crue.planimetry.configuration.node.AdditionalConfigurationNode;
import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryAdditionalLayerContrat;
@@ -30,7 +29,7 @@
public ConfigureUIAction(PlanimetryVisuPanel panel) {
super(NbBundle.getMessage(ConfigureUIAction.class, "Configure.Action"), BuResource.BU.getToolIcon("configurer"),
- CONFIGURE_ACTION_KEY);
+ CONFIGURE_ACTION_KEY);
this.panel = panel;
}
@@ -46,15 +45,21 @@
final String apply = NbBundle.getMessage(ConfigureUIAction.class, "ConfigurationUI.Apply.Name");
Object[] options = new Object[]{NotifyDescriptor.OK_OPTION, apply, NotifyDescriptor.CANCEL_OPTION};
final DialogDescriptor dialogDescriptor = new DialogDescriptor(ui, (String) getValue(NAME), true, options,
- NotifyDescriptor.OK_OPTION,
- DialogDescriptor.DEFAULT_ALIGN,
- HelpCtx.DEFAULT_HELP,
- null);
+ NotifyDescriptor.OK_OPTION,
+ DialogDescriptor.DEFAULT_ALIGN,
+ HelpCtx.DEFAULT_HELP,
+ null);
dialogDescriptor.setClosingOptions(new Object[]{NotifyDescriptor.OK_OPTION, NotifyDescriptor.CANCEL_OPTION});
dialogDescriptor.setButtonListener(new ActionListener() {
-
@Override
public void actionPerformed(ActionEvent e) {
+ List<JTable> tables = DialogHelper.findComponent(ui.sheetView, JTable.class);
+ if (!tables.isEmpty()) {
+ JTable table = tables.get(0);
+ if (table.isEditing()) {
+ table.getCellEditor().stopCellEditing();
+ }
+ }
Object value = dialogDescriptor.getValue();
final boolean isApply = apply.equals(value);
if (NotifyDescriptor.OK_OPTION.equals(value) || isApply) {
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryController.java 2012-08-15 13:23:50 UTC (rev 7551)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryController.java 2012-08-15 13:26:01 UTC (rev 7552)
@@ -173,7 +173,8 @@
saveConfiguration = cloner.deepClone(visuConfiguration);
}
apply(cloned);
- visuPanel.getVueCalque().repaint();
+ visuPanel.getVueCalque().repaint(0);
+ visuPanel.repaint();
getState().setStudyConfigModified();
}
Modified: trunk/soft/fudaa-crue/ui-study/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-study/pom.xml 2012-08-15 13:23:50 UTC (rev 7551)
+++ trunk/soft/fudaa-crue/ui-study/pom.xml 2012-08-15 13:26:01 UTC (rev 7552)
@@ -16,6 +16,10 @@
<dependencies>
<dependency>
+ <groupId>com.jidesoft</groupId>
+ <artifactId>jide-oss</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>crue-server</artifactId>
<scope>provided</scope>
@@ -146,14 +150,14 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
- <!-- to have the jar plugin pickup the nbm generated manifest -->
+ <!-- to have the jar plugin pickup the nbm generated manifest -->
<useDefaultManifestFile>true</useDefaultManifestFile>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
Modified: trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/dialog/ManageManagerEMHContainerDialog.java
===================================================================
--- trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/dialog/ManageManagerEMHContainerDialog.java 2012-08-15 13:23:50 UTC (rev 7551)
+++ trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/dialog/ManageManagerEMHContainerDialog.java 2012-08-15 13:26:01 UTC (rev 7552)
@@ -89,7 +89,7 @@
if (creation) {
this.title = NbBundle.getMessage(FileDialog.class, "ManageManagerEMHContainerDialog.TitleCreation", this.convertLevel(level),
- this.convertVersion(version));
+ this.convertVersion(version));
} else {
this.title = NbBundle.getMessage(FileDialog.class, "ManageManagerEMHContainerDialog.TitleModification", this.convertLevel(
level), this.convertVersion(version));
@@ -161,7 +161,6 @@
modelesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
sousModelesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
modelesList.addListSelectionListener(new ListSelectionListener() {
-
@Override
public void valueChanged(ListSelectionEvent e) {
jButtonModeleEdit.setEnabled(!modelesList.isSelectionEmpty());
@@ -169,14 +168,12 @@
});
sousModelesList.addListSelectionListener(new ListSelectionListener() {
-
@Override
public void valueChanged(ListSelectionEvent e) {
jButtonSousModeleEdit.setEnabled(!sousModelesList.isSelectionEmpty());
}
});
modelesList.addMouseListener(new MouseAdapter() {
-
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
@@ -185,7 +182,6 @@
}
});
sousModelesList.addMouseListener(new MouseAdapter() {
-
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
@@ -204,8 +200,8 @@
JComboBox combox = createModelCombo(currentValue.nom);
combox.setSelectedItem(currentValue.nom);
if (JOptionPane.showConfirmDialog(this, combox, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.editModele"),
- JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
+ "ManageManagerEMHContainerDialog.editModele"),
+ JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
String newName = (String) combox.getSelectedItem();
//modification done:
if (newName != null && !newName.equals(currentValue.nom)) {
@@ -228,8 +224,8 @@
JComboBox combox = createSousModelCombo(currentValue.nom);
combox.setSelectedItem(currentValue.nom);
if (JOptionPane.showConfirmDialog(this, combox, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.editSousModele"),
- JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
+ "ManageManagerEMHContainerDialog.editSousModele"),
+ JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
String newName = (String) combox.getSelectedItem();
//modification done:
if (newName != null && !newName.equals(currentValue.nom)) {
@@ -373,8 +369,8 @@
}
/**
- * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of
- * this method is always regenerated by the Form Editor.
+ * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
@@ -665,7 +661,7 @@
String msg = ValidationPatternHelper.isRadicalValideForEMHContainerMsg(radical);
if (msg != null) {
DialogHelper.showError(title, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.invalidName", BusinessMessages.getString(
+ "ManageManagerEMHContainerDialog.invalidName", BusinessMessages.getString(
msg)));
return;
}
@@ -678,8 +674,8 @@
final boolean isModificationAndOtherManagerWithSameName = !creation && existingContainer != null && existingContainer != container;
if (isCreationAndManagerExist || isModificationAndOtherManagerWithSameName) {
JOptionPane.showMessageDialog(this, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.nameExists", radical), title,
- JOptionPane.ERROR_MESSAGE);
+ "ManageManagerEMHContainerDialog.nameExists", radical), title,
+ JOptionPane.ERROR_MESSAGE);
return;
}
@@ -692,8 +688,8 @@
files.add(file);
} else {
JOptionPane.showMessageDialog(this, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.fileMissing"), title,
- JOptionPane.ERROR_MESSAGE);
+ "ManageManagerEMHContainerDialog.fileMissing"), title,
+ JOptionPane.ERROR_MESSAGE);
return;
}
@@ -706,8 +702,8 @@
boolean hasActive = scenarioContainsActiveModele();
if (!hasActive) {
JOptionPane.showMessageDialog(this, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.activeModele"), title,
- JOptionPane.ERROR_MESSAGE);
+ "ManageManagerEMHContainerDialog.activeModele"), title,
+ JOptionPane.ERROR_MESSAGE);
return;
}
}
@@ -715,15 +711,18 @@
boolean hasActive = modeleContainsActiveSousModele();
if (!hasActive) {
JOptionPane.showMessageDialog(this, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.activeSousModele"), title,
- JOptionPane.ERROR_MESSAGE);
+ "ManageManagerEMHContainerDialog.activeSousModele"), title,
+ JOptionPane.ERROR_MESSAGE);
return;
}
}
//ok maintenant on essaie de renommer le manager:
RenameManager renameMager = new RenameManager();
renameMager.setProject(projet);
- if (!renameMager.renameManager(CrueLevelType.getCatEMH(level), container, radical)) {
+ if (creation) {
+ //on ajoute le manager:
+ projet.addManager(CrueLevelType.getCatEMH(level), container, radical);
+ } else if (!renameMager.renameManager(CrueLevelType.getCatEMH(level), container, radical)) {
DialogHelper.showError(NbBundle.getMessage(ManageManagerEMHContainerDialog.class, "ModifiyEMHContainer.NameUsed", radical));
return;
}
@@ -763,14 +762,14 @@
}
if (JOptionPane.showConfirmDialog(this, modelesCombo, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.addModele"),
- JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
+ "ManageManagerEMHContainerDialog.addModele"),
+ JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
final int selectedIndex = modelesCombo.getSelectedIndex();
if (selectedIndex > -1) {
final SimplifiedManagerItem item = new SimplifiedManagerItem();
- item.nom =(String) modelesCombo.getSelectedItem();
+ item.nom = (String) modelesCombo.getSelectedItem();
((DefaultListModel) this.modelesList.getModel()).addElement(item);
@@ -784,8 +783,8 @@
final int selectedIndex = this.modelesList.getSelectedIndex();
if (selectedIndex != -1) {
if (JOptionPane.showConfirmDialog(this, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.removeModele"), title,
- JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
+ "ManageManagerEMHContainerDialog.removeModele"), title,
+ JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
((DefaultListModel) this.modelesList.getModel()).remove(selectedIndex);
this.modelesAddButton.setEnabled(true);
@@ -793,8 +792,8 @@
}
} else {
JOptionPane.showMessageDialog(this, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.selectModele"), title,
- JOptionPane.ERROR_MESSAGE);
+ "ManageManagerEMHContainerDialog.selectModele"), title,
+ JOptionPane.ERROR_MESSAGE);
}
}//GEN-LAST:event_modelesRemoveButtonActionPerformed
@@ -805,13 +804,13 @@
}
if (JOptionPane.showConfirmDialog(this, sousModelesCombo, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.addSousModele"),
- JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
+ "ManageManagerEMHContainerDialog.addSousModele"),
+ JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
final int selectedIndex = sousModelesCombo.getSelectedIndex();
if (selectedIndex > -1) {
final SimplifiedManagerItem item = new SimplifiedManagerItem();
- item.nom = (String)sousModelesCombo.getSelectedItem();
+ item.nom = (String) sousModelesCombo.getSelectedItem();
((DefaultListModel) this.sousModelesList.getModel()).addElement(item);
}
@@ -822,14 +821,14 @@
final int selectedIndex = this.sousModelesList.getSelectedIndex();
if (selectedIndex != -1) {
if (JOptionPane.showConfirmDialog(this, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.removeSousModele"), title,
- JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
+ "ManageManagerEMHContainerDialog.removeSousModele"), title,
+ JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
((DefaultListModel) this.sousModelesList.getModel()).remove(selectedIndex);
}
} else {
JOptionPane.showMessageDialog(this, NbBundle.getMessage(ManageManagerEMHContainerDialog.class,
- "ManageManagerEMHContainerDialog.selectSousModele"), title,
- JOptionPane.ERROR_MESSAGE);
+ "ManageManagerEMHContainerDialog.selectSousModele"), title,
+ JOptionPane.ERROR_MESSAGE);
}
}//GEN-LAST:event_sousModelesRemoveButtonActionPerformed
Modified: trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/services/GlobalStateManager.java
===================================================================
--- trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/services/GlobalStateManager.java 2012-08-15 13:23:50 UTC (rev 7551)
+++ trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/services/GlobalStateManager.java 2012-08-15 13:26:01 UTC (rev 7552)
@@ -4,6 +4,8 @@
*/
package org.fudaa.fudaa.crue.study.services;
+import com.jidesoft.swing.SimpleScrollPane;
+import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
@@ -32,10 +34,10 @@
import org.openide.util.lookup.Lookups;
@ActionID(category = "File",
- id = "org.fudaa.fudaa.crue.study.services.GlobalStateManager")
+id = "org.fudaa.fudaa.crue.study.services.GlobalStateManager")
@ActionRegistration(displayName = "#GlobalStateManager")
public final class GlobalStateManager extends AbstractAction implements Presenter.Toolbar {
-
+
CrueService crueService = Lookup.getDefault().lookup(CrueService.class);
private JTextField txtEtu;
private JLabel jlEtu;
@@ -43,13 +45,13 @@
private JLabel jlModelling;
private JTextField txtPost;
private JLabel jlPost;
-
+
public GlobalStateManager() {
crueService.addModellingEMHScenarioLookupListener(new ModellingLookupListener());
crueService.addPostLookupListener(new PostLookupListener());
crueService.addEMHProjetStateLookupListener(new EMHProjetLookupListener());
}
-
+
@Override
public Component getToolbarPresenter() {
txtModelling = new JTextField();
@@ -61,32 +63,38 @@
txtPost = new JTextField();
txtPost.setColumns(45);
txtPost.setEditable(false);
- JPanel panel = new JPanel();
- final FlowLayout layout = new FlowLayout(FlowLayout.LEFT, 0, 0);
- layout.setAlignOnBaseline(true);
-// final LayoutManager layout = new BuHorizontalLayout(0, false, false);
- panel.setLayout(layout);
+
jlEtu = new JLabel(NbBundle.getMessage(GlobalStateManager.class, "GlobalPresenter.EtuState.Text"));
jlEtu.setIcon(CrueIconsProvider.getEtuIcon());
jlModelling = new JLabel(NbBundle.getMessage(GlobalStateManager.class, "GlobalPresenter.ModellingState.Text"));
jlModelling.setIcon(CrueIconsProvider.getIcon(EnumCatEMH.SCENARIO));
-
+
jlPost = new JLabel(NbBundle.getMessage(GlobalStateManager.class, "GlobalPresenter.PostState.Text"));
jlPost.setIcon(CrueIconsProvider.getIconRun());
-
+
Lookup.Template<BooleanStateAction> template = new Lookup.Template<BooleanStateAction>(BooleanStateAction.class,
- ChangeEditStateAction.getActionLookupId(),
- null);
+ ChangeEditStateAction.getActionLookupId(),
+ null);
Lookup.Item<BooleanStateAction> lookupAll = Lookups.forPath...
[truncated message content] |
|
From: <de...@us...> - 2012-08-17 16:25:41
|
Revision: 7558
http://fudaa.svn.sourceforge.net/fudaa/?rev=7558&view=rev
Author: deniger
Date: 2012-08-17 16:25:34 +0000 (Fri, 17 Aug 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/main/resources/org/fudaa/dodico/crue/common/businessMessages.properties
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionDonFrtCellRenderer.java
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionLoiUiController.java
trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties
trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestProfilSectionUIController.java
Modified: trunk/soft/fudaa-crue/crue-server/src/main/resources/org/fudaa/dodico/crue/common/businessMessages.properties
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/resources/org/fudaa/dodico/crue/common/businessMessages.properties 2012-08-17 16:00:55 UTC (rev 7557)
+++ trunk/soft/fudaa-crue/crue-server/src/main/resources/org/fudaa/dodico/crue/common/businessMessages.properties 2012-08-17 16:25:34 UTC (rev 7558)
@@ -355,7 +355,7 @@
validation.ord.NotNormal = L''ordonn\u00e9e du point {0} n''est pas normale.
validation.ord.NotValid = L''ordonn\u00e9e du point {0} n''est pas valide.
profil.editionValidation.order.error=L''ordre de LitNomme n''est pas valide. Attendu: {1}
-profil.editionValidation.end.error=L''\u00e9tiquette de fin du LitNomme {0} n''est pas d\u00e9fini.
+profil.editionValidation.end.error=L''\u00e9tiquette de fin du LitNomme {0} n''est pas d\u00e9finie.
validation.pdtVar.OneElemIsRequired={0}: au moins un \u00e9l\u00e9ment doit \u00eatre d\u00e9fini
Modified: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionDonFrtCellRenderer.java
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionDonFrtCellRenderer.java 2012-08-17 16:00:55 UTC (rev 7557)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionDonFrtCellRenderer.java 2012-08-17 16:25:34 UTC (rev 7558)
@@ -24,10 +24,14 @@
ProfilSectionLoiTableModel tableModel = (ProfilSectionLoiTableModel) _table.getModel();
ProfilSectionLine line = tableModel.getLine(_row);
if (line.containsLimiteLitNomme()) {
- init = Color.LIGHT_GRAY;
+// init = Color.LIGHT_GRAY;
} else if (line.containsLimiteLit()) {
- init = limitLitColor;
+// init = limitLitColor;
}
+ else{
+ setText(null);
+ setToolTipText(null);
+ }
setBackground(init);
}
Modified: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionLoiUiController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionLoiUiController.java 2012-08-17 16:00:55 UTC (rev 7557)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionLoiUiController.java 2012-08-17 16:25:34 UTC (rev 7558)
@@ -23,6 +23,7 @@
import org.fudaa.dodico.crue.validation.ValidateAndRebuildProfilSection;
import org.fudaa.fudaa.crue.common.log.LogIconTranslationProvider;
import org.fudaa.fudaa.crue.common.log.LogsDisplayer;
+import org.fudaa.fudaa.crue.loi.LoiMessages;
import org.fudaa.fudaa.crue.loi.common.AbstractLoiCourbeModel;
import org.fudaa.fudaa.crue.loi.common.AbstractLoiUiController;
import org.fudaa.fudaa.crue.loi.common.DefaultLoiTableModel;
@@ -31,36 +32,36 @@
*
* @author Frederic Deniger
*/
-public class ProfilSectionLoiUiController extends AbstractLoiUiController implements TableModelListener{
+public class ProfilSectionLoiUiController extends AbstractLoiUiController implements TableModelListener {
- JLabel labelValidating=new JLabel();
-
+ JLabel labelValidating = new JLabel(" test");
+
public ProfilSectionLoiUiController() {
tableGraphePanel.getTable().getModel().addTableModelListener(this);
}
-
+
public JLabel getLabelValidating() {
return labelValidating;
}
@Override
public void tableChanged(TableModelEvent e) {
- if(e.getColumn()==ProfilSectionLoiTableModel.COLUMN_FRT){
+ if (e.getColumn() == ProfilSectionLoiTableModel.COLUMN_FRT) {
return;
}
- CtuluLog log=validateLit();
- if(log.isEmpty()){
+ CtuluLog log = validateLit();
+ if (log.isEmpty()) {
labelValidating.setIcon(null);
labelValidating.setText(null);
labelValidating.setToolTipText(null);
- }
- else{
+ } else {
labelValidating.setIcon(LogIconTranslationProvider.getIcon(CtuluLogLevel.ERROR));
+ labelValidating.setText(org.openide.util.NbBundle.getMessage(LoiMessages.class, "ProfilSection.Lit.Error"));
+ String toHtml = LogsDisplayer.toHtml(log);
+ labelValidating.setToolTipText(toHtml);
}
}
-
-
@Override
public ProfiLSectionCourbeModel getLoiModel() {
return (ProfiLSectionCourbeModel) super.getLoiModel();
@@ -69,11 +70,11 @@
Map<LitNomme, ProfilSectionEtiquette> etiquettesByLitNomme;
ProfilSectionEtiquette etiquettesLimiteLit;
CrueConfigMetier ccm;
-
+
public CtuluLog validateLit() {
return new ProfilSectionLitValidation().valid(getLoiModel().getProfilSectionLoiLine(), ccm.getLitNomme());
}
-
+
public void setProfilSection(DonPrtGeoProfilSection profil, CrueConfigMetier ccm) {
this.ccm = ccm;
if (profil == null) {
@@ -107,7 +108,7 @@
final ProfilSectionEtiquette litNommeEtiquette = etiquettesByLitNomme.get(litNommeIndexed.getLitNomme());
model.getLoiLine(start).addEtiquette(litNommeEtiquette);
model.getLoiLine(last).addEtiquette(litNommeEtiquette);
-
+
int litNumerotesSize = litNommeIndexed.getLitNumerotesSize();
for (int i = 0; i < litNumerotesSize; i++) {
LitNumeroteIndex litNumeroteIndex = litNommeIndexed.getLitNumeroteIndex(i);
@@ -118,17 +119,17 @@
model.getLoiLine(litNumeroteIndex.getIdxStart()).addEtiquette(etiquettesLimiteLit);
}
}
-
+
}
-
-
+
+
}
-
+
@Override
protected DefaultLoiTableModel createTableModel() {
return new ProfilSectionLoiTableModel(tableGraphePanel);
}
-
+
@Override
protected AbstractLoiCourbeModel createCourbeModel(Loi loi, ConfigLoi configLoi) {
return ProfiLSectionCourbeModel.create(loi, configLoi);
Modified: trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties 2012-08-17 16:00:55 UTC (rev 7557)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties 2012-08-17 16:25:34 UTC (rev 7558)
@@ -28,3 +28,4 @@
EditionCancel=Fermer
ProfilSection.DonFrt.LimiteLit=--------
ProfilSection.DonFrt.LimiteLitNomme=========
+ProfilSection.Lit.Error=Erreurs d\u00e9tect\u00e9es dans les LitNomme
Modified: trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestProfilSectionUIController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestProfilSectionUIController.java 2012-08-17 16:00:55 UTC (rev 7557)
+++ trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestProfilSectionUIController.java 2012-08-17 16:25:34 UTC (rev 7558)
@@ -53,18 +53,10 @@
JPanel pn = new JPanel(new BorderLayout(10, 10));
pn.add(uiController.getPanel());
pn.add(uiController.getToolbar(), BorderLayout.NORTH);
- pn.add(uiController.getTableGraphePanel(), BorderLayout.EAST);
- JButton btValid = new JButton("Valide");
- btValid.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- CtuluLog validateLit = uiController.validateLit();
- if (validateLit.isNotEmpty()) {
- LogsDisplayer.displayError(validateLit, "Test");
- }
- }
- });
- pn.add(btValid,BorderLayout.WEST);
+ JPanel pnTable = new JPanel(new BorderLayout());
+ pnTable.add(uiController.getTableGraphePanel());
+ pnTable.add(uiController.getLabelValidating(), BorderLayout.SOUTH);
+ pn.add(pnTable, BorderLayout.EAST);
uiController.setEditable(true);
display(pn);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-08-23 15:33:51
|
Revision: 7577
http://fudaa.svn.sourceforge.net/fudaa/?rev=7577&view=rev
Author: deniger
Date: 2012-08-23 15:33:40 +0000 (Thu, 23 Aug 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/common/ConnexionInformationDefault.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/etude/ManagerEMHContainerBase.java
trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/services/EMHProjetServiceImpl.java
Added Paths:
-----------
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/common/ConnexionInformationFixed.java
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/common/ConnexionInformationDefault.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/common/ConnexionInformationDefault.java 2012-08-23 14:41:41 UTC (rev 7576)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/common/ConnexionInformationDefault.java 2012-08-23 15:33:40 UTC (rev 7577)
@@ -8,12 +8,16 @@
*/
public class ConnexionInformationDefault implements ConnexionInformation {
- private final static ConnexionInformation INSTANCE = new ConnexionInformationDefault();
+ private final static ConnexionInformation INSTANCE = new ConnexionInformationDefault();
public final static ConnexionInformation getDefault() {
return INSTANCE;
}
+ public final static ConnexionInformationFixed getFixed() {
+ return new ConnexionInformationFixed(INSTANCE);
+ }
+
@Override
public LocalDateTime getCurrentDate() {
return new LocalDateTime();
Added: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/common/ConnexionInformationFixed.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/common/ConnexionInformationFixed.java (rev 0)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/common/ConnexionInformationFixed.java 2012-08-23 15:33:40 UTC (rev 7577)
@@ -0,0 +1,31 @@
+/*
+ GPL 2
+ */
+package org.fudaa.dodico.crue.common;
+
+import org.joda.time.LocalDateTime;
+
+/**
+ *
+ * @author Frederic Deniger
+ */
+public class ConnexionInformationFixed implements ConnexionInformation {
+
+ LocalDateTime currentDate;
+ String user;
+
+ public ConnexionInformationFixed(ConnexionInformation from) {
+ currentDate = from.getCurrentDate();
+ user = from.getCurrentUser();
+ }
+
+ @Override
+ public LocalDateTime getCurrentDate() {
+ return currentDate;
+ }
+
+ @Override
+ public String getCurrentUser() {
+ return user;
+ }
+}
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/etude/ManagerEMHContainerBase.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/etude/ManagerEMHContainerBase.java 2012-08-23 14:41:41 UTC (rev 7576)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/etude/ManagerEMHContainerBase.java 2012-08-23 15:33:40 UTC (rev 7577)
@@ -22,13 +22,13 @@
private EMHInfosVersion infosVersions;
private boolean isActive = true;
/**
- * Liste des fichiers rattaches au scenario . Ces fichiers proviennent de la classe EMHProjetInfos qui contient la
- * base des fichiers du projet. Ces fichiers sont uniquement des fichiers resultat ?
+ * Liste des fichiers rattaches au scenario . Ces fichiers proviennent de la classe EMHProjetInfos qui contient la base des fichiers du projet. Ces
+ * fichiers sont uniquement des fichiers resultat ?
*/
private FichierCrueManager listeFichiers;
private String nom;
private final CrueLevelType level;
-
+
protected ManagerEMHContainerBase(CrueLevelType level) {
this(level, null);
}
@@ -38,19 +38,18 @@
this.nom = nom;
this.level = level;
}
-
-
- public boolean isCrue9(){
+
+ public boolean isCrue9() {
return CrueVersionType.CRUE9.equals(getInfosVersions().getCrueVersion());
}
-
- public boolean isCrue10(){
+
+ public boolean isCrue10() {
return CrueVersionType.CRUE10.equals(getInfosVersions().getCrueVersion());
}
/**
* Ajoute un fichier .
- *
+ *
* @param fichier
* @return
*/
@@ -71,12 +70,11 @@
public CrueLevelType getLevel() {
return this.level;
}
-
+
public EMHInfosVersion getInfosVersions() {
return infosVersions;
}
-
/**
* @return le manager des fichiers
*/
@@ -84,6 +82,13 @@
return listeFichiers;
}
+ public List<FichierCrue> getFichiers() {
+ if (listeFichiers == null) {
+ return null;
+ }
+ return listeFichiers.getFichiers();
+ }
+
@Override
public final String getNom() {
return nom;
@@ -95,21 +100,19 @@
public boolean isActive() {
return isActive;
}
-
+
// /**
// * @return the isActive
// */
// public boolean isActive() {
// return isActive;
// }
-
/**
* @param isActive the isActive to set
*/
public void setActive(boolean isActive) {
this.isActive = isActive;
}
-
// /**
// * Utilise pour l'ui...
@@ -119,7 +122,6 @@
// public void setActive(Boolean isActive) {
// this.isActive = isActive == null ? false : isActive.booleanValue();
// }
-
public void setInfosVersions(final EMHInfosVersion infosVersions) {
this.infosVersions = infosVersions;
}
Modified: trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/services/EMHProjetServiceImpl.java
===================================================================
--- trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/services/EMHProjetServiceImpl.java 2012-08-23 14:41:41 UTC (rev 7576)
+++ trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/services/EMHProjetServiceImpl.java 2012-08-23 15:33:40 UTC (rev 7577)
@@ -6,6 +6,7 @@
import org.fudaa.fudaa.crue.common.services.EMHProjetService;
import java.io.File;
import java.io.IOException;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
@@ -13,6 +14,7 @@
import java.util.logging.Logger;
import org.fudaa.ctulu.CtuluLogGroup;
import org.fudaa.dodico.crue.common.BusinessMessages;
+import org.fudaa.dodico.crue.common.ConnexionInformationFixed;
import org.fudaa.dodico.crue.common.CrueOperationResult;
import org.fudaa.dodico.crue.config.CrueConfigMetier;
import org.fudaa.dodico.crue.io.Crue10FileFormatFactory;
@@ -21,7 +23,11 @@
import org.fudaa.dodico.crue.io.common.FileLocker.Data;
import org.fudaa.dodico.crue.metier.etude.EMHProjet;
import org.fudaa.dodico.crue.metier.etude.EMHRun;
+import org.fudaa.dodico.crue.metier.etude.FichierCrue;
+import org.fudaa.dodico.crue.metier.etude.FichierCrueManager;
+import org.fudaa.dodico.crue.metier.etude.ManagerEMHModeleBase;
import org.fudaa.dodico.crue.metier.etude.ManagerEMHScenario;
+import org.fudaa.dodico.crue.metier.etude.ManagerEMHSousModele;
import org.fudaa.dodico.crue.projet.EMHProjetController;
import org.fudaa.dodico.crue.projet.calcul.ExecInputDefault;
import org.fudaa.dodico.crue.projet.create.RunCalculOption;
@@ -110,8 +116,7 @@
}
/**
- * Utilise pour une modification qui demande un rechargement de l'etude. Apres appel a call.call une sauvegarde est
- * effectuée.
+ * Utilise pour une modification qui demande un rechargement de l'etude. Apres appel a call.call une sauvegarde est effectuée.
*
* @param call action sur EMHProjet.
* @param logString
@@ -381,11 +386,58 @@
launchRun(scenario, null);
}
- public void scenarioSaved(ManagerEMHScenario managerScenarioLoaded,Set<String> modifiedFiles) {
- managerScenarioLoaded.getInfosVersions().updateForm(installationService.getConnexionInformation());
+ public void scenarioSaved(ManagerEMHScenario managerScenarioLoaded, Set<String> modifiedFiles) {
+ ConnexionInformationFixed connexionInfo = new ConnexionInformationFixed(installationService.getConnexionInformation());
+ updateModifiedState(managerScenarioLoaded, connexionInfo, modifiedFiles);
+ List<ManagerEMHScenario> listeScenarios = getSelectedProject().getListeScenarios();
+ for (ManagerEMHScenario managerEMHScenario : listeScenarios) {
+ updateModifiedState(managerEMHScenario, connexionInfo, modifiedFiles);
+ }
quickSave();
}
+ protected void updateModifiedState(ManagerEMHScenario scenario, ConnexionInformationFixed info, Set<String> modifiedFiles) {
+ if (isModified(modifiedFiles, scenario.getListeFichiers())) {
+ scenario.getInfosVersions().updateForm(info);
+ }
+ List<ManagerEMHModeleBase> modeles = scenario.getFils();
+ for (ManagerEMHModeleBase modele : modeles) {
+ boolean modified = updateModifiedState(modele, info, modifiedFiles);
+ if (modified) {
+ scenario.getInfosVersions().updateForm(info);
+ }
+ }
+ }
+
+ protected boolean isModified(Set<String> modifiedFiles, FichierCrueManager fichiers) {
+ if (fichiers == null) {
+ return false;
+ }
+ for (FichierCrue fichierCrue : fichiers.getFichiers()) {
+ if (modifiedFiles.contains(fichierCrue.getId())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected boolean updateModifiedState(ManagerEMHModeleBase modele, ConnexionInformationFixed info, Set<String> modifiedFiles) {
+ boolean res = isModified(modifiedFiles, modele.getListeFichiers());
+ List<ManagerEMHSousModele> sousModeles = modele.getFils();
+ for (ManagerEMHSousModele sousModele : sousModeles) {
+ boolean sousModeleModified = isModified(modifiedFiles, sousModele.getListeFichiers());
+ if (sousModeleModified) {
+ res = true;
+ sousModele.getInfosVersions().updateForm(info);
+ }
+ }
+ if (res) {
+ modele.getInfosVersions().updateForm(info);
+ }
+ return res;
+
+ }
+
boolean isProjetReadOnly() {
return readOnly;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-08-28 21:42:46
|
Revision: 7586
http://fudaa.svn.sourceforge.net/fudaa/?rev=7586&view=rev
Author: deniger
Date: 2012-08-28 21:42:39 +0000 (Tue, 28 Aug 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeStepSliderPanel.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeStepTopPanel.java
trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/icons/fullExtent.png
trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/icons/last.png
trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/icons/shrink.png
trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/actions/RunOptionPanelBuilder.java
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/ToStringTransfomerCellRenderer.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeReduceRangePanel.java
trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/time/
trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/time/Bundle.properties
Removed Paths:
-------------
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/ToStringTransfomerRunCellRenderer.java
Copied: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/ToStringTransfomerCellRenderer.java (from rev 7523, trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/ToStringTransfomerRunCellRenderer.java)
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/ToStringTransfomerCellRenderer.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/ToStringTransfomerCellRenderer.java 2012-08-28 21:42:39 UTC (rev 7586)
@@ -0,0 +1,20 @@
+package org.fudaa.fudaa.crue.common.helper;
+
+import javax.swing.ListCellRenderer;
+import org.fudaa.ctulu.gui.CtuluCellTextRenderer;
+import org.fudaa.dodico.crue.metier.transformer.ToStringTransformer;
+
+@SuppressWarnings("serial")
+public class ToStringTransfomerCellRenderer extends CtuluCellTextRenderer implements ListCellRenderer{
+
+ private final ToStringTransformer transfomer;
+
+ public ToStringTransfomerCellRenderer(ToStringTransformer transfomer) {
+ this.transfomer = transfomer;
+ }
+
+ @Override
+ protected void setValue(Object value) {
+ super.setValue(transfomer.transform(value));
+ }
+}
Deleted: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/ToStringTransfomerRunCellRenderer.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/ToStringTransfomerRunCellRenderer.java 2012-08-28 15:48:48 UTC (rev 7585)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/ToStringTransfomerRunCellRenderer.java 2012-08-28 21:42:39 UTC (rev 7586)
@@ -1,20 +0,0 @@
-package org.fudaa.fudaa.crue.common.helper;
-
-import javax.swing.ListCellRenderer;
-import org.fudaa.ctulu.gui.CtuluCellTextRenderer;
-import org.fudaa.dodico.crue.metier.transformer.ToStringTransformer;
-
-@SuppressWarnings("serial")
-public class ToStringTransfomerRunCellRenderer extends CtuluCellTextRenderer implements ListCellRenderer{
-
- private final ToStringTransformer transfomer;
-
- public ToStringTransfomerRunCellRenderer(ToStringTransformer transfomer) {
- this.transfomer = transfomer;
- }
-
- @Override
- protected void setValue(Object value) {
- super.setValue(transfomer.transform(value));
- }
-}
Added: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeReduceRangePanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeReduceRangePanel.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeReduceRangePanel.java 2012-08-28 21:42:39 UTC (rev 7586)
@@ -0,0 +1,138 @@
+/*
+ GPL 2
+ */
+package org.fudaa.fudaa.crue.report.time;
+
+import com.jidesoft.swing.RangeSlider;
+import com.memoire.bu.BuGridLayout;
+import com.memoire.bu.BuLib;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.List;
+import javax.swing.BorderFactory;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import org.apache.commons.lang.math.IntRange;
+import org.fudaa.dodico.crue.metier.transformer.ToStringTransformer;
+import org.fudaa.fudaa.crue.common.helper.ComboBoxHelper;
+import org.fudaa.fudaa.crue.common.helper.ToStringTransfomerCellRenderer;
+
+/**
+ *
+ * @author Frederic Deniger
+ */
+public class ReportTimeReduceRangePanel {
+
+ RangeSlider rangeSlider;
+ private final List values;
+ private final ToStringTransformer toStringTransformer;
+ IntRange range;
+ JComboBox cbMin;
+ JComboBox cbMax;
+
+ public ReportTimeReduceRangePanel(List values, ToStringTransformer toStringTransformer, IntRange initRange) {
+ this.values = values;
+ this.toStringTransformer = toStringTransformer;
+ this.range = initRange;
+ if (range == null) {
+ if (values.isEmpty()) {
+ range = new IntRange(0, 0);
+ } else {
+ range = new IntRange(0, values.size() - 1);
+ }
+ }
+ }
+ JPanel panel;
+
+ public JPanel getPanel() {
+ if (panel == null) {
+ createPanel();
+ }
+ return panel;
+ }
+
+ private JPanel createMinMaxLabels() {
+ JLabel lbMin = new JLabel();
+ lbMin.setFont(BuLib.deriveFont(lbMin.getFont(), -1));
+
+ JLabel lbMax = new JLabel();
+ lbMax.setFont(BuLib.deriveFont(lbMax.getFont(), -1));
+ JPanel pnMinMax = new JPanel(new BorderLayout());
+ pnMinMax.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 3));
+ pnMinMax.add(lbMin, BorderLayout.WEST);
+ pnMinMax.add(lbMax, BorderLayout.EAST);
+ if (!values.isEmpty()) {
+ lbMin.setText(toStringTransformer.transform(values.get(0)));
+ lbMin.setToolTipText(lbMin.getText());
+ lbMax.setText(toStringTransformer.transform(values.get(values.size() - 1)));
+ lbMax.setToolTipText(lbMax.getText());
+ }
+ return pnMinMax;
+ }
+
+ void createPanel() {
+ panel = new JPanel(new BuGridLayout(1, 2, 2, true, false));
+ if (values.isEmpty()) {
+ return;
+ }
+ panel.add(createComboxesPanel());
+ rangeSlider = new RangeSlider(0, values.size() - 1, range.getMinimumInteger(), range.getMaximumInteger());
+ JPanel pnSlider = new JPanel(new BuGridLayout(1, 2, 2, true, false));
+ pnSlider.add(rangeSlider);
+ rangeSlider.addChangeListener(new ChangeListener() {
+ @Override
+ public void stateChanged(ChangeEvent e) {
+ int min = rangeSlider.getLowValue();
+ final int max = rangeSlider.getHighValue();
+ cbMin.setSelectedIndex(min);
+ cbMax.setSelectedIndex(max);
+ }
+ });
+ JPanel pnMinMax = createMinMaxLabels();
+ pnSlider.add(pnMinMax, BorderLayout.SOUTH);
+ panel.add(pnSlider);
+
+ }
+
+ private JPanel createComboxesPanel() {
+ final ToStringTransfomerCellRenderer cellRenderer = new ToStringTransfomerCellRenderer(toStringTransformer);
+ cbMin = new JComboBox();
+ ComboBoxHelper.setDefaultModel(cbMin, values);
+ cbMin.setSelectedIndex(range.getMinimumInteger());
+ cbMin.setRenderer(cellRenderer);
+ cbMax = new JComboBox();
+ ComboBoxHelper.setDefaultModel(cbMax, values);
+ cbMax.setSelectedIndex(range.getMaximumInteger());
+ cbMax.setRenderer(cellRenderer);
+ JPanel cbPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
+ cbPanel.add(new JLabel(org.openide.util.NbBundle.getMessage(ReportTimeReduceRangePanel.class, "MinRange.Label")));
+ cbPanel.add(cbMin);
+ cbPanel.add(new JLabel(org.openide.util.NbBundle.getMessage(ReportTimeReduceRangePanel.class, "MaxRange.Label")));
+ cbPanel.add(cbMax);
+ cbMax.addItemListener(new ItemListener() {
+ @Override
+ public void itemStateChanged(ItemEvent e) {
+ rangeSlider.setHighValue(cbMax.getSelectedIndex());
+ }
+ });
+ cbMin.addItemListener(new ItemListener() {
+ @Override
+ public void itemStateChanged(ItemEvent e) {
+ rangeSlider.setLowValue(cbMin.getSelectedIndex());
+ }
+ });
+ return cbPanel;
+
+ }
+
+ IntRange getRange() {
+ int min = rangeSlider.getLowValue();
+ int max = rangeSlider.getHighValue();
+ return new IntRange(min, max);
+ }
+}
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeStepSliderPanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeStepSliderPanel.java 2012-08-28 15:48:48 UTC (rev 7585)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeStepSliderPanel.java 2012-08-28 21:42:39 UTC (rev 7586)
@@ -14,6 +14,7 @@
import java.util.List;
import java.util.Observable;
import javax.swing.AbstractButton;
+import javax.swing.BorderFactory;
import javax.swing.DefaultBoundedRangeModel;
import javax.swing.JButton;
import javax.swing.JLabel;
@@ -33,7 +34,7 @@
* @author Frederic Deniger
*/
public class ReportTimeStepSliderPanel extends Observable {
-
+
JSlider slider;
List values = Collections.emptyList();
JPanel panel;
@@ -45,21 +46,21 @@
JButton btPrevious;
JToggleButton btPlay;
ToStringTransformer toStringTransformer = ToStringTransformerDefault.TO_STRING;
-
+
JPanel getPanel() {
if (panel == null) {
buildPanel();
}
return panel;
}
-
+
public void setToStringTransformer(ToStringTransformer toStringTransformer) {
this.toStringTransformer = toStringTransformer;
updateLabels();
}
-
+
private void buildPanel() {
- panel = new JPanel(new BorderLayout(1, 1));
+ panel = new JPanel(new BorderLayout(2, 0));
slider = new JSlider(0, values.size());
slider.addChangeListener(new ChangeListener() {
@Override
@@ -70,41 +71,42 @@
slider.setPaintTicks(true);
slider.setPaintLabels(false);
JPanel pnMinMax = createMinMaxLabels();
- JPanel pnSlider = new JPanel(new BuGridLayout(1, 2, 2, true, false));
+ JPanel pnSlider = new JPanel(new BuGridLayout(1, 2, 0, true, false));
+ pnSlider.setBorder(BorderFactory.createEmptyBorder(3, 0, 0, 0));
pnSlider.add(slider);
- pnSlider.add(pnMinMax, BorderLayout.SOUTH);
+ pnSlider.add(pnMinMax);
panel.add(pnSlider);
panel.add(createFirst(), BorderLayout.WEST);
panel.add(createLast(), BorderLayout.EAST);
updateComponents();
}
-
+
protected static JButton create(String iconName) {
JButton bt = new JButton();
bt.setMargin(BuInsets.INSETS1111);
setIcon(bt, iconName);
return bt;
}
-
+
private JToggleButton createToggle(String iconName) {
JToggleButton bt = new JToggleButton();
bt.setMargin(BuInsets.INSETS1111);
setIcon(bt, iconName);
return bt;
}
-
+
protected void previous() {
setValue(slider.getValue() - 1);
}
-
+
protected void setValue(int idx) {
if (idx >= 0 && idx < values.size()) {
slider.setValue(idx);
}
-
+
}
Timer playTimer;
-
+
private void createTimer() {
playTimer = new Timer(0, new ActionListener() {
@Override
@@ -113,7 +115,7 @@
}
});
}
-
+
protected void playNext() {
boolean ok = next();
if (!ok) {
@@ -122,12 +124,9 @@
}
}
protected int playDelay = 1000;
-
+
protected void play() {
- if (playTimer != null) {
- playTimer.stop();
- playTimer = null;
- }
+ stopPlay();
if (btPlay.isSelected()) {
createTimer();
playTimer.setRepeats(true);
@@ -135,11 +134,11 @@
playTimer.start();
}
}
-
+
protected void first() {
setValue(0);
}
-
+
protected boolean next() {
if (isNextAvailable()) {
setValue(slider.getValue() + 1);
@@ -147,19 +146,31 @@
}
return false;
}
-
+
protected void last() {
setValue(values.size() - 1);
}
-
- public void setValues(List values) {
+
+ public void setValues(List values, boolean reselectLastSelection) {
+ stopPlay();
+ updating = true;
+ Object current = getSelectedItem();
this.values = new ArrayList(values);
if (panel != null) {
updateComponents();
}
+ if (!values.isEmpty()) {
+ int idx = 0;
+ if (current != null) {
+ idx = values.indexOf(current);
+ }
+ slider.setValue(idx);
+ }
+ updating = false;
+ sliderChanged();
}
boolean updating;
-
+
protected void sliderChanged() {
if (updating) {
return;
@@ -168,18 +179,18 @@
notifyObservers(getSelectedItem());
updateButtonState();
}
-
+
public int getSelectedValue() {
return slider.getValue();
}
-
+
public Object getSelectedItem() {
if (values.isEmpty()) {
return null;
}
return values.get(slider.getValue());
}
-
+
protected void updateButtonState() {
int value = slider.getValue();
btFirst.setEnabled(value > 0);
@@ -189,39 +200,37 @@
btLast.setEnabled(enable);
btPlay.setEnabled(enable);
}
-
+
protected boolean isNextAvailable() {
int value = slider.getValue();
return value < values.size() - 1;
-
+
}
-
+
protected Object getMinObject() {
return values.isEmpty() ? null : values.get(0);
}
-
+
protected Object getMaxObject() {
return values.isEmpty() ? null : values.get(values.size() - 1);
}
-
+
protected String toString(Object o) {
if (o == null) {
return StringUtils.EMPTY;
}
return toStringTransformer.transform(o);
}
-
+
private void updateComponents() {
- updating = true;
slider.setModel(new DefaultBoundedRangeModel(0, 0, 0, Math.max(0, values.size() - 1)));
- updating = false;
updateLabels();
updateButtonState();
-
+
}
-
+
private JPanel createFirst() {
- JPanel pnFirst = new JPanel(new BuGridLayout(1, 2, 2, false, false));
+ JPanel pnFirst = new JPanel(new BuGridLayout(1, 1, 2, false, false, false, false));
btPrevious = create("previous.png");
btPrevious.addActionListener(new ActionListener() {
@Override
@@ -240,7 +249,7 @@
pnFirst.add(btFirst);
return pnFirst;
}
-
+
private JPanel createLast() {
JPanel pnLast = new JPanel(new BuGridLayout(2, 2, 2, false, false));
btNext = create("next.png");
@@ -269,26 +278,34 @@
pnLast.add(btLast);
return pnLast;
}
-
+
private JPanel createMinMaxLabels() {
lbMin = new JLabel();
lbMin.setFont(BuLib.deriveFont(lbMin.getFont(), -1));
lbMax = new JLabel();
lbMax.setFont(BuLib.deriveFont(lbMax.getFont(), -1));
JPanel pnMinMax = new JPanel(new BorderLayout());
+ pnMinMax.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 3));
pnMinMax.add(lbMin, BorderLayout.WEST);
pnMinMax.add(lbMax, BorderLayout.EAST);
return pnMinMax;
}
-
+
protected static void setIcon(AbstractButton bt, String iconName) {
bt.setIcon(ImageUtilities.loadImageIcon("org/fudaa/fudaa/crue/report/icons/" + iconName, false));
}
-
+
private void updateLabels() {
lbMax.setText(toString(getMaxObject()));
lbMax.setToolTipText(lbMax.getToolTipText());
lbMin.setText(toString(getMinObject()));
lbMin.setToolTipText(lbMin.getToolTipText());
}
+
+ private void stopPlay() {
+ if (playTimer != null) {
+ playTimer.stop();
+ playTimer = null;
+ }
+ }
}
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeStepTopPanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeStepTopPanel.java 2012-08-28 15:48:48 UTC (rev 7585)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/time/ReportTimeStepTopPanel.java 2012-08-28 21:42:39 UTC (rev 7586)
@@ -7,6 +7,7 @@
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Observable;
@@ -14,9 +15,13 @@
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
+import javax.swing.SwingConstants;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.math.IntRange;
import org.fudaa.dodico.crue.metier.transformer.ToStringTransformer;
import org.fudaa.dodico.crue.metier.transformer.ToStringTransformerDefault;
+import org.fudaa.fudaa.crue.common.helper.DialogHelper;
+import org.openide.util.NbBundle;
/**
*
@@ -42,7 +47,7 @@
}
return panel;
}
- boolean reduced;
+ IntRange reducedRange;
@Override
public void update(Observable o, Object arg) {
@@ -53,6 +58,8 @@
panel = new JPanel(new BorderLayout());
mainLabel = new JLabel();
+ mainLabel.setHorizontalTextPosition(SwingConstants.CENTER);
+ mainLabel.setHorizontalAlignment(SwingConstants.CENTER);
btFullExtent = ReportTimeStepSliderPanel.create("fullExtent.png");
btFullExtent.addActionListener(new ActionListener() {
@@ -61,8 +68,10 @@
fullExtent();
}
});
+ btFullExtent.setToolTipText(NbBundle.getMessage(ReportTimeStepTopPanel.class, "FullTimeExtent.Tooltip"));
btReduceTime = ReportTimeStepSliderPanel.create("shrink.png");
- btFullExtent.addActionListener(new ActionListener() {
+ btReduceTime.setToolTipText(NbBundle.getMessage(ReportTimeStepTopPanel.class, "ReduceTimeExtent.Tooltip"));
+ btReduceTime.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
shrink();
@@ -81,10 +90,23 @@
}
protected void fullExtent() {
+ slider.setValues(values, true);
+ reducedRange = null;
+ updateButtons();
}
protected void shrink() {
-
+ ReportTimeReduceRangePanel reducePanel = new ReportTimeReduceRangePanel(values, toStringTransformer, reducedRange);
+ boolean ok = DialogHelper.showQuestionOkCancel(NbBundle.getMessage(ReportTimeStepTopPanel.class, "ReduceTime.DialogTitle"), reducePanel.getPanel());
+ if (ok) {
+ reducedRange = reducePanel.getRange();
+ List reduceValue = new ArrayList();
+ for (int i = reducedRange.getMinimumInteger(); i <= reducedRange.getMaximumInteger(); i++) {
+ reduceValue.add(values.get(i));
+ }
+ slider.setValues(reduceValue, true);
+ updateButtons();
+ }
}
protected String toString(Object o) {
@@ -104,13 +126,14 @@
}
protected void updateButtons() {
- btFullExtent.setEnabled(reduced);
+ btFullExtent.setEnabled(reducedRange != null);
btReduceTime.setEnabled(!values.isEmpty());
}
public void setValues(List values) {
- reduced = false;
+ reducedRange = null;
this.values = values;
- slider.setValues(values);
+ slider.setValues(values, false);
+ updateButtons();
}
}
Modified: trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/icons/fullExtent.png
===================================================================
(Binary files differ)
Modified: trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/icons/last.png
===================================================================
(Binary files differ)
Modified: trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/icons/shrink.png
===================================================================
(Binary files differ)
Copied: trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/time/Bundle.properties (from rev 7585, trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/Bundle.properties)
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/time/Bundle.properties (rev 0)
+++ trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/time/Bundle.properties 2012-08-28 21:42:39 UTC (rev 7586)
@@ -0,0 +1,5 @@
+MinRange.Label=Min:
+MaxRange.Label=Max:
+ReduceTime.DialogTitle=R\u00e9duction intervalle de temps
+ReduceTimeExtent.Tooltip=R\u00e9duire l'intervalle de temps
+FullTimeExtent.Tooltip=Utiliser tout l'intervalle de temps
Modified: trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/actions/RunOptionPanelBuilder.java
===================================================================
--- trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/actions/RunOptionPanelBuilder.java 2012-08-28 15:48:48 UTC (rev 7585)
+++ trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/actions/RunOptionPanelBuilder.java 2012-08-28 21:42:39 UTC (rev 7586)
@@ -18,7 +18,7 @@
import org.fudaa.dodico.crue.metier.transformer.ToStringTransformer;
import org.fudaa.dodico.crue.projet.create.RunCalculOption;
import org.fudaa.dodico.crue.projet.create.RunCreatorOptions;
-import org.fudaa.fudaa.crue.common.helper.ToStringTransfomerRunCellRenderer;
+import org.fudaa.fudaa.crue.common.helper.ToStringTransfomerCellRenderer;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.util.NbBundle;
@@ -77,7 +77,7 @@
OptionToStringTransformer toString = new OptionToStringTransformer();
for (CrueFileType crueFileType : runFileType) {
JComboBox cb = new JComboBox(runOptions);
- cb.setRenderer(new ToStringTransfomerRunCellRenderer(toString));
+ cb.setRenderer(new ToStringTransfomerCellRenderer(toString));
cb.setSelectedItem(defaultOptions.get(crueFileType));
options.put(crueFileType, cb);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-08-31 09:13:40
|
Revision: 7598
http://fudaa.svn.sourceforge.net/fudaa/?rev=7598&view=rev
Author: deniger
Date: 2012-08-31 09:13:28 +0000 (Fri, 31 Aug 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/config/OrdResDynamicPropertyFilter.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/io/ores/CrueConverterORES_V1P1P1.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/IdRegistry.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdRes.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/result/ModeleResultatTimeContent.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/result/OrdResExtractor.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/validation/ValidationHelper.java
trunk/soft/fudaa-crue/crue-server/src/test/java/org/fudaa/dodico/crue/validation/TestValidatorORES.java
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/services/PerspectiveState.java
trunk/soft/fudaa-crue/ui-comparison/src/main/java/org/fudaa/fudaa/crue/comparison/ScenarioComparaisonController.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/OrdResScenarioNode.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/data/ReportRunContent.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/data/ReportVariableKey.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/export/ReportExportHelper.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/perspective/PerspectiveServiceReport.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportRunAlternatifService.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportService.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportTimeFormatter.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/transversal/ReportTransversalGrapheBuilder.java
trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/export/Bundle.properties
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportResultProviderService.java
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/config/OrdResDynamicPropertyFilter.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/config/OrdResDynamicPropertyFilter.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/config/OrdResDynamicPropertyFilter.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -1,5 +1,6 @@
package org.fudaa.dodico.crue.comparaison.config;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -43,7 +44,7 @@
String method = "ordRes" + normalizeEMHType(emhType);
try {
OrdRes ordRes = (OrdRes) PropertyUtilsCache.getInstance().getProperty(ordResScenario, method);
- Set<Dde> ddes = ordRes.getDdes();
+ Collection<Dde> ddes = ordRes.getDdes();
return TransformerHelper.toSetOfId(ddes);
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "getOrdresProps " + normalizeEMHType(emhType), e);
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/io/ores/CrueConverterORES_V1P1P1.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/io/ores/CrueConverterORES_V1P1P1.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/io/ores/CrueConverterORES_V1P1P1.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -5,6 +5,7 @@
import java.beans.PropertyDescriptor;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -205,7 +206,6 @@
}
public void convertMetierToDao(OrdRes in, Object daoToFill, CtuluLog log) {
- String simpleName = daoToFill.getClass().getSimpleName();
final PropertyDescriptor[] propertyDescriptors = PropertyUtils.getPropertyDescriptors(daoToFill);
Set<String> ddeProperties = new HashSet<String>();
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
@@ -214,7 +214,7 @@
ddeProperties.add(name);
}
}
- Set<Dde> ddes = in.getDdes();
+ Collection<Dde> ddes = in.getDdes();
for (Dde dde : ddes) {
String nom = dde.getNom();
String ddeNom = CrueDaoStructureORES_V1P1P1.PREFIX_PROPERTY_DDE + StringUtils.capitalize(nom);
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/IdRegistry.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/IdRegistry.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/IdRegistry.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -5,6 +5,7 @@
import java.util.List;
import java.util.Map;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
+import org.fudaa.dodico.crue.metier.transformer.TransformerHelper;
/**
*
@@ -56,4 +57,8 @@
Collection<EMH> values = emhByUid.values();
return EMHHelper.selectEMHS(values, emhCat);
}
+
+ public Map<String, EMH> getEmhByNom() {
+ return TransformerHelper.toMapOfNom(emhByUid.values());
+ }
}
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdRes.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdRes.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/OrdRes.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -1,8 +1,9 @@
package org.fudaa.dodico.crue.metier.emh;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
-import java.util.Set;
+import java.util.List;
import java.util.TreeMap;
import org.fudaa.dodico.crue.config.CrueConfigMetier;
import org.fudaa.dodico.crue.metier.OrdResKey;
@@ -54,8 +55,8 @@
}
@Visibility(ihm = false)
- public Set<Dde> getDdes() {
- return new HashSet<Dde>(values.values());
+ public List<Dde> getDdes() {
+ return new ArrayList<Dde>(values.values());
}
@Override
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/result/ModeleResultatTimeContent.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/result/ModeleResultatTimeContent.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/result/ModeleResultatTimeContent.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -81,6 +81,18 @@
return tempSceByCalc.get(key.getNomCalcul()) + key.getDuree();
}
+ public long getTempsCalc(ResultatKey key) {
+ return key.getDuree();
+ }
+
+ public double getTempsCalcInSec(ResultatKey key) {
+ return key.getDuree() / 1000d;
+ }
+
+ public double getTempSceInSec(ResultatKey key) {
+ return getTempSce(key) / 1000d;
+ }
+
public static ModeleResultatTimeContent extract(EMHModeleBase modele) {
ResultatPasDeTemps pasDeTemps = modele.getResultatCalculPasDeTemps();
if (pasDeTemps == null) {
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/result/OrdResExtractor.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/result/OrdResExtractor.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/result/OrdResExtractor.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -38,11 +38,11 @@
return res;
}
- public List<OrdResVariableSelection> getOrdResSelectedVarForEMH(Collection<EMH> selectedEMHs) {
+ public List<OrdResVariableSelection> getOrdResSelectedVarForEMH(Collection<EMH> selectedEMHs) {
return getOrdResSelectedVar(getFilteredOrdRes(selectedEMHs));
}
- public List<OrdResVariableSelection> getOrdResSelectedVarForEMHorAll(Collection<EMH> selectedEMHs) {
+ public List<OrdResVariableSelection> getOrdResSelectedVarForEMHorAll(Collection<EMH> selectedEMHs) {
if (CollectionUtils.isEmpty(selectedEMHs)) {
return getOrdResSelectedVarForAll();
}
@@ -55,15 +55,15 @@
List<OrdResVariableSelection> getOrdResSelectedVar(Collection<OrdRes> ordResList) {
ArrayList<OrdResVariableSelection> res = new ArrayList<OrdResVariableSelection>();
- for (OrdRes ordRes : ordResList) {
+ for (OrdRes ordResItem : ordResList) {
List<String> usableVariables = new ArrayList<String>();
- Set<Dde> ddes = ordRes.getDdes();
+ List<Dde> ddes = ordResItem.getDdes();
for (Dde dde : ddes) {
if (dde.getValeur()) {
usableVariables.add(dde.getNom());
}
}
- res.add(new OrdResVariableSelection(ordRes.getKey(), usableVariables));
+ res.add(new OrdResVariableSelection(ordResItem.getKey(), usableVariables));
}
return res;
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/validation/ValidationHelper.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/validation/ValidationHelper.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/validation/ValidationHelper.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -305,26 +305,20 @@
final List<EMH> listeEMHs = crueData.getAllSimpleEMH();
final CtuluLog analyze = new CtuluLog(BusinessMessages.RESOURCE_BUNDLE);
- UniqueNomFinder uniqueNomFinder = new UniqueNomFinder();
+
for (final EMH emh : listeEMHs) {
+ String old = emh.getNom();
ValidationHelper.computeNom(emh, ValidationHelper.getPrefixFor(emh), analyze, "crue9.cant.rename.emh", null);
+ String newName = emh.getNom();
+ if (!old.equals(newName)) {
+ ensureUniqueName(listeEMHs, emh);
+ }
+
}
- //on s'assure de l'unicité des noms
- EditionRename rename = new EditionRename();
+ //on s'assure de l'unicité des noms pour tous
for (final EMH emh : listeEMHs) {
- List<String> noms = TransformerHelper.toNom(listeEMHs);
- final String oldName = emh.getNom();
- noms.remove(oldName);
- String newName = uniqueNomFinder.findUniqueName(noms, oldName);
- if (!oldName.equals(newName)) {
- emh.setNom(newName);
- }
- //pour toutes les emhs, on met à jours les noms.
- //pour les casiers, ce sont les noeuds qui prendront le dessus:
- if (!emh.getCatType().equals(EnumCatEMH.CASIER)) {
- rename.propagateName(emh);
- }
+ ensureUniqueName(listeEMHs, emh);
}
final DonFrtConteneur frottements = crueData.getFrottements();
@@ -333,17 +327,16 @@
for (final DonFrt donFrt : listFrt) {
final LoiFF loi = donFrt.getLoi();
final String pref = loi.getType().getNom() + CruePrefix.SEP;
+ String oldName = donFrt.getNom();
ValidationHelper.computeNom(donFrt, pref, analyze, "crue9.cant.rename.frt", null);
+ String newName = donFrt.getNom();
+ if (!oldName.equals(newName)) {
+ ensureUniqueNameDonFrt(listFrt, donFrt);
+ }
}
//on evite les doublons:
for (final DonFrt donFrt : listFrt) {
- List<String> noms = TransformerHelper.toNom(listFrt);
- final String oldName = donFrt.getNom();
- noms.remove(oldName);
- String newName = uniqueNomFinder.findUniqueName(noms, oldName);
- if (!oldName.equals(newName)) {
- donFrt.setNom(newName);
- }
+ ensureUniqueNameDonFrt(listFrt, donFrt);
}
}
@@ -466,4 +459,32 @@
validateObject(StringUtils.EMPTY, res, editedObject, ccm);
return res;
}
+
+ public static void ensureUniqueName(final List<EMH> listeEMHs, final EMH emh) {
+ UniqueNomFinder uniqueNomFinder = new UniqueNomFinder();
+ EditionRename rename = new EditionRename();
+ List<String> noms = TransformerHelper.toNom(listeEMHs);
+ final String oldName = emh.getNom();
+ noms.remove(oldName);
+ String newName = uniqueNomFinder.findUniqueName(noms, oldName);
+ if (!oldName.equals(newName)) {
+ emh.setNom(newName);
+ }
+ //pour toutes les emhs, on met à jours les noms.
+ //pour les casiers, ce sont les noeuds qui prendront le dessus:
+ if (!emh.getCatType().equals(EnumCatEMH.CASIER)) {
+ rename.propagateName(emh);
+ }
+ }
+
+ public static void ensureUniqueNameDonFrt(final List<DonFrt> listFrt, final DonFrt donFrt) {
+ List<String> noms = TransformerHelper.toNom(listFrt);
+ final String oldName = donFrt.getNom();
+ noms.remove(oldName);
+ UniqueNomFinder uniqueNomFinder = new UniqueNomFinder();
+ String newName = uniqueNomFinder.findUniqueName(noms, oldName);
+ if (!oldName.equals(newName)) {
+ donFrt.setNom(newName);
+ }
+ }
}
Modified: trunk/soft/fudaa-crue/crue-server/src/test/java/org/fudaa/dodico/crue/validation/TestValidatorORES.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/test/java/org/fudaa/dodico/crue/validation/TestValidatorORES.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/crue-server/src/test/java/org/fudaa/dodico/crue/validation/TestValidatorORES.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -1,9 +1,9 @@
package org.fudaa.dodico.crue.validation;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import java.util.Set;
import org.fudaa.ctulu.CtuluLog;
import org.fudaa.ctulu.CtuluLogRecord;
import org.fudaa.dodico.crue.common.CollectionCrueUtil;
@@ -65,7 +65,7 @@
OrdResScenario other = loadDefault();
EMHScenario scenario = new EMHScenario(null);
scenario.addInfosEMH(other);
- Set<Dde> required = other.getOrdResBrancheBarrageFilEau().getDdes();
+ Collection<Dde> required = other.getOrdResBrancheBarrageFilEau().getDdes();
other.getOrdResBrancheBarrageFilEau().setValues(Collections.<Dde>emptyList());
List<CtuluLog> validateScenario = validator.validateScenario(scenario);
CtuluLog log = validateScenario.get(0);
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/services/PerspectiveState.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/services/PerspectiveState.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/services/PerspectiveState.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -13,7 +13,7 @@
MODE_READ(true,"mode.visualization"),
/**
* utilise pour un mode readOnly temporaire
- * par exemple si un scenario est chargée, la perspective passe en readonly temporaire
+ * par exemple si un scenario est chargée, la perspective étude passe en readonly temporaire
*/
MODE_READ_ONLY_TEMP(false,"mode.readOnlyTemp"),
/**
Modified: trunk/soft/fudaa-crue/ui-comparison/src/main/java/org/fudaa/fudaa/crue/comparison/ScenarioComparaisonController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-comparison/src/main/java/org/fudaa/fudaa/crue/comparison/ScenarioComparaisonController.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/ui-comparison/src/main/java/org/fudaa/fudaa/crue/comparison/ScenarioComparaisonController.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -175,7 +175,7 @@
@SuppressWarnings("serial")
private AbstractAction createCollapseAction() {
- return new AbstractActionIcon(MessageComparison.getMessage(PROPERTY_COLLAPSE), CrueIconsProvider.getIcon("/org/fudaa/fudaa/crue/comparison/arrow-in.png"),
+ return new AbstractActionIcon(MessageComparison.getMessage(PROPERTY_COLLAPSE), CrueIconsProvider.getIcon("org/fudaa/fudaa/crue/comparison/arrow-in.png"),
PROPERTY_COLLAPSE) {
@Override
@@ -201,7 +201,7 @@
@SuppressWarnings("serial")
private AbstractAction createExpandAction() {
- return new AbstractActionIcon(MessageComparison.getMessage(PROPERTY_EXPAND), CrueIconsProvider.getIcon("/org/fudaa/fudaa/crue/comparison/arrow-out.png"),
+ return new AbstractActionIcon(MessageComparison.getMessage(PROPERTY_EXPAND), CrueIconsProvider.getIcon("org/fudaa/fudaa/crue/comparison/arrow-out.png"),
PROPERTY_EXPAND) {
@Override
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/OrdResScenarioNode.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/OrdResScenarioNode.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/OrdResScenarioNode.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -6,7 +6,6 @@
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
-import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.common.BusinessMessages;
import org.fudaa.dodico.crue.common.CollectionCrueUtil;
@@ -14,9 +13,7 @@
import org.fudaa.dodico.crue.metier.emh.OrdResScenario;
import org.fudaa.dodico.crue.metier.transformer.TransformerHelper;
import org.fudaa.fudaa.crue.common.property.AbstractNodeFirable;
-import org.fudaa.fudaa.crue.common.property.PropertyNodeBuilder;
import org.fudaa.fudaa.crue.common.property.PropertySupportReadWrite;
-import org.fudaa.fudaa.crue.common.property.PropertySupportReflection;
import org.fudaa.fudaa.crue.modelling.node.AbstractModellingNodeFirable;
import org.fudaa.fudaa.crue.modelling.perspective.PerspectiveServiceModelling;
import org.openide.nodes.Children;
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/data/ReportRunContent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/data/ReportRunContent.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/data/ReportRunContent.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -3,6 +3,9 @@
*/
package org.fudaa.fudaa.crue.report.data;
+import java.util.HashMap;
+import java.util.Map;
+import org.fudaa.dodico.crue.metier.emh.EMH;
import org.fudaa.dodico.crue.metier.emh.EMHScenario;
import org.fudaa.dodico.crue.metier.etude.EMHRun;
import org.fudaa.dodico.crue.metier.etude.ManagerEMHScenario;
@@ -17,6 +20,7 @@
EMHRun run;
ManagerEMHScenario managerScenario;
ReportRunKey runKey;
+ Map<String, EMH> emhByName;
public ReportRunContent(EMHRun run, ManagerEMHScenario managerScenario, ReportRunEnum runKey) {
this.run = run;
@@ -30,8 +34,16 @@
public void setScenario(EMHScenario scenario) {
this.scenario = scenario;
+ emhByName = scenario.getIdRegistry().getEmhByNom();
}
+ public EMH getEMH(String nom) {
+ if (emhByName == null) {
+ return null;
+ }
+ return emhByName.get(nom);
+ }
+
public ReportRunKey getRunKey() {
return runKey;
}
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/data/ReportVariableKey.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/data/ReportVariableKey.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/data/ReportVariableKey.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -17,9 +17,6 @@
this.variableType = type;
}
- public String getRunAlternatifId() {
- return variableName;
- }
public ReportVariableTypeEnum getVariableType() {
return variableType;
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/export/ReportExportHelper.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/export/ReportExportHelper.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/export/ReportExportHelper.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -6,6 +6,7 @@
import com.memoire.bu.BuBorders;
import java.awt.BorderLayout;
import java.awt.Dialog;
+import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
@@ -85,7 +86,10 @@
return fileChooser;
}
};
- pn.add(fileChooserPanel, BorderLayout.SOUTH);
+ JPanel pnSouth = new JPanel(new FlowLayout(FlowLayout.LEFT));
+ pnSouth.add(new JLabel(NbBundle.getMessage(ReportExportHelper.class, "Export.ChooseFile.LabelName")));
+ pnSouth.add(fileChooserPanel);
+ pn.add(pnSouth, BorderLayout.SOUTH);
pn.setBorder(BuBorders.EMPTY3333);
final DialogDescriptor dialogDescriptor = new DialogDescriptor(pn, NbBundle.getMessage(ReportExportHelper.class, "Export.DialogTitle"), true, new Object[]{NotifyDescriptor.OK_OPTION, NotifyDescriptor.CANCEL_OPTION},
NotifyDescriptor.OK_OPTION,
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/perspective/PerspectiveServiceReport.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/perspective/PerspectiveServiceReport.java 2012-08-31 08:00:23 UTC (rev 7597)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/perspective/PerspectiveServiceReport.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -19,8 +19,11 @@
import org.fudaa.fudaa.crue.report.ReportTimeTopComponent;
import org.fudaa.fudaa.crue.report.ReportViewManagerTopComponent;
import org.fudaa.fudaa.crue.report.ReportVisualTopComponent;
+import org.fudaa.fudaa.crue.report.data.ReportRunContent;
+import org.fudaa.fudaa.crue.report.service.ReportService;
import org.fudaa.fudaa.crue.study.services.CrueService;
import org.openide.util.Lookup;
+import org.openide.util.Lookup.Result;
import org.openide.util.LookupEvent;
import org.openide.util.LookupListener;
import org.openide.util.lookup.ServiceProvider;
@@ -47,40 +50,50 @@
* contient l'état ouvert ou non
*/
private CrueService crueService = Lookup.getDefault().lookup(CrueService.class);
+ ReportService reportService = Lookup.getDefault().lookup(ReportService.class);
+ Result<ReportRunContent> runContentResult;
public PerspectiveServiceReport() {
- super(PerspectiveEnum.POST);
+ super(PerspectiveEnum.REPORT);
crueService.addEMHProjetStateLookupListener(new LookupListener() {
@Override
public void resultChanged(LookupEvent ev) {
projectLoadedChange();
}
});
- crueService.addPostLookupListener(new LookupListener() {
+ runContentResult = reportService.getLookup().lookupResult(ReportRunContent.class);
+ runContentResult.addLookupListener(new LookupListener() {
@Override
public void resultChanged(LookupEvent ev) {
- postLoadedChanged();
+ reportLoadedChanged();
}
});
}
- public void postLoadedChanged() {
+ public void reportLoadedChanged() {
//la methode setState gère le mode RO.
- setState(crueService.isAScenarioLoadedInPostPerspective() ? PerspectiveState.MODE_READ : PerspectiveState.MODE_READ_ONLY_TEMP);
+ updateState();
}
public void projectLoadedChange() {
if (crueService.getProjectLoaded() == null) {
resetStateToReadOnlyTemp();
} else {
- setState(crueService.isProjetReadOnly() ? PerspectiveState.MODE_READ_ONLY_ALWAYS : PerspectiveState.MODE_READ_ONLY_TEMP);
+ updateState();
}
+ }
+ protected void updateState() {
+ if (crueService.isProjetReadOnly()) {
+ setState(PerspectiveState.MODE_READ_ONLY_ALWAYS);
+ } else {
+ setState(reportService.getRunCourant() != null ? PerspectiveState.MODE_READ : PerspectiveState.MODE_READ_ONLY_TEMP);
+ }
}
@Override
public boolean supportEdition() {
- return false;
+ return true;
}
@Override
@@ -107,6 +120,7 @@
@Override
public boolean activate() {
+ updateState();
return true;
}
Added: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportResultProviderService.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportResultProviderService.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportResultProviderService.java 2012-08-31 09:13:28 UTC (rev 7598)
@@ -0,0 +1,142 @@
+/*
+ GPL 2
+ */
+package org.fudaa.fudaa.crue.report.service;
+
+import java.io.IOException;
+import java.util.Map;
+import org.apache.commons.lang.StringUtils;
+import org.fudaa.dodico.crue.metier.emh.EMH;
+import org.fudaa.dodico.crue.metier.emh.ResultatKey;
+import org.fudaa.fudaa.crue.report.data.ReportRunContent;
+import org.fudaa.fudaa.crue.report.data.ReportRunKey;
+import org.fudaa.fudaa.crue.report.data.ReportRunVariableKey;
+import org.fudaa.fudaa.crue.report.data.ReportVariableTypeEnum;
+import org.openide.util.Exceptions;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author Frederic Deniger
+ */
+public class ReportResultProviderService {
+
+ public static String TIME_TEMPS_SCE = "TempsSce";
+ public static String TIME_TEMPS_CALC = "TempsCalc";
+ public static String TIME_NOM_CALC = "NomCalc";
+ ReportService reportService = Lookup.getDefault().lookup(ReportService.class);
+ ReportRunAlternatifService reportRunAlternatifService = Lookup.getDefault().lookup(ReportRunAlternatifService.class);
+
+ /**
+ * si c'est un temps, l'EMH n'est pas utilisée
+ *
+ * @param key
+ * @param emh
+ * @return
+ */
+ public Double getValue(ReportRunVariableKey key, String emhNom) {
+ ReportVariableTypeEnum variableType = key.getVariable().getVariableType();
+ switch (variableType) {
+ case TIME:
+ return getTimeValue(key);
+ case EXPR:
+ throw new IllegalAccessError();
+ case READ:
+ return getReadValue(key, emhNom);
+ }
+ throw new IllegalAccessError("unknown " + variableType);
+ }
+
+ public ReportRunContent getRunContent(ReportRunKey key) {
+ if (key.isCourant()) {
+ return reportService.getRunCourant();
+ }
+ return reportRunAlternatifService.getRunContent(key);
+ }
+
+ public EMH getEMH(String nom, ReportRunKey key) {
+ ReportRunContent runContent = getRunContent(key);
+ if (runContent == null) {
+ return null;
+ }
+ return runContent.getEMH(nom);
+ }
+
+ public String getValueAsString(ReportRunVariableKey key, String emhNom) {
+ ReportVariableTypeEnum variableType = key.getVariable().getVariableType();
+ switch (variableType) {
+ case TIME:
+ return getTimeValueAsString(key);
+ case EXPR:
+ throw new IllegalAccessError();
+ case READ:
+ return getReadValueAsString(key, emhNom);
+ }
+ throw new IllegalAccessError("unknown " + variableType);
+ }
+
+ private Double getTimeValue(ReportRunVariableKey key) {
+ final String variableName = key.getVariable().getVariableName();
+ if (TIME_NOM_CALC.equals(variableName)) {
+ throw new IllegalAccessError("nom calc cannot be translate to double");
+ } else if (TIME_TEMPS_CALC.equals(variableName)) {
+ ResultatKey selectedTime = reportService.getSelectedTime();
+ if (selectedTime == null) {
+ return null;
+ }
+ return reportService.getTimeContent().getTempsCalcInSec(selectedTime);
+
+ } else if (TIME_TEMPS_SCE.equals(variableName)) {
+ ResultatKey selectedTime = reportService.getSelectedTime();
+ if (selectedTime == null) {
+ return null;
+ }
+ return reportService.getTimeContent().getTempSceInSec(selectedTime);
+
+ }
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ private Double getReadValue(ReportRunVariableKey key, String emhNom) {
+ ResultatKey selectedTime = reportService.getSelectedTime();
+ if (selectedTime == null) {
+ return null;
+ }
+ EMH emh = getEMH(emhNom, key.getRunKey());
+ if (emh == null || emh.getResultatCalcul() == null) {
+ return null;
+ }
+ try {
+ final Map<String, Object> read = emh.getResultatCalcul().read(selectedTime);
+ if (read == null) {
+ return null;
+ }
+ return (Double) read.get(key.getVariable().getVariableName());
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ return null;
+
+ }
+
+ private String getTimeValueAsString(ReportRunVariableKey key) {
+ final String variableName = key.getVariable().getVariableName();
+ if (TIME_NOM_CALC.equals(variableName)) {
+ ResultatKey selectedTime = reportService.getSelectedTime();
+ return selectedTime == null ? StringUtils.EMPTY : selectedTime.getNomCalcul();
+ } else if (TIME_TEMPS_CALC.equals(variableName)) {
+ return reportService.getReportT...
[truncated message content] |
|
From: <de...@us...> - 2012-09-17 14:49:06
|
Revision: 7633
http://fudaa.svn.sourceforge.net/fudaa/?rev=7633&view=rev
Author: deniger
Date: 2012-09-17 14:48:54 +0000 (Mon, 17 Sep 2012)
Log Message:
-----------
Pour pouvoir lancer Fudaa en mode headless ( utile pour les tests dans le serveur d'int?\195?\169gration continue).
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/test/java/org/fudaa/dodico/crue/common/ScenarioBuilder.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/PlanimetryVisuPanel.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/SigLoaderAction.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/GroupExterneController.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerBrancheController.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryController.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryVisuPanelController.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryBrancheModel.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryObjectLayerGroup.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/resources/org/fudaa/fudaa/crue/planimetry/action/Bundle.properties
trunk/soft/fudaa-crue/ui-planimetry/src/test/java/org/fudaa/fudaa/crue/planimetry/PlanimetryLauncher.java
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/ProjectBrancheOnLineAction.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/ProjectBrancheOnLineProcess.java
trunk/soft/fudaa-crue/ui-planimetry/src/test/java/org/fudaa/fudaa/crue/planimetry/action/
trunk/soft/fudaa-crue/ui-planimetry/src/test/java/org/fudaa/fudaa/crue/planimetry/action/ProjectBrancheOnLineProcessTest.java
Modified: trunk/soft/fudaa-crue/crue-server/src/test/java/org/fudaa/dodico/crue/common/ScenarioBuilder.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/test/java/org/fudaa/dodico/crue/common/ScenarioBuilder.java 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/crue-server/src/test/java/org/fudaa/dodico/crue/common/ScenarioBuilder.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -37,14 +37,16 @@
point.setOrdonnee(0);
dontFrt.getLoi().getEvolutionFF().getPtEvolutionFF().add(point);
frt.addFrt(dontFrt);
-// dontFrt.getStrickler().getEvolutionFF().
sousModele.addInfosEMH(frt);
EMHRelationFactory.addRelationContientEMH(modele, sousModele);
final EMHBrancheOrifice br = new EMHBrancheOrifice("Br_1");
- final CatEMHNoeud nd = new EMHNoeudNiveauContinu("Nd_1");
- EMHRelationFactory.addNoeudAval(br, nd);
+ final CatEMHNoeud nd1 = new EMHNoeudNiveauContinu("Nd_1");
+ final CatEMHNoeud nd2 = new EMHNoeudNiveauContinu("Nd_2");
+ EMHRelationFactory.addNoeudAval(br, nd1);
+ EMHRelationFactory.addNoeudAmont(br, nd2);
EMHRelationFactory.addRelationContientEMH(sousModele, br);
- EMHRelationFactory.addRelationContientEMH(sousModele, nd);
+ EMHRelationFactory.addRelationContientEMH(sousModele, nd1);
+ EMHRelationFactory.addRelationContientEMH(sousModele, nd2);
IdRegistry id = new IdRegistry();
id.registerAll(scenario);
scenario.setIdRegistry(id);
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/PlanimetryVisuPanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/PlanimetryVisuPanel.java 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/PlanimetryVisuPanel.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -40,6 +40,7 @@
import org.fudaa.fudaa.crue.planimetry.action.AddCasierAction;
import org.fudaa.fudaa.crue.planimetry.action.AddNoeudAction;
import org.fudaa.fudaa.crue.planimetry.action.EditZonePanel;
+import org.fudaa.fudaa.crue.planimetry.action.ProjectBrancheOnLineAction;
import org.fudaa.fudaa.sig.layer.FSigEditor;
import org.fudaa.fudaa.sig.layer.FSigLayerGroup;
import org.fudaa.fudaa.sig.layer.FSigVisuPanel;
@@ -66,8 +67,6 @@
public void setConfigurer(PlanimetryVisuPanelConfigurer configurer) {
this.configurer = configurer;
}
-
-
public EbliActionInterface getSigEditAction() {
return getEditor().getEditAction()[0];
@@ -256,10 +255,12 @@
getPlanimetryVisuController().addEditAction(addNoeud);
getPlanimetryVisuController().addEditAction(addCasier);
getPlanimetryVisuController().addEditAction(addBranche);
+ getPlanimetryVisuController().addEditAction(getPlanimetryVisuController().getProjectBrancheOnLineAction());
gisEditionPalette.add(new JSeparator());
gisEditionPalette.add(add(addNoeud.buildToolButton(EbliComponentFactory.INSTANCE)));
gisEditionPalette.add(add(addBranche.buildToolButton(EbliComponentFactory.INSTANCE)));
gisEditionPalette.add(add(addCasier.buildToolButton(EbliComponentFactory.INSTANCE)));
+ gisEditionPalette.add(add(getPlanimetryVisuController().getProjectBrancheOnLineAction().buildToolButton(EbliComponentFactory.INSTANCE)));
return gisEditionPalette;
}
Added: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/ProjectBrancheOnLineAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/ProjectBrancheOnLineAction.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/ProjectBrancheOnLineAction.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -0,0 +1,60 @@
+/*
+ GPL 2
+ */
+package org.fudaa.fudaa.crue.planimetry.action;
+
+import java.awt.event.ActionEvent;
+import org.fudaa.ctulu.CtuluLog;
+import org.fudaa.ebli.calque.ZSelectionEvent;
+import org.fudaa.ebli.calque.ZSelectionListener;
+import org.fudaa.ebli.commun.EbliActionSimple;
+import org.fudaa.ebli.ressource.EbliResource;
+import org.fudaa.fudaa.crue.common.log.LogsDisplayer;
+import org.fudaa.fudaa.crue.planimetry.PlanimetryVisuPanel;
+import org.openide.util.NbBundle;
+
+/**
+ *
+ * @author Frederic Deniger
+ */
+public class ProjectBrancheOnLineAction extends EbliActionSimple implements ZSelectionListener {
+
+ private ProjectBrancheOnLineProcess process;
+ boolean userEnable = false;
+
+ public ProjectBrancheOnLineAction(PlanimetryVisuPanel visuPanel) {
+ super(NbBundle.getMessage(ProjectBrancheOnLineAction.class, "ProjectBrancheOnLine.ActionName"), EbliResource.EBLI.getIcon("ligne.gif"),
+ "PROJECT_ON_LINE");
+ this.process = new ProjectBrancheOnLineProcess(visuPanel);
+ setEnabled(false);
+ visuPanel.getEditor().getSceneEditor().getScene().addSelectionListener(this);
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent _e) {
+ CtuluLog log = process.process();
+ if (log.isNotEmpty()) {
+ LogsDisplayer.displayError(log, getTitle());
+ }
+ }
+
+ @Override
+ public void setEnabled(boolean _newValue) {
+ userEnable = _newValue;
+ updateStateBeforeShow();
+ }
+
+ public void setEnabledParent(boolean _newValue) {
+ super.setEnabled(_newValue);
+ }
+
+ @Override
+ public void updateStateBeforeShow() {
+ setEnabledParent(userEnable && process.isEnable());
+ }
+
+ @Override
+ public void selectionChanged(ZSelectionEvent _evt) {
+ updateStateBeforeShow();
+ }
+}
Added: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/ProjectBrancheOnLineProcess.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/ProjectBrancheOnLineProcess.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/ProjectBrancheOnLineProcess.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -0,0 +1,181 @@
+/*
+ GPL 2
+ */
+package org.fudaa.fudaa.crue.planimetry.action;
+
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geom.CoordinateSequence;
+import com.vividsolutions.jts.geom.LineSegment;
+import com.vividsolutions.jts.operation.distance.GeometryLocation;
+import gnu.trove.TIntObjectHashMap;
+import gnu.trove.TIntObjectIterator;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.fudaa.ctulu.CtuluLog;
+import org.fudaa.ctulu.gis.GISGeometryFactory;
+import org.fudaa.ctulu.gis.GISLigneBrisee;
+import org.fudaa.ctulu.gis.GISPolyligne;
+import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface;
+import org.fudaa.fudaa.crue.planimetry.PlanimetryVisuPanel;
+import org.fudaa.fudaa.crue.planimetry.controller.LayerBrancheController;
+import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryBrancheLayer;
+import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryBrancheModel;
+import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryLigneBriseeExternUnmodifiableLayer;
+import org.openide.util.NbBundle;
+
+/**
+ * processor pour projeter la sélection des branches sur une ligne.
+ *
+ * @author Frederic Deniger
+ */
+public class ProjectBrancheOnLineProcess {
+
+ private PlanimetryVisuPanel visuPanel;
+
+ public ProjectBrancheOnLineProcess(PlanimetryVisuPanel visuPanel) {
+ this.visuPanel = visuPanel;
+ }
+
+ protected GeometryLocation findPositionOnLine(CoordinateSequence line, Coordinate point) {
+ Coordinate position = null;
+ int idx = -1;
+ int size = line.size();
+ for (int k = 0; k < size - 1; k++) {
+ Coordinate coordinateA = line.getCoordinate(k);
+ Coordinate coordinateB = line.getCoordinate(k + 1);
+ Coordinate foundPosition = getPosition(point, coordinateA, coordinateB);
+ if (foundPosition != null) {
+ if (position == null) {
+ position = foundPosition;
+ idx = k;
+ } else {
+ double current = position.distance(point);
+ double newDistance = foundPosition.distance(point);
+ if (newDistance < current) {
+ position = foundPosition;
+ idx = k;
+ }
+ }
+ }
+ }
+ return position == null ? null : new GeometryLocation(null, idx, position);
+ }
+
+ public CtuluLog process() {
+ GISLigneBrisee selectedLine = getSelectedLine();
+ return process(selectedLine);
+ }
+
+ private Coordinate getPosition(Coordinate p, Coordinate A, Coordinate B) {
+ // if start==end, then use pt distance
+ if (A.equals(B)) {
+ return null;
+ }
+ // otherwise use comp.graphics.algorithms Frequently Asked Questions method
+ /*(1) AC dot AB
+ r = ---------
+ ||AB||^2
+ r has the following meaning:
+ r=0 P = A
+ r=1 P = B
+ r<0 P is on the backward extension of AB
+ r>1 P is on the forward extension of AB
+ 0<r<1 P is interior to AB
+ */
+
+ double r = ((p.x - A.x) * (B.x - A.x) + (p.y - A.y) * (B.y - A.y))
+ / ((B.x - A.x) * (B.x - A.x) + (B.y - A.y) * (B.y - A.y));
+
+ if (r >= 0 && r <= 1) {
+ LineSegment seg = new LineSegment(A, B);
+ Coordinate segClosestPoint = seg.closestPoint(p);
+ return segClosestPoint;
+
+ }
+
+ return null;
+ }
+
+ private GISLigneBrisee getSelectedLine() {
+ ZCalqueAffichageDonneesInterface[] targetLayers = visuPanel.getEditor().getSceneEditor().getScene().getTargetLayers();
+ GISLigneBrisee res = null;
+ for (ZCalqueAffichageDonneesInterface layer : targetLayers) {
+ if (layer.getLayerSelection() != null && layer.getLayerSelection().isOnlyOnIndexSelected() && layer instanceof PlanimetryLigneBriseeExternUnmodifiableLayer) {
+ if (res != null) {
+ return null;
+ }
+ int idx = layer.getLayerSelection().getMinIndex();
+ PlanimetryLigneBriseeExternUnmodifiableLayer lineLayer = (PlanimetryLigneBriseeExternUnmodifiableLayer) layer;
+ res = (GISLigneBrisee) lineLayer.getModelEditable().getGeomData().getGeometry(idx);
+ }
+ }
+ return res;
+ }
+
+ protected boolean isEnable() {
+ return !visuPanel.getPlanimetryController().getBrancheController().getLayer().isSelectionEmpty() && getSelectedLine() != null;
+ }
+
+ protected CtuluLog process(GISLigneBrisee selectedLine) {
+ final LayerBrancheController brancheController = visuPanel.getPlanimetryController().getBrancheController();
+ PlanimetryBrancheLayer brancheLayer = brancheController.getLayer();
+ visuPanel.getPlanimetryController().getSceneListener().setGlobalChangeStarted();
+ CtuluLog log = new CtuluLog();
+ log.setDesc(NbBundle.getMessage(ProjectBrancheOnLineProcess.class, "ProjectLineOnBranche.LogTitle"));
+ try {
+ int[] selectedIndex = brancheLayer.getSelectedIndex();
+ if(selectedIndex==null){
+ return log;
+ }
+ TIntObjectHashMap<GISPolyligne> newCoordinateByBrancheIdx = new TIntObjectHashMap<GISPolyligne>();
+ for (int i = 0; i < selectedIndex.length; i++) {
+ int brancheIdx = selectedIndex[i];
+ Coordinate amontCoordinate = brancheController.getAmontCoordinate(brancheIdx);
+ Coordinate avalCoordinate = brancheController.getAvalCoordinate(brancheIdx);
+ CoordinateSequence coordinateSequence = selectedLine.getCoordinateSequence();
+ GeometryLocation amontPosition = findPositionOnLine(coordinateSequence, amontCoordinate);
+ GeometryLocation avalPosition = findPositionOnLine(coordinateSequence, avalCoordinate);
+ if (amontPosition != null && avalPosition != null) {
+ List<Coordinate> cs = new ArrayList<Coordinate>();
+ int min = Math.min(amontPosition.getSegmentIndex(), avalPosition.getSegmentIndex());
+ int max = Math.max(amontPosition.getSegmentIndex(), avalPosition.getSegmentIndex());
+ for (int k = min; k < max; k++) {
+ cs.add(new Coordinate(coordinateSequence.getCoordinate(k + 1)));
+ }
+ if (amontPosition.getSegmentIndex() > avalPosition.getSegmentIndex()) {
+ Collections.reverse(cs);
+ }
+ cs.add(0, new Coordinate(amontPosition.getCoordinate()));
+//a verifier que donnéée non pourries:
+ cs.add(new Coordinate(avalPosition.getCoordinate()));
+ if (cs.size() < 2) {
+ log.addError(NbBundle.getMessage(ProjectBrancheOnLineProcess.class, "ProjectrBrancheOnLine.OnePoint.Error", brancheController.getBranche(brancheIdx).getNom()));
+ } else {
+ CoordinateSequence newSeq = GISGeometryFactory.INSTANCE.getCoordinateSequenceFactory().create((Coordinate[]) cs.toArray(new Coordinate[cs.size()]));
+ GISPolyligne newLine = (GISPolyligne) GISGeometryFactory.INSTANCE.createGeometry(GISPolyligne.class, newSeq);
+ if (newLine.getLength() < 1e-3) {
+ log.addError(NbBundle.getMessage(ProjectBrancheOnLineProcess.class, "ProjectrBrancheOnLine.EmptyLine.Error", brancheController.getBranche(brancheIdx).getNom()));
+ } else {
+ newCoordinateByBrancheIdx
+ .put(brancheIdx, newLine);
+ }
+ }
+ }
+ else{
+ log.addWarn(NbBundle.getMessage(ProjectBrancheOnLineProcess.class, "ProjectBrancheOnLine.CantBeProjected.Warn", brancheController.getBranche(brancheIdx).getNom()));
+ }
+ }
+ if (!log.containsErrorOrSevereError()) {
+ TIntObjectIterator<GISPolyligne> iterator = newCoordinateByBrancheIdx.iterator();
+ for (int l = newCoordinateByBrancheIdx.size(); l-- > 0;) {
+ iterator.advance();
+ ((PlanimetryBrancheModel) brancheController.getLayer().getModelEditable()).setGeometry(iterator.key(), iterator.value());
+ }
+ }
+ } finally {
+ visuPanel.getPlanimetryController().getSceneListener().setGlobalChangeFinished();
+ }
+ return log;
+ }
+}
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/SigLoaderAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/SigLoaderAction.java 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/action/SigLoaderAction.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -76,6 +76,9 @@
public void finishImportData(final Pair<GISZoneCollectionPoint, GISZoneCollectionLigneBrisee> collections, File file,
EnumFormat fmt) {
+ if(collections==null){
+ return ;
+ }
final GISZoneCollectionPoint points = collections.first;
final GISZoneCollectionLigneBrisee lignes = collections.second;
int nbPoints = points == null ? 0 : points.getNbGeometries();
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/GroupExterneController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/GroupExterneController.java 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/GroupExterneController.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -6,6 +6,7 @@
import java.beans.PropertyChangeListener;
import java.io.File;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Observable;
import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee;
@@ -14,6 +15,7 @@
import org.fudaa.ebli.calque.BGroupeCalque;
import org.fudaa.ebli.calque.edition.ZCalqueLigneBriseeEditable;
import org.fudaa.ebli.calque.edition.ZCalquePointEditable;
+import org.fudaa.ebli.commun.EbliActionInterface;
import org.fudaa.fudaa.crue.planimetry.PlanimetryVisuPanel;
import org.fudaa.fudaa.crue.planimetry.action.SigFormatHelper;
import org.fudaa.fudaa.crue.planimetry.action.SigFormatHelper.EnumFormat;
@@ -77,6 +79,8 @@
PlanimetryLigneBriseeExternUnmodifiableLayer newLayer = new PlanimetryLigneBriseeExternUnmodifiableLayer(model, editor,
file, fmt);
newLayer.setTitle(file.getName());
+
+
layerLigneBriseeExternController.setLayer(newLayer);
return newLayer;
}
@@ -115,9 +119,11 @@
addAdditionalLayer(createLayerPointUnmodifiable(pt, file, fmt, controller.getVisuPanel().getEditor()));
}
- public void addLayerLignesUnmodifiable(GISZoneCollectionLigneBrisee lignes, File file, SigFormatHelper.EnumFormat fmt) {
+ public PlanimetryLigneBriseeExternUnmodifiableLayer addLayerLignesUnmodifiable(GISZoneCollectionLigneBrisee lignes, File file, SigFormatHelper.EnumFormat fmt) {
final FSigEditor editor = controller.getVisuPanel().getEditor();
- addAdditionalLayer(createLayerLignesUnmodifiable(lignes, file, fmt, editor));
+ final PlanimetryLigneBriseeExternUnmodifiableLayer layer = createLayerLignesUnmodifiable(lignes, file, fmt, editor);
+ addAdditionalLayer(layer);
+ return layer;
}
private class CalqueAddRemoveListener implements ContainerListener, PropertyChangeListener {
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerBrancheController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerBrancheController.java 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerBrancheController.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -8,7 +8,6 @@
import org.fudaa.ctulu.gis.GISPolyligne;
import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee;
import org.fudaa.dodico.crue.config.CrueConfigMetier;
-import org.fudaa.dodico.crue.edition.bean.CreationDefaultValue;
import org.fudaa.dodico.crue.metier.emh.CatEMHBranche;
import org.fudaa.dodico.crue.metier.emh.CatEMHNoeud;
import org.fudaa.dodico.crue.metier.emh.EMH;
@@ -46,6 +45,7 @@
new OpenEMHAction.NewFrame(ctx),
null,
res.getSigEditAction(),
+ res.getPlanimetryVisuController().getProjectBrancheOnLineAction(),
null,
res.getEditor().getActionDelete(),
res.getPlanimetryVisuController().getDeleteCascade()});
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryController.java 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryController.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -57,7 +57,7 @@
ConfigDefaultValuesProvider defaultValuesProvider;
public CreationDefaultValue getDefaultValues() {
- return defaultValuesProvider.getDefaultValues();
+ return defaultValuesProvider == null ? new CreationDefaultValue() : defaultValuesProvider.getDefaultValues();
}
public void setDefaultValuesProvider(ConfigDefaultValuesProvider defaultValuesProvider) {
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryVisuPanelController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryVisuPanelController.java 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/PlanimetryVisuPanelController.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -23,6 +23,7 @@
import org.fudaa.fudaa.crue.planimetry.PLanimetryDeplacementAction;
import org.fudaa.fudaa.crue.planimetry.PlanimetryVisuPanel;
import org.fudaa.fudaa.crue.planimetry.action.DeleteEMHCascadeAction;
+import org.fudaa.fudaa.crue.planimetry.action.ProjectBrancheOnLineAction;
import org.fudaa.fudaa.sig.layer.FSigVisuPanelController;
/**
@@ -34,7 +35,7 @@
Collection<String> useAsPalette = Arrays.asList("CHANGE_REFERENCE", "GLOBAL_MOVE");
Collection<String> useAsTab = Arrays.asList("INFOS", "PALETTE_EDTION");
Collection<EbliActionPaletteAbstract> tabPalettes_ = null;
- Map<String, EbliActionPaletteAbstract> mapTabPalettes_ = new HashMap<String, EbliActionPaletteAbstract>(2);
+ Map<String, EbliActionPaletteAbstract> mapTabPalettes = new HashMap<String, EbliActionPaletteAbstract>(2);
public PlanimetryVisuPanelController(CtuluUI _ui) {
super(_ui);
@@ -73,7 +74,16 @@
return getVisuPanel().getEditor().edit();
}
DeleteEMHCascadeAction deleteCascadeAction;
+ ProjectBrancheOnLineAction projectBrancheOnLineAction;
+ public ProjectBrancheOnLineAction getProjectBrancheOnLineAction() {
+ if (projectBrancheOnLineAction == null) {
+ PlanimetryVisuPanel panel = (PlanimetryVisuPanel) getView();
+ projectBrancheOnLineAction = new ProjectBrancheOnLineAction(panel);
+ }
+ return projectBrancheOnLineAction;
+ }
+
public DeleteEMHCascadeAction getDeleteCascade() {
if (deleteCascadeAction == null) {
deleteCascadeAction = new DeleteEMHCascadeAction(getVisuPanel().getEditor());
@@ -106,7 +116,7 @@
initSpecificActions();
tabPalettes_ = new ArrayList<EbliActionPaletteAbstract>(3);
for (final String str : useAsTab) {
- final EbliActionPaletteAbstract o = mapTabPalettes_.get(str);
+ final EbliActionPaletteAbstract o = mapTabPalettes.get(str);
if (o != null) {
tabPalettes_.add(o);
}
@@ -139,7 +149,6 @@
return removePalettes(pn_.getApplicationActions());
}
PLanimetryDeplacementAction moveAction;
-// ConfigureUIAction configureUI;
/**
* @param actions les actions a trier
@@ -171,7 +180,7 @@
acts.add(action);
}
if (isPalette && useAsTab.contains(value)) {
- mapTabPalettes_.put(value, (EbliActionPaletteAbstract) action);
+ mapTabPalettes.put(value, (EbliActionPaletteAbstract) action);
((EbliActionPaletteAbstract) action).setUsedAsTab(true);
}
}
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryBrancheModel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryBrancheModel.java 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryBrancheModel.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -1,6 +1,7 @@
package org.fudaa.fudaa.crue.planimetry.layer;
import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geom.CoordinateSequence;
import com.vividsolutions.jts.geom.Geometry;
import gnu.trove.TIntArrayList;
import java.util.ArrayList;
@@ -11,6 +12,7 @@
import org.fudaa.ctulu.gis.CtuluLibGeometrie;
import org.fudaa.ctulu.gis.GISAttributeModel;
import org.fudaa.ctulu.gis.GISCoordinateSequence;
+import org.fudaa.ctulu.gis.GISGeometryFactory;
import org.fudaa.ctulu.gis.GISPoint;
import org.fudaa.ctulu.gis.GISPolyligne;
import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee;
@@ -59,6 +61,12 @@
return false;
}
+ public void setGeometry(int i, GISPolyligne line) {
+ super.getLayerController().changeWillBeDone();
+ geometries_.setGeometry(i, line, null);
+ super.getLayerController().changeDone();
+ }
+
@Override
public boolean removeLigneBrisee(int[] _idx, CtuluCommandContainer _cmd) {
return removeBranches(_idx, false);
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryObjectLayerGroup.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryObjectLayerGroup.java 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryObjectLayerGroup.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -23,7 +23,6 @@
this.controller = controller;
setDestructible(false);
FSigImageImportAction importImage = new FSigImageImportAction(visu_, this) {
-
@Override
public ZCalqueImageRaster createCalque(ZModeleImageRaster _model) {
return PlanimetryObjectLayerGroup.this.createCalqueImage(_model);
@@ -35,7 +34,6 @@
}
};
setActions(new EbliActionInterface[]{
- //actionAddPoint_, actionAddPoly_, null,
importImage, null, visu_.getEditor().getExportAction(), new SigLoaderAction(controller)});
setArbreEditable(false);
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/resources/org/fudaa/fudaa/crue/planimetry/action/Bundle.properties
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/resources/org/fudaa/fudaa/crue/planimetry/action/Bundle.properties 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/resources/org/fudaa/fudaa/crue/planimetry/action/Bundle.properties 2012-09-17 14:48:54 UTC (rev 7633)
@@ -10,3 +10,8 @@
DeleteEMHCascade.Name=Supprimer en cascade
OpenEMH.DisplayName=Ouvrir \u00e9diteur EMH
OpenEMH.NewFrame.DisplayName=Ouvrir \u00e9diteur EMH ( nouvelle fen\u00eatre)
+ProjectBrancheOnLine.ActionName=Projeter la branche sur l'axe
+ProjectLineOnBranche.LogTitle=projection de branches sur une ligne
+ProjectrBrancheOnLine.OnePoint.Error=La projection de la branche {0} sur l''axe est impossible: un seul point de projection trouv\u00e9
+ProjectrBrancheOnLine.EmptyLine.Error=La projection de la branche {0} sur l''axe est impossible: une ligne vide serait cr\u00e9\u00e9e
+ProjectBrancheOnLine.CantBeProjected.Warn=La branche {0} n''a pas \u00e9t\u00e9 projet\u00e9e sur la ligne
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/test/java/org/fudaa/fudaa/crue/planimetry/PlanimetryLauncher.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/test/java/org/fudaa/fudaa/crue/planimetry/PlanimetryLauncher.java 2012-09-17 14:44:12 UTC (rev 7632)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/test/java/org/fudaa/fudaa/crue/planimetry/PlanimetryLauncher.java 2012-09-17 14:48:54 UTC (rev 7633)
@@ -8,6 +8,7 @@
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FlowLayout;
+import java.awt.GraphicsEnvironment;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
@@ -47,14 +48,9 @@
public class PlanimetryLauncher {
public static void main(String[] args) {
-// File etu = new File("C:\\Data\\integration\\EtuAV_TI\\Etu_AV_TI.etu.xml");
-// EMHProjet readData = TestCrueETUFile.readData(etu, TestCoeurConfig.INSTANCE);
-// ScenarioLoader loader = new ScenarioLoader(readData.getScenarioCourant(), readData, TestCoeurConfig.INSTANCE,
-// new CrueOptions());
-// ScenarioLoaderResult load = loader.load(null);
+
EMHScenario scenario = ReadHelper.readModeleAnsSetRelation(new CtuluLog(), TestCrueDC.FICHIER_TEST_MODELE3_DC,
- TestCrueDH.FICHIER_TEST_MODELE3_DH);;
-// EMHScenario scenario = TestScenarioBuilder.buildDefaultScenario();
+ TestCrueDH.FICHIER_TEST_MODELE3_DH);
NetworkBuilder builder = new Netwo...
[truncated message content] |
|
From: <de...@us...> - 2012-09-28 00:13:38
|
Revision: 7673
http://fudaa.svn.sourceforge.net/fudaa/?rev=7673&view=rev
Author: deniger
Date: 2012-09-28 00:13:31 +0000 (Fri, 28 Sep 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/common/DefaultLoiTableModel.java
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionEtiquetteCourbeModel.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingOpenListBranchesAction.java
Modified: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/common/DefaultLoiTableModel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/common/DefaultLoiTableModel.java 2012-09-28 00:10:46 UTC (rev 7672)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/common/DefaultLoiTableModel.java 2012-09-28 00:13:31 UTC (rev 7673)
@@ -7,7 +7,6 @@
import org.fudaa.ebli.courbe.EGCourbe;
import org.fudaa.ebli.courbe.EGTableGraphePanel;
import org.fudaa.ebli.courbe.EGTableGraphePanel.SpecTableModel;
-import org.opengis.filter.expression.PropertyName;
/**
* Etend le tableModel par defaut de ebli-graphe, pour ajouter une colonne indiquant les erreurs/warnings et pour ne réagir qu'au courbe des points.
@@ -29,6 +28,9 @@
@Override
protected void selectedCourbeChanged(EGCourbe _a) {
+ if (_a == null && getCourbe() == null) {
+ return;
+ }
if (_a == null || _a.getModel() instanceof AbstractLoiCourbeModel) {
super.selectedCourbeChanged(_a);
}
Modified: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionEtiquetteCourbeModel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionEtiquetteCourbeModel.java 2012-09-28 00:10:46 UTC (rev 7672)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionEtiquetteCourbeModel.java 2012-09-28 00:13:31 UTC (rev 7673)
@@ -30,6 +30,9 @@
boolean contained = false;
protected void reload(ProfilSectionLoiUiController uiController) {
+ if (uiController.getLoiModel() == null) {
+ return;
+ }
ProfilSectionLine findLine = uiController.getLoiModel().findLine(etiquette);
contained = findLine != null;
if (findLine != null) {
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingOpenListBranchesAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingOpenListBranchesAction.java 2012-09-28 00:10:46 UTC (rev 7672)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/action/ModellingOpenListBranchesAction.java 2012-09-28 00:13:31 UTC (rev 7673)
@@ -4,7 +4,6 @@
*/
package org.fudaa.fudaa.crue.modelling.action;
-import org.fudaa.fudaa.crue.modelling.loi.*;
import javax.swing.Action;
import org.fudaa.dodico.crue.metier.emh.EMHSousModele;
import org.fudaa.fudaa.crue.modelling.perspective.ActiveModelisation;
@@ -23,7 +22,7 @@
public final class ModellingOpenListBranchesAction extends AbstractModellingSousModeleOpenAction {
public ModellingOpenListBranchesAction() {
- putValue(Action.NAME, NbBundle.getMessage(ModellingOpenDFRTAction.class, "ModellingListBrancheNodeAction.Name"));
+ putValue(Action.NAME, NbBundle.getMessage(ModellingOpenListBranchesAction.class, "ModellingListBrancheNodeAction.Name"));
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-09-28 18:52:06
|
Revision: 7678
http://fudaa.svn.sourceforge.net/fudaa/?rev=7678&view=rev
Author: deniger
Date: 2012-09-28 18:51:59 +0000 (Fri, 28 Sep 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/io/dclm/CrueConverterDCLM.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingComputeDataTopComponent.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/CalculAddDclmNodeAction.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/global/GlobalActionChildFactory.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/listener/NodeInternChangedListener.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/perspective/PerspectiveServiceModelling.java
trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/Bundle.properties
trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/layer.xml
trunk/soft/fudaa-crue/ui-modelling/src/test/java/org/fudaa/fudaa/crue/modelling/GlobalActionsChildFactoryTest.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerBrancheController.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerCasierController.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerNodeController.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerSectionController.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerTraceController.java
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingContainersTopComponent.form
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingContainersTopComponent.java
Removed Paths:
-------------
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingActionsTopComponent.form
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingActionsTopComponent.java
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/io/dclm/CrueConverterDCLM.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/io/dclm/CrueConverterDCLM.java 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/io/dclm/CrueConverterDCLM.java 2012-09-28 18:51:59 UTC (rev 7678)
@@ -579,7 +579,9 @@
for (final CalcTransBrancheSaintVenantQruis in : calculMetier.getCalcTransBrancheSaintVenantQruis()) {
final CrueDaoDCLMContents.CalcTransBrancheSaintVenantHydrogrammeRuisPersist dao = new CrueDaoDCLMContents.CalcTransBrancheSaintVenantHydrogrammeRuisPersist();
dao.HydrogrammeQruis = new CrueDaoDCLMContents.HydrogrammeQruisPersist();
- dao.HydrogrammeQruis.NomRef = in.getLoi().getNom();
+ if (in.getLoi() != null) {
+ dao.HydrogrammeQruis.NomRef = in.getLoi().getNom();
+ }
dao.NomRef = in.getEmh().getNom();
calculPersist.listeElementsCalculTransitoire.add(dao);
}
Deleted: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingActionsTopComponent.form
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingActionsTopComponent.form 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingActionsTopComponent.form 2012-09-28 18:51:59 UTC (rev 7678)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
- <AuxValues>
- <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
- <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
- <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
- <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
- <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
- <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
- <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
- <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
- </AuxValues>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
-</Form>
Deleted: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingActionsTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingActionsTopComponent.java 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingActionsTopComponent.java 2012-09-28 18:51:59 UTC (rev 7678)
@@ -1,147 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.fudaa.fudaa.crue.modelling;
-
-import javax.swing.ActionMap;
-import javax.swing.BorderFactory;
-import org.apache.commons.lang.StringUtils;
-import org.fudaa.dodico.crue.metier.emh.EMHScenario;
-import org.fudaa.fudaa.crue.common.node.NodeHelper;
-import org.fudaa.fudaa.crue.modelling.global.GlobalActionChildFactory;
-import org.fudaa.fudaa.crue.modelling.global.GlobalContainerNode;
-import org.fudaa.fudaa.crue.modelling.services.ScenarioModificationEvent;
-import org.openide.util.NbBundle;
-import org.openide.windows.TopComponent;
-import org.netbeans.api.settings.ConvertAsProperties;
-import org.openide.awt.ActionID;
-import org.openide.awt.ActionReference;
-import org.openide.explorer.ExplorerManager;
-import org.openide.explorer.ExplorerUtils;
-import org.openide.explorer.view.OutlineView;
-import org.openide.nodes.Node;
-import org.openide.util.LookupListener;
-
-/**
- * Top component which displays something.
- */
-@ConvertAsProperties(dtd = "-//org.fudaa.fudaa.crue.modelling//ModellingActionsTopComponent//EN",
-autostore = false)
-@TopComponent.Description(preferredID = ModellingActionsTopComponent.TOPCOMPONENT_ID,
-iconBase = "org/fudaa/fudaa/crue/modelling/rond-orange_16.png",
-persistenceType = TopComponent.PERSISTENCE_ALWAYS)
-@TopComponent.Registration(mode = "modelling-topLeft", openAtStartup = false, position = 1)
-@ActionID(category = "Window", id = "org.fudaa.fudaa.crue.modelling.ModellingActionsTopComponent")
-@ActionReference(path = "Menu/Window/Modelling",position=4)
-@TopComponent.OpenActionRegistration(displayName = ModellingActionsTopComponent.TOPCOMPONENT_ACTION_DISPLAYNAME,
-preferredID = ModellingActionsTopComponent.TOPCOMPONENT_ID)
-public final class ModellingActionsTopComponent extends AbstractModellingTopComponent implements LookupListener, ExplorerManager.Provider {
-
- public static final String TOPCOMPONENT_ID = "ModellingActionsTopComponent";
- public static final String TOPCOMPONENT_ACTION = "CTL_" + TOPCOMPONENT_ID;
- public static final String TOPCOMPONENT_ACTION_DISPLAYNAME = "#" + TOPCOMPONENT_ACTION;
- private final ExplorerManager em = new ExplorerManager();
- private org.openide.explorer.view.OutlineView outlineView;
-
- public ModellingActionsTopComponent() {
- initComponents();
- setName(NbBundle.getMessage(ModellingActionsTopComponent.class, TOPCOMPONENT_ACTION));
- setToolTipText(NbBundle.getMessage(ModellingActionsTopComponent.class, "HINT_" + TOPCOMPONENT_ID));
- outlineView = new OutlineView();
- outlineView.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0));
- outlineView.getOutline().setRootVisible(false);
- outlineView.getOutline().setFullyNonEditable(true);
- outlineView.getOutline().setFillsViewportHeight(true);
- outlineView.getOutline().setColumnHidingAllowed(false);
- outlineView.addPropertyColumn(GlobalContainerNode.PROP_VISIBILITY, StringUtils.EMPTY);
- add(outlineView);
- outlineView.getOutline().getColumnModel().getColumn(1).setWidth(20);
- outlineView.getOutline().getColumnModel().getColumn(1).setPreferredWidth(20);
- ActionMap map = this.getActionMap();
- associateLookup(ExplorerUtils.createLookup(em, map));
- }
-
- @Override
- public ExplorerManager getExplorerManager() {
- return em;
- }
-
- @Override
- protected void setEditable(boolean b) {
- }
-
- @Override
- protected void componentActivated() {
- super.componentActivated();
- ExplorerUtils.activateActions(em, true);
- }
-
- @Override
- protected void componentDeactivated() {
- super.componentDeactivated();
- ExplorerUtils.activateActions(em, false);
- }
-
- @Override
- public void cancelModification() {
- }
-
- @Override
- public void valideModification() {
- }
-
- /**
- * WARN: A utiliser uniquement pour les tests
- */
- protected void testScenarioLoaded(EMHScenario scenario) {
- em.setRootContext(GlobalActionChildFactory.createGlobalActionsNode(scenario));
- }
-
- @Override
- protected void scenarioLoaded() {
- em.setRootContext(GlobalActionChildFactory.createGlobalActionsNode(getModellingService().getScenarioLoaded()));
- NodeHelper.expandAll(em, outlineView);
- }
-
- @Override
- protected void scenarioReloaded() {
- scenarioLoaded();
- }
-
- @Override
- protected void scenarioChanged(ScenarioModificationEvent event) {
-// scenarioReloaded();
- }
-
- @Override
- protected void scenarioUnloaded() {
- em.setRootContext(Node.EMPTY);
- }
-
- /**
- * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
- * regenerated by the Form Editor.
- */
- // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
- private void initComponents() {
-
- setLayout(new java.awt.BorderLayout());
- }// </editor-fold>//GEN-END:initComponents
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- // End of variables declaration//GEN-END:variables
- @Override
- public void componentClosedTemporarily() {
- }
-
- void writeProperties(java.util.Properties p) {
- // better to version settings since initial version as advocated at
- // http://wiki.apidesign.org/wiki/PropertyFiles
- p.setProperty("version", "1.0");
- }
-
- void readProperties(java.util.Properties p) {
- String version = p.getProperty("version");
- }
-}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingComputeDataTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingComputeDataTopComponent.java 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingComputeDataTopComponent.java 2012-09-28 18:51:59 UTC (rev 7678)
@@ -204,6 +204,7 @@
NodeHelper.expandAll(getExplorerManager(), outlineView);
helper.addListener(true);
helper.getNodeListener().setModifiedInArborescenceChanged(true);
+ helper.getNodeListener().setModifiedIfDisplayNameChanged(false);
}
@Override
Copied: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingContainersTopComponent.form (from rev 7523, trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingActionsTopComponent.form)
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingContainersTopComponent.form (rev 0)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingContainersTopComponent.form 2012-09-28 18:51:59 UTC (rev 7678)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
+ </AuxValues>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+</Form>
Copied: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingContainersTopComponent.java (from rev 7638, trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingActionsTopComponent.java)
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingContainersTopComponent.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingContainersTopComponent.java 2012-09-28 18:51:59 UTC (rev 7678)
@@ -0,0 +1,147 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.fudaa.fudaa.crue.modelling;
+
+import javax.swing.ActionMap;
+import javax.swing.BorderFactory;
+import org.apache.commons.lang.StringUtils;
+import org.fudaa.dodico.crue.metier.emh.EMHScenario;
+import org.fudaa.fudaa.crue.common.node.NodeHelper;
+import org.fudaa.fudaa.crue.modelling.global.GlobalActionChildFactory;
+import org.fudaa.fudaa.crue.modelling.global.GlobalContainerNode;
+import org.fudaa.fudaa.crue.modelling.services.ScenarioModificationEvent;
+import org.openide.util.NbBundle;
+import org.openide.windows.TopComponent;
+import org.netbeans.api.settings.ConvertAsProperties;
+import org.openide.awt.ActionID;
+import org.openide.awt.ActionReference;
+import org.openide.explorer.ExplorerManager;
+import org.openide.explorer.ExplorerUtils;
+import org.openide.explorer.view.OutlineView;
+import org.openide.nodes.Node;
+import org.openide.util.LookupListener;
+
+/**
+ * Top component which displays something.
+ */
+@ConvertAsProperties(dtd = "-//org.fudaa.fudaa.crue.modelling//ModellingContainersTopComponent//EN",
+autostore = false)
+@TopComponent.Description(preferredID = ModellingContainersTopComponent.TOPCOMPONENT_ID,
+iconBase = "org/fudaa/fudaa/crue/modelling/rond-orange_16.png",
+persistenceType = TopComponent.PERSISTENCE_ALWAYS)
+@TopComponent.Registration(mode = "modelling-topLeft", openAtStartup = false, position = 1)
+@ActionID(category = "Window", id = "org.fudaa.fudaa.crue.modelling.ModellingActionsTopComponent")
+@ActionReference(path = "Menu/Window/Modelling", position = 4)
+@TopComponent.OpenActionRegistration(displayName = ModellingContainersTopComponent.TOPCOMPONENT_ACTION_DISPLAYNAME,
+preferredID = ModellingContainersTopComponent.TOPCOMPONENT_ID)
+public final class ModellingContainersTopComponent extends AbstractModellingTopComponent implements LookupListener, ExplorerManager.Provider {
+
+ public static final String TOPCOMPONENT_ID = "ModellingContainersTopComponent";
+ public static final String TOPCOMPONENT_ACTION = "CTL_" + TOPCOMPONENT_ID;
+ public static final String TOPCOMPONENT_ACTION_DISPLAYNAME = "#" + TOPCOMPONENT_ACTION;
+ private final ExplorerManager em = new ExplorerManager();
+ private org.openide.explorer.view.OutlineView outlineView;
+
+ public ModellingContainersTopComponent() {
+ initComponents();
+ setName(NbBundle.getMessage(ModellingContainersTopComponent.class, TOPCOMPONENT_ACTION));
+ setToolTipText(NbBundle.getMessage(ModellingContainersTopComponent.class, "HINT_" + TOPCOMPONENT_ID));
+ outlineView = new OutlineView(NbBundle.getMessage(ModellingContainersTopComponent.class, "ModellingContainersTopComponent.ColumnName"));
+ outlineView.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0));
+ outlineView.getOutline().setRootVisible(false);
+ outlineView.getOutline().setFullyNonEditable(true);
+ outlineView.getOutline().setFillsViewportHeight(true);
+ outlineView.getOutline().setColumnHidingAllowed(false);
+ outlineView.addPropertyColumn(GlobalContainerNode.PROP_VISIBILITY, NbBundle.getMessage(ModellingContainersTopComponent.class, "ModellingContainersTopComponent.ColumnVisible"));
+ add(outlineView);
+ outlineView.getOutline().getColumnModel().getColumn(1).setWidth(20);
+ outlineView.getOutline().getColumnModel().getColumn(1).setPreferredWidth(20);
+ ActionMap map = this.getActionMap();
+ associateLookup(ExplorerUtils.createLookup(em, map));
+ }
+
+ @Override
+ public ExplorerManager getExplorerManager() {
+ return em;
+ }
+
+ @Override
+ protected void setEditable(boolean b) {
+ }
+
+ @Override
+ protected void componentActivated() {
+ super.componentActivated();
+ ExplorerUtils.activateActions(em, true);
+ }
+
+ @Override
+ protected void componentDeactivated() {
+ super.componentDeactivated();
+ ExplorerUtils.activateActions(em, false);
+ }
+
+ @Override
+ public void cancelModification() {
+ }
+
+ @Override
+ public void valideModification() {
+ }
+
+ /**
+ * WARN: A utiliser uniquement pour les tests
+ */
+ protected void testScenarioLoaded(EMHScenario scenario) {
+ em.setRootContext(GlobalActionChildFactory.createGlobalContainerNode(scenario));
+ }
+
+ @Override
+ protected void scenarioLoaded() {
+ em.setRootContext(GlobalActionChildFactory.createGlobalContainerNode(getModellingService().getScenarioLoaded()));
+ NodeHelper.expandAll(em, outlineView);
+ }
+
+ @Override
+ protected void scenarioReloaded() {
+ scenarioLoaded();
+ }
+
+ @Override
+ protected void scenarioChanged(ScenarioModificationEvent event) {
+// scenarioReloaded();
+ }
+
+ @Override
+ protected void scenarioUnloaded() {
+ em.setRootContext(Node.EMPTY);
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ setLayout(new java.awt.BorderLayout());
+ }// </editor-fold>//GEN-END:initComponents
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ // End of variables declaration//GEN-END:variables
+ @Override
+ public void componentClosedTemporarily() {
+ }
+
+ void writeProperties(java.util.Properties p) {
+ // better to version settings since initial version as advocated at
+ // http://wiki.apidesign.org/wiki/PropertyFiles
+ p.setProperty("version", "1.0");
+ }
+
+ void readProperties(java.util.Properties p) {
+ String version = p.getProperty("version");
+ }
+}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/CalculAddDclmNodeAction.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/CalculAddDclmNodeAction.java 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/calcul/CalculAddDclmNodeAction.java 2012-09-28 18:51:59 UTC (rev 7678)
@@ -72,7 +72,7 @@
pn.add(cbEMH);
updateComboBox(scenario, cbEMH, (CalcBuilder) cb.getSelectedItem());
final DialogDescriptor descriptor = new DialogDescriptor(pn, getName());
- descriptor.setValid(false);
+
cb.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
@@ -86,6 +86,7 @@
descriptor.setValid(cb.getSelectedItem() != null && cbEMH.getSelectedItem() != null);
}
});
+ descriptor.setValid(cb.getSelectedItem() != null && cbEMH.getSelectedItem() != null);
Dialog dialog = DialogDisplayer.getDefault().createDialog(descriptor);
dialog.pack();
dialog.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/global/GlobalActionChildFactory.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/global/GlobalActionChildFactory.java 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/global/GlobalActionChildFactory.java 2012-09-28 18:51:59 UTC (rev 7678)
@@ -25,7 +25,7 @@
return new GlobalContainerNode.EMHModeleNode(NodeChildrenHelper.createChildren(child), modele);
}
- public static Node createGlobalActionsNode(EMHScenario scenario) {
+ public static Node createGlobalContainerNode(EMHScenario scenario) {
GlobalContainerNode scenarioNode = createScenarioNode(scenario);
List<Node> main = new ArrayList<Node>();
main.add(scenarioNode);
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/listener/NodeInternChangedListener.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/listener/NodeInternChangedListener.java 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/listener/NodeInternChangedListener.java 2012-09-28 18:51:59 UTC (rev 7678)
@@ -22,11 +22,20 @@
private AbstractModellingTopComponent target;
boolean modifiedInArborescenceChanged = false;
+ boolean modifiedIfDisplayNameChanged = false;
public NodeInternChangedListener(AbstractModellingTopComponent target) {
this.target = target;
}
+ public boolean isModifiedIfDisplayNameChanged() {
+ return modifiedIfDisplayNameChanged;
+ }
+
+ public void setModifiedIfDisplayNameChanged(boolean modifiedIfDisplayNameChanged) {
+ this.modifiedIfDisplayNameChanged = modifiedIfDisplayNameChanged;
+ }
+
public boolean isModifiedInArborescenceChanged() {
return modifiedInArborescenceChanged;
}
@@ -37,8 +46,10 @@
@Override
public void propertyChange(PropertyChangeEvent evt) {
- if (Node.PROP_DISPLAY_NAME.equals(evt.getPropertyName())) {
- target.setModified(true);
+ if (modifiedIfDisplayNameChanged) {
+ if (Node.PROP_DISPLAY_NAME.equals(evt.getPropertyName())) {
+ target.setModified(true);
+ }
}
}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/perspective/PerspectiveServiceModelling.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/perspective/PerspectiveServiceModelling.java 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/perspective/PerspectiveServiceModelling.java 2012-09-28 18:51:59 UTC (rev 7678)
@@ -19,7 +19,7 @@
import org.fudaa.fudaa.crue.common.services.PerspectiveService;
import org.fudaa.fudaa.crue.common.services.PerspectiveState;
import org.fudaa.fudaa.crue.modelling.AbstractModellingTopComponent;
-import org.fudaa.fudaa.crue.modelling.ModellingActionsTopComponent;
+import org.fudaa.fudaa.crue.modelling.ModellingContainersTopComponent;
import org.fudaa.fudaa.crue.modelling.ModellingComputeDataTopComponent;
import org.fudaa.fudaa.crue.modelling.ModellingCtuluLogTopComponent;
import org.fudaa.fudaa.crue.modelling.ModellingFilesTopComponent;
@@ -47,7 +47,7 @@
public class PerspectiveServiceModelling extends AbstractPerspectiveService {
private final Set<String> components = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(
- ModellingActionsTopComponent.TOPCOMPONENT_ID,
+ ModellingContainersTopComponent.TOPCOMPONENT_ID,
ModellingComputeDataTopComponent.TOPCOMPONENT_ID,
ModellingFilesTopComponent.TOPCOMPONENT_ID,
ModellingPropertiesTopComponent.TOPCOMPONENT_ID,
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/Bundle.properties
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/Bundle.properties 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/Bundle.properties 2012-09-28 18:51:59 UTC (rev 7678)
@@ -17,8 +17,10 @@
HINT_ModellingComputeDataTopComponent=Donn\u00e9es des calculs
emhTopComponent.NoScenarioLoadedInformations=<Vide>
SaveScenio.Bilan.DialogTitle=Sauvegarde du sc\u00e9nario {0}
-CTL_ModellingActionsTopComponent=Gestionnaire de conteneurs
-HINT_ModellingActionsTopComponent=Gestionnaire de conteneurs
+
+CTL_ModellingContainersTopComponent=Gestionnaire de conteneurs
+HINT_ModellingContainersTopComponent=Gestionnaire de conteneurs
+ModellingContainersTopComponent.ColumnName=Conteneur
CTL_ModellingFilesTopComponent=Gestionnaire de calques
HINT_ModellingFilesTopComponent=Gestionnaire de calques
CTL_ModellingPropertiesTopComponent=Propri\u00e9t\u00e9s
@@ -37,3 +39,4 @@
NodeEMHNoeud.TypeDescription.Name=Description
AddCalcTransitoire.Menu=Ajouter un calcul transitoire
AddCalcPseudoPerm.Menu=Ajouter un calcul pseudo-permanent
+ModellingContainersTopComponent.ColumnVisible=Visible
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/layer.xml 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/layer.xml 2012-09-28 18:51:59 UTC (rev 7678)
@@ -2,7 +2,17 @@
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
- <folder name="Menu">
+ <folder name="Actions">
+ <folder name="Window">
+ <file name="org-fudaa-fudaa-crue-modelling-ModellingActionsTopComponent.instance_hidden"/>
+ <file name="org-fudaa-fudaa-crue-modelling-ModellingContainersTopComponent.instance">
+ <attr name="iconBase" stringvalue="org/fudaa/fudaa/crue/modelling/rond-orange_16.png"/>
+ <attr name="instanceCreate" methodvalue="org.openide.windows.TopComponent.openAction"/>
+ <attr name="preferredID" stringvalue="ModellingActionsTopComponent"/>
+ </file>
+ </folder>
+ </folder>
+ <folder name="Menu">
<!-- <folder name="Modelling">
<attr name="displayName" bundlevalue="org.fudaa.fudaa.crue.modelling.Bundle#Menu/Modelling"/>
<attr name="position" intvalue="5"/>
Modified: trunk/soft/fudaa-crue/ui-modelling/src/test/java/org/fudaa/fudaa/crue/modelling/GlobalActionsChildFactoryTest.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/test/java/org/fudaa/fudaa/crue/modelling/GlobalActionsChildFactoryTest.java 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-modelling/src/test/java/org/fudaa/fudaa/crue/modelling/GlobalActionsChildFactoryTest.java 2012-09-28 18:51:59 UTC (rev 7678)
@@ -14,7 +14,7 @@
public static void main(String[] args) {
EMHScenario emhScenario = ModellingTestHelper.readScenario();
- ModellingActionsTopComponent topComponent = new ModellingActionsTopComponent();
+ ModellingContainersTopComponent topComponent = new ModellingContainersTopComponent();
topComponent.testScenarioLoaded(emhScenario);
ModellingTestHelper.display(topComponent);
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerBrancheController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerBrancheController.java 2012-09-28 16:44:51 UTC (rev 7677)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerBrancheController.java 2012-09-28 18:51:59 UTC (rev 7678)
@@ -49,6 +49,7 @@
new OpenEMHAction.NewFrame(ctx),
null,
res.getSigEditAction(),
+ r...
[truncated message content] |
|
From: <de...@us...> - 2012-10-03 07:05:34
|
Revision: 7693
http://fudaa.svn.sourceforge.net/fudaa/?rev=7693&view=rev
Author: deniger
Date: 2012-10-03 07:05:27 +0000 (Wed, 03 Oct 2012)
Log Message:
-----------
incr?\195?\169ment version
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/pom.xml
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/projet/coeur/CoeurManagerValidator.java
trunk/soft/fudaa-crue/crue-sysdoc/pom.xml
trunk/soft/fudaa-crue/crue-test/pom.xml
trunk/soft/fudaa-crue/pom.xml
trunk/soft/fudaa-crue/ui-application/pom.xml
trunk/soft/fudaa-crue/ui-application/src/main/resources/etc/fudaacrue.conf
trunk/soft/fudaa-crue/ui-application/src/main/resources/etc/fudaacrueDev.conf
trunk/soft/fudaa-crue/ui-branding/pom.xml
trunk/soft/fudaa-crue/ui-commandline/pom.xml
trunk/soft/fudaa-crue/ui-common/pom.xml
trunk/soft/fudaa-crue/ui-comparison/pom.xml
trunk/soft/fudaa-crue/ui-emh/pom.xml
trunk/soft/fudaa-crue/ui-loader/pom.xml
trunk/soft/fudaa-crue/ui-loi/pom.xml
trunk/soft/fudaa-crue/ui-modelling/pom.xml
trunk/soft/fudaa-crue/ui-options/pom.xml
trunk/soft/fudaa-crue/ui-otfa/pom.xml
trunk/soft/fudaa-crue/ui-planimetry/pom.xml
trunk/soft/fudaa-crue/ui-post/pom.xml
trunk/soft/fudaa-crue/ui-report/pom.xml
trunk/soft/fudaa-crue/ui-study/pom.xml
trunk/soft/fudaa-crue/ui-wrapper/pom.xml
Modified: trunk/soft/fudaa-crue/crue-server/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/crue-server/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/crue-server/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>crue-server</artifactId>
<name>Crue server</name>
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/projet/coeur/CoeurManagerValidator.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/projet/coeur/CoeurManagerValidator.java 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/projet/coeur/CoeurManagerValidator.java 2012-10-03 07:05:27 UTC (rev 7693)
@@ -69,8 +69,6 @@
File toTest = new File(folder, FILE_CRUE_CONFIG_METIER_XML);
if (!toTest.isFile()) {
log.addSevereError("coeur.validator.fileNotFound", toTest.getAbsolutePath());
- } else {
- //TODO Tester si CrueConfigMetier.xml.
}
toTest = new File(folder, FOLDER_EXE);
@@ -87,18 +85,14 @@
toTest = new File(folder, FOLDER_FICHIERS_VIERGES);
if (!toTest.isDirectory()) {
log.addSevereError("coeur.validator.directoryNotFound", toTest.getAbsolutePath());
- } else {
- //TODO Tester si version fichiers correcte.
}
toTest = new File(folder, FOLDER_XSD);
if (!toTest.isDirectory()) {
log.addSevereError("coeur.validator.directoryNotFound", toTest.getAbsolutePath());
- } else {
- //TODO Tester si complet.
}
- toTest=new File(folder,FOLDER_MESSAGES);
- if(!toTest.isDirectory()){
+ toTest = new File(folder, FOLDER_MESSAGES);
+ if (!toTest.isDirectory()) {
log.addWarn("coeur.validator.messageDirectoryNotFound", toTest.getAbsolutePath());
}
}
Modified: trunk/soft/fudaa-crue/crue-sysdoc/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/crue-sysdoc/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/crue-sysdoc/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>crue-sysdoc</artifactId>
<name>Crue Sysdoc</name>
Modified: trunk/soft/fudaa-crue/crue-test/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/crue-test/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/crue-test/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<artifactId>fudaa-crue</artifactId>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>crue-test</artifactId>
Modified: trunk/soft/fudaa-crue/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -8,7 +8,7 @@
</parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
<name>Fudaa-Crue</name>
<packaging>pom</packaging>
<ciManagement>
Modified: trunk/soft/fudaa-crue/ui-application/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-application/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-application/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>application</artifactId>
Modified: trunk/soft/fudaa-crue/ui-application/src/main/resources/etc/fudaacrue.conf
===================================================================
--- trunk/soft/fudaa-crue/ui-application/src/main/resources/etc/fudaacrue.conf 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-application/src/main/resources/etc/fudaacrue.conf 2012-10-03 07:05:27 UTC (rev 7693)
@@ -1,6 +1,6 @@
# ${HOME} will be replaced by user home directory according to platform
-default_userdir="${HOME}/.${APPNAME}/0.60/"
-default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/0.60/"
+default_userdir="${HOME}/.${APPNAME}/0.61/"
+default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/0.61/"
# options used by the launcher by default, can be overridden by explicit
# command line switches
Modified: trunk/soft/fudaa-crue/ui-application/src/main/resources/etc/fudaacrueDev.conf
===================================================================
--- trunk/soft/fudaa-crue/ui-application/src/main/resources/etc/fudaacrueDev.conf 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-application/src/main/resources/etc/fudaacrueDev.conf 2012-10-03 07:05:27 UTC (rev 7693)
@@ -1,6 +1,6 @@
# ${HOME} will be replaced by user home directory according to platform
-default_userdir="${HOME}/.${APPNAME}/0.53/"
-default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/0.53/"
+default_userdir="${HOME}/.${APPNAME}/0.61/"
+default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/0.61/"
# options used by the launcher by default, can be overridden by explicit
# command line switches
Modified: trunk/soft/fudaa-crue/ui-branding/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-branding/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-branding/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-branding</artifactId>
Modified: trunk/soft/fudaa-crue/ui-commandline/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-commandline/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-commandline/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-commandline</artifactId>
<packaging>nbm</packaging>
Modified: trunk/soft/fudaa-crue/ui-common/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-common/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-common/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<artifactId>fudaa-crue</artifactId>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-common</artifactId>
Modified: trunk/soft/fudaa-crue/ui-comparison/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-comparison/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-comparison/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<artifactId>fudaa-crue</artifactId>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-comparison</artifactId>
<packaging>nbm</packaging>
Modified: trunk/soft/fudaa-crue/ui-emh/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-emh/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-emh</artifactId>
<packaging>nbm</packaging>
Modified: trunk/soft/fudaa-crue/ui-loader/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-loader/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-loader/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<artifactId>fudaa-crue</artifactId>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-loader</artifactId>
<packaging>nbm</packaging>
Modified: trunk/soft/fudaa-crue/ui-loi/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-loi/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<artifactId>fudaa-crue</artifactId>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-loi</artifactId>
Modified: trunk/soft/fudaa-crue/ui-modelling/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-modelling/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<packaging>nbm</packaging>
<artifactId>ui-modelling</artifactId>
Modified: trunk/soft/fudaa-crue/ui-options/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-options/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-options/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-options</artifactId>
<name>Crue UI Options</name>
Modified: trunk/soft/fudaa-crue/ui-otfa/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-otfa/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-otfa/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<artifactId>fudaa-crue</artifactId>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-otfa</artifactId>
Modified: trunk/soft/fudaa-crue/ui-planimetry/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-planimetry/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<artifactId>fudaa-crue</artifactId>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<packaging>nbm</packaging>
<artifactId>ui-planimetry</artifactId>
Modified: trunk/soft/fudaa-crue/ui-post/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-post/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-post/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<packaging>nbm</packaging>
<artifactId>ui-post</artifactId>
Modified: trunk/soft/fudaa-crue/ui-report/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-report/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-report/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-report</artifactId>
Modified: trunk/soft/fudaa-crue/ui-study/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-study/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-study/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>fudaa-crue</artifactId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<packaging>nbm</packaging>
<artifactId>ui-study</artifactId>
Modified: trunk/soft/fudaa-crue/ui-wrapper/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-wrapper/pom.xml 2012-10-02 21:07:51 UTC (rev 7692)
+++ trunk/soft/fudaa-crue/ui-wrapper/pom.xml 2012-10-03 07:05:27 UTC (rev 7693)
@@ -4,7 +4,7 @@
<parent>
<artifactId>fudaa-crue</artifactId>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
- <version>0.60-SNAPSHOT</version>
+ <version>0.61-SNAPSHOT</version>
</parent>
<artifactId>ui-wrapper</artifactId>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-10-05 22:45:21
|
Revision: 7723
http://fudaa.svn.sourceforge.net/fudaa/?rev=7723&view=rev
Author: deniger
Date: 2012-10-05 22:45:14 +0000 (Fri, 05 Oct 2012)
Log Message:
-----------
support fichier externe
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/config/ConfigSaverHelper.java
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/config/ConfigurationInfoHelper.java
trunk/soft/fudaa-crue/ui-common/src/test/java/org/fudaa/fudaa/crue/common/helper/PropertyToStringTransformerTest.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/save/LayerControllerSaverHelper.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/save/LayerImageControllerSaver.java
Removed Paths:
-------------
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/PropertyToStringTransformer.java
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/config/ConfigSaverHelper.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/config/ConfigSaverHelper.java 2012-10-05 22:41:30 UTC (rev 7722)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/config/ConfigSaverHelper.java 2012-10-05 22:45:14 UTC (rev 7723)
@@ -5,7 +5,8 @@
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.fudaa.fudaa.crue.common.helper.PropertyToStringTransformer;
+import org.fudaa.ctulu.converter.AbstractPropertyToStringTransformer;
+import org.fudaa.ctulu.converter.ToStringTransformerFactory;
import org.openide.nodes.Node;
import org.openide.nodes.Node.Property;
import org.openide.nodes.Sheet;
@@ -61,12 +62,12 @@
public static LinkedHashMap<String, String> transform(LinkedHashMap<String, Property> in) {
LinkedHashMap<String, String> res = new LinkedHashMap<String, String>();
- Map<Class, PropertyToStringTransformer> createTransformers = PropertyToStringTransformer.createTransformers();
+ Map<Class, AbstractPropertyToStringTransformer> createTransformers = ToStringTransformerFactory.createTransformers();
for (Map.Entry<String, Property> entry : in.entrySet()) {
String string = entry.getKey();
Property property = entry.getValue();
final Class valueType = property.getValueType();
- PropertyToStringTransformer transformer = createTransformers.get(valueType);
+ AbstractPropertyToStringTransformer transformer = createTransformers.get(valueType);
if (transformer == null) {
Logger.getLogger(ConfigSaverHelper.class.getName()).log(Level.SEVERE, "no transformer for {0}", valueType);
}
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/config/ConfigurationInfoHelper.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/config/ConfigurationInfoHelper.java 2012-10-05 22:41:30 UTC (rev 7722)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/config/ConfigurationInfoHelper.java 2012-10-05 22:45:14 UTC (rev 7723)
@@ -6,7 +6,8 @@
import org.fudaa.ctulu.CtuluLog;
import org.fudaa.ctulu.CtuluLogLevel;
import org.fudaa.dodico.crue.common.BusinessMessages;
-import org.fudaa.fudaa.crue.common.helper.PropertyToStringTransformer;
+import org.fudaa.ctulu.converter.AbstractPropertyToStringTransformer;
+import org.fudaa.ctulu.converter.ToStringTransformerFactory;
import org.fudaa.fudaa.crue.common.property.PropertyCrueUtils;
import org.openide.nodes.Node.Property;
import org.openide.nodes.PropertySupport;
@@ -48,7 +49,7 @@
public static CtuluLog setAndValidReadProperties(Map<String, String> properties, LinkedHashMap<String, Property> initProperties, CtuluLogLevel level) {
CtuluLog log = new CtuluLog(BusinessMessages.RESOURCE_BUNDLE);
log.setDesc("configEtu.load");
- Map<Class, PropertyToStringTransformer> createTransformers = PropertyToStringTransformer.createTransformers();
+ Map<Class, AbstractPropertyToStringTransformer> createTransformers = ToStringTransformerFactory.createTransformers();
for (Map.Entry<String, String> readProperties : properties.entrySet()) {
String key = readProperties.getKey();
String value = readProperties.getValue();
@@ -56,7 +57,7 @@
if (property == null) {
log.addRecord(level, "configEtu.unknownProperty.Error", key);
} else {
- PropertyToStringTransformer transformer = createTransformers.get(property.getValueType());
+ AbstractPropertyToStringTransformer transformer = createTransformers.get(property.getValueType());
if (transformer == null) {
log.addRecord(level, "configEtu.unknownType.Error", property.getValueType());
} else if (!transformer.isValid(value)) {
Deleted: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/PropertyToStringTransformer.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/PropertyToStringTransformer.java 2012-10-05 22:41:30 UTC (rev 7722)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/helper/PropertyToStringTransformer.java 2012-10-05 22:45:14 UTC (rev 7723)
@@ -1,325 +0,0 @@
-package org.fudaa.fudaa.crue.common.helper;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.geom.Point2D;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.commons.lang.StringUtils;
-import org.openide.util.Exceptions;
-
-/**
- *
- * @author deniger ( genesis)
- */
-public abstract class PropertyToStringTransformer<T> {
-
- public String toString(T in) {
- if (in == null) {
- return "null";
- }
- return toStringSafe(in);
- }
-
- public static PropertyToStringTransformer<Point2D.Double[]> getPoint2dArrayTransformer() {
- return createTransformers().get(Point2D.Double[].class);
-
- }
-
- public static Map<Class, PropertyToStringTransformer> createTransformers() {
- Map<Class, PropertyToStringTransformer> res = new HashMap<Class, PropertyToStringTransformer>();
- res.put(String.class, new StringTransformer());
- res.put(Color.class, new ColorTransformer());
- res.put(Font.class, new FontTransformer());
- DoubleTransformer doubleTransformer = new DoubleTransformer();
- res.put(Double.TYPE, doubleTransformer);
- res.put(Double.class, doubleTransformer);
- FloatTransformer floatTransformer = new FloatTransformer();
- res.put(Float.TYPE, floatTransformer);
- res.put(Float.class, floatTransformer);
- IntegerTransformer integerTransformer = new IntegerTransformer();
- res.put(Integer.TYPE, integerTransformer);
- res.put(Integer.class, integerTransformer);
- BooleanTransformer booleanTransformer = new BooleanTransformer();
- res.put(Boolean.TYPE, booleanTransformer);
- res.put(Boolean.class, booleanTransformer);
-
- res.put(Point2D.Double.class, new Point2DDoubleTransformer());
- res.put(Point2D.Double[].class, new Point2DDoubleArrayTransformer());
- return res;
- }
-
- public abstract String toStringSafe(T in);
-
- public abstract boolean isValidSafe(String in);
-
- public boolean isValid(String in) {
- if (in == null) {
- return false;
- }
- return isValidSafe(in);
- }
-
- public T fromString(String in) {
- if (in == null || "null".equals(in)) {
- return null;
- }
- return fromStringSafe(in);
- }
-
- public abstract T fromStringSafe(String in);
-
- public static class IntegerTransformer extends PropertyToStringTransformer<Integer> {
-
- @Override
- public Integer fromStringSafe(String in) {
- try {
- return Integer.parseInt(in);
- } catch (NumberFormatException numberFormatException) {
- Exceptions.printStackTrace(numberFormatException);
- }
- return null;
- }
-
- @Override
- public boolean isValidSafe(String in) {
- try {
- Integer.parseInt(in);
- return true;
- } catch (NumberFormatException numberFormatException) {
- }
- return false;
- }
-
- @Override
- public String toStringSafe(Integer in) {
- return in.toString();
- }
- }
-
- public static class BooleanTransformer extends PropertyToStringTransformer<Boolean> {
-
- @Override
- public Boolean fromStringSafe(String in) {
- try {
- return Boolean.valueOf(in);
- } catch (NumberFormatException numberFormatException) {
- Exceptions.printStackTrace(numberFormatException);
- }
- return null;
- }
-
- @Override
- public boolean isValidSafe(String in) {
- return "false".equals(in) || "true".equals(in);
- }
-
- @Override
- public String toStringSafe(Boolean in) {
- return in.toString();
- }
- }
-
- public static class Point2DDoubleTransformer extends PropertyToStringTransformer<Point2D.Double> {
-
- @Override
- public Point2D.Double fromStringSafe(String in) {
- String[] split = StringUtils.split(in, ' ');
- if (split != null && split.length == 2) {
- try {
- double x = Double.parseDouble(split[0]);
- double y = Double.parseDouble(split[1]);
- return new Point2D.Double(x, y);
- } catch (NumberFormatException numberFormatException) {
- Exceptions.printStackTrace(numberFormatException);
- }
-
- }
- return null;
- }
-
- @Override
- public boolean isValidSafe(String in) {
- return fromString(in) != null;
- }
-
- @Override
- public String toStringSafe(Point2D.Double in) {
- return in.getX() + " " + in.getY();
- }
- }
-
- public static class Point2DDoubleArrayTransformer extends PropertyToStringTransformer<Point2D.Double[]> {
-
- @Override
- public Point2D.Double[] fromStringSafe(String in) {
- Point2DDoubleTransformer elemTransformer = new Point2DDoubleTransformer();
- String[] splitArray = StringUtils.split(in, ';');
- Point2D.Double[] res = new Point2D.Double[splitArray.length];
- int idx = 0;
- for (String item : splitArray) {
- Point2D.Double fromString = elemTransformer.fromString(item);
- if (fromString == null) {
- return null;
- }
- res[idx++] = fromString;
- }
- return res;
- }
-
- @Override
- public boolean isValidSafe(String in) {
- return fromString(in) != null;
- }
-
- @Override
- public String toStringSafe(Point2D.Double[] in) {
- Point2DDoubleTransformer elemTransformer = new Point2DDoubleTransformer();
- StringBuilder builder = new StringBuilder();
- boolean first = true;
- for (Point2D.Double doubleValue : in) {
- if (!first) {
- builder.append(';');
- }
- first = false;
- builder.append(elemTransformer.toString(doubleValue));
-
- }
- return builder.toString();
- }
- }
-
- public static class DoubleTransformer extends PropertyToStringTransformer<Double> {
-
- @Override
- public Double fromStringSafe(String in) {
- try {
- return Double.parseDouble(in);
- } catch (NumberFormatException numberFormatException) {
- Exceptions.printStackTrace(numberFormatException);
- }
- return null;
- }
-
- @Override
- public boolean isValidSafe(String in) {
- try {
- Double.parseDouble(in);
- return true;
- } catch (NumberFormatException numberFormatException) {
- }
- return false;
- }
-
- @Override
- public String toStringSafe(Double in) {
- return in.toString();
- }
- }
-
- public static class FloatTransformer extends PropertyToStringTransformer<Float> {
-
- @Override
- public Float fromStringSafe(String in) {
- try {
- return Float.parseFloat(in);
- } catch (NumberFormatException numberFormatException) {
- Exceptions.printStackTrace(numberFormatException);
- }
- return null;
- }
-
- @Override
- public boolean isValidSafe(String in) {
- try {
- Float.parseFloat(in);
- return true;
- } catch (NumberFormatException numberFormatException) {
- }
- return false;
- }
-
- @Override
- public String toStringSafe(Float in) {
- return in.toString();
- }
- }
-
- public static class ColorTransformer extends PropertyToStringTransformer<Color> {
-
- @Override
- public Color fromStringSafe(String in) {
- String[] split = StringUtils.split(in, ',');
- if (split.length != 3) {
- return null;
- }
- try {
- int r = Integer.parseInt(split[0]);
- int g = Integer.parseInt(split[1]);
- int b = Integer.parseInt(split[2]);
- return new Color(r, g, b);
- } catch (Exception exception) {
- Exceptions.printStackTrace(exception);
- }
- return null;
- }
-
- @Override
- public String toStringSafe(Color in) {
- return in.getRed() + "," + in.getGreen() + "," + in.getBlue();
- }
-
- @Override
- public boolean isValidSafe(String in) {
- return fromString(in) != null;
- }
- }
-
- public static class FontTransformer extends PropertyToStringTransformer<Font> {
-
- @Override
- public Font fromStringSafe(String in) {
- String[] split = StringUtils.split(in, ',');
- if (split.length != 3) {
- return null;
- }
- try {
- String family = split[0];
- int type = Integer.parseInt(split[1]);
- int size = Integer.parseInt(split[2]);
- return new Font(family, type, size);
- } catch (Exception exception) {
- Exceptions.printStackTrace(exception);
- }
- return null;
- }
-
- @Override
- public String toStringSafe(Font in) {
- return in.getFamily() + "," + in.getStyle() + "," + in.getSize();
- }
-
- @Override
- public boolean isValidSafe(String in) {
- return fromString(in) != null;
- }
- }
-
- public static class StringTransformer extends PropertyToStringTransformer<String> {
-
- @Override
- public String fromStringSafe(String in) {
- return in;
- }
-
- @Override
- public String toStringSafe(String in) {
- return in;
- }
-
- @Override
- public boolean isValidSafe(String in) {
- return true;
- }
- }
-}
Modified: trunk/soft/fudaa-crue/ui-common/src/test/java/org/fudaa/fudaa/crue/common/helper/PropertyToStringTransformerTest.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/test/java/org/fudaa/fudaa/crue/common/helper/PropertyToStringTransformerTest.java 2012-10-05 22:41:30 UTC (rev 7722)
+++ trunk/soft/fudaa-crue/ui-common/src/test/java/org/fudaa/fudaa/crue/common/helper/PropertyToStringTransformerTest.java 2012-10-05 22:45:14 UTC (rev 7723)
@@ -1,7 +1,9 @@
package org.fudaa.fudaa.crue.common.helper;
+import org.fudaa.ctulu.converter.AbstractPropertyToStringTransformer;
import java.awt.geom.Point2D;
import java.util.Map;
+import org.fudaa.ctulu.converter.ToStringTransformerFactory;
import org.junit.Test;
import static org.junit.Assert.*;
@@ -16,8 +18,8 @@
@Test
public void testToStringPoint2D() {
- Map<Class, PropertyToStringTransformer> createTransformers = PropertyToStringTransformer.createTransformers();
- PropertyToStringTransformer transformer = createTransformers.get(String.class);
+ Map<Class, AbstractPropertyToStringTransformer> createTransformers = ToStringTransformerFactory.createTransformers();
+ AbstractPropertyToStringTransformer transformer = createTransformers.get(String.class);
assertNotNull(transformer);
transformer = createTransformers.get(Point2D.Double.class);
assertNotNull(transformer);
@@ -32,7 +34,7 @@
@Test
public void testToStringPoint2DArray() {
- PropertyToStringTransformer<Point2D.Double[]> transformer = PropertyToStringTransformer.getPoint2dArrayTransformer();
+ AbstractPropertyToStringTransformer<Point2D.Double[]> transformer = ToStringTransformerFactory.getPoint2dArrayTransformer();
assertNotNull(transformer);
Point2D.Double pt = new Point2D.Double();
pt.setLocation(100, 120);
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/save/LayerControllerSaverHelper.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/save/LayerControllerSaverHelper.java 2012-10-05 22:41:30 UTC (rev 7722)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/save/LayerControllerSaverHelper.java 2012-10-05 22:45:14 UTC (rev 7723)
@@ -15,7 +15,8 @@
import org.fudaa.ebli.calque.BCalque;
import org.fudaa.fudaa.crue.common.config.ConfigSaverHelper;
import org.fudaa.fudaa.crue.common.helper.CtuluUIForNetbeans;
-import org.fudaa.fudaa.crue.common.helper.PropertyToStringTransformer;
+import org.fudaa.ctulu.converter.AbstractPropertyToStringTransformer;
+import org.fudaa.ctulu.converter.ToStringTransformerFactory;
import org.fudaa.fudaa.crue.planimetry.action.SigFormatHelper;
import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryAdditionalLayerContrat;
import org.fudaa.fudaa.sig.wizard.FSigFileLoadResult;
@@ -37,14 +38,14 @@
public static void restorVisibleProperty(Map<String, String> optionsBykey, BCalque layer) {
//on sauvegarde les propriétés graphiques:
- layer.setVisible((Boolean) PropertyToStringTransformer.createTransformers().get(Boolean.TYPE).fromString(optionsBykey.get(
+ layer.setVisible((Boolean) ToStringTransformerFactory.createTransformers().get(Boolean.TYPE).fromString(optionsBykey.get(
VISIBLE)));
}
public static String VISIBLE = "Visible";
public void addVisibleProperty(CrueEtudeExternDaoConfiguration.Ressource ressource, BCalque layer) {
//on sauvegarde les propriétés graphiques:
- ressource.getOptions().add(new Option(VISIBLE, PropertyToStringTransformer.createTransformers().get(Boolean.TYPE).toString(
+ ressource.getOptions().add(new Option(VISIBLE, ToStringTransformerFactory.createTransformers().get(Boolean.TYPE).toString(
layer.isVisible())));
}
@@ -150,7 +151,7 @@
restorVisibleProperty(optionsBykey, (BCalque) layer);
optionsBykey.remove(VISIBLE);
LinkedHashMap<String, Property> nodeProperties = ConfigSaverHelper.getNodeProperties(createSet);
- Map<Class, PropertyToStringTransformer> createTransformers = PropertyToStringTransformer.createTransformers();
+ Map<Class, AbstractPropertyToStringTransformer> createTransformers = ToStringTransformerFactory.createTransformers();
for (Map.Entry<String, String> readProperties : optionsBykey.entrySet()) {
String key = readProperties.getKey();
String value = readProperties.getValue();
@@ -158,7 +159,7 @@
if (property == null) {
log.addWarn("configEtu.unknownProperty.Error", key);
} else {
- PropertyToStringTransformer transformer = createTransformers.get(property.getValueType());
+ AbstractPropertyToStringTransformer transformer = createTransformers.get(property.getValueType());
if (transformer == null) {
log.addWarn("configEtu.unknownType.Error", property.getValueType());
} else if (!transformer.isValid(value)) {
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/save/LayerImageControllerSaver.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/save/LayerImageControllerSaver.java 2012-10-05 22:41:30 UTC (rev 7722)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/save/LayerImageControllerSaver.java 2012-10-05 22:45:14 UTC (rev 7723)
@@ -11,7 +11,8 @@
import org.fudaa.dodico.crue.io.conf.Option;
import org.fudaa.ebli.calque.ZModeleStatiqueImageRaster;
import org.fudaa.fudaa.crue.common.config.ConfigSaverHelper;
-import org.fudaa.fudaa.crue.common.helper.PropertyToStringTransformer;
+import org.fudaa.ctulu.converter.AbstractPropertyToStringTransformer;
+import org.fudaa.ctulu.converter.ToStringTransformerFactory;
import org.fudaa.fudaa.crue.planimetry.configuration.ImageConfigurationInfo;
import org.fudaa.fudaa.crue.planimetry.controller.LayerImageController;
import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryAdditionalLayerContrat;
@@ -39,7 +40,7 @@
//point image
Double[] ptImg = model.getPtImg();
Double[] ptReel = model.getPtReel();
- final PropertyToStringTransformer<Double[]> point2dArrayTransformer = PropertyToStringTransformer.getPoint2dArrayTransformer();
+ final AbstractPropertyToStringTransformer<Double[]> point2dArrayTransformer = ToStringTransformerFactory.getPoint2dArrayTransformer();
ressource.getOptions().add(new Option(POINTS_IMAGE_ID,
point2dArrayTransformer.toString(ptImg)));
ressource.getOptions().add(new Option(POINTS_REELS_ID, point2dArrayTransformer.toString(
@@ -68,7 +69,7 @@
if (image == null) {
return null;
}
- final PropertyToStringTransformer<Double[]> point2dArrayTransformer = PropertyToStringTransformer.getPoint2dArrayTransformer();
+ final AbstractPropertyToStringTransformer<Double[]> point2dArrayTransformer = ToStringTransformerFactory.getPoint2dArrayTransformer();
Double[] ptImg = point2dArrayTransformer.fromString(optionsBykey.remove(POINTS_IMAGE_ID));
if (ptImg == null || ptImg.length < 2) {
log.addError("externConfig.image.pointImage.error", ressource.getNom());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-10-11 08:29:24
|
Revision: 7738
http://fudaa.svn.sourceforge.net/fudaa/?rev=7738&view=rev
Author: deniger
Date: 2012-10-11 08:29:17 +0000 (Thu, 11 Oct 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterRPTG.java
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/InitPerspectiveInstaller.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalBannerConfig.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalConfig.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/view/ReportViewsSave.java
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java 2012-10-11 07:04:33 UTC (rev 7737)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterBean.java 2012-10-11 08:29:17 UTC (rev 7738)
@@ -28,7 +28,8 @@
import org.fudaa.dodico.crue.metier.transformer.ToStringHelper;
/**
- * @author denf01a @creation 22 juin 2009
+ * @author denf01a
+ * @creation 22 juin 2009
* @version
*/
public class EqualsTesterBean extends AbstractEqualsTester<Object> {
@@ -60,14 +61,25 @@
return notDefined;
}
- protected String getPrintForLoi(final Object a) {
+ protected String getPrintForLoi(final Object a, TesterContext context) {
if (a == null) {
return getNotDefinedMsg();
}
+ final Loi loi = (Loi) a;
if (useNameForLoi) {
- return ((Loi) a).getNom();
+ return loi.getNom();
}
- return BusinessMessages.getString("loi.description", ((Loi) a).getSize());
+ if (loi.getType() != null && loi.getType().isLoiZ()) {
+ boolean firstPointIgnored = context.isActivated(TestOption.LOIZ_DONT_COMPARE_FIRST_POINT);
+ boolean onlyFirstPoint = context.isActivated(TestOption.ONLY_LOIZ_FIRST_POINT);
+ if (firstPointIgnored) {
+ return BusinessMessages.getString("loi.description", loi.getSize() - 1);
+ } else if (onlyFirstPoint) {
+ return BusinessMessages.getString("loi.description", 1);
+ }
+ }
+
+ return BusinessMessages.getString("loi.description", loi.getSize());
}
@Override
@@ -83,7 +95,7 @@
}
public final boolean isSame(final Object o1, final Object o2, final ResultatTest res, final TesterContext context,
- final Collection<String> propToUse) throws Exception {
+ final Collection<String> propToUse) throws Exception {
if (o1 == o2) {
return true;
}
@@ -99,7 +111,7 @@
}
public boolean isSameSafe(final Object o1, final Object o2, final ResultatTest res, final TesterContext context,
- final Collection<String> propToUse) {
+ final Collection<String> propToUse) {
String prefix1 = toString(o1);
boolean classEquals = o1.getClass().equals(o2.getClass());
@@ -172,7 +184,7 @@
}
private List<String> getUsableProperties(final Object o1) throws IllegalAccessException, InvocationTargetException,
- NoSuchMethodException {
+ NoSuchMethodException {
final Map m = PropertyUtils.describe(o1);
final List<String> prop = new ArrayList<String>(m.size());
for (final Object o : m.keySet()) {
@@ -216,14 +228,14 @@
@SuppressWarnings("unchecked")
private boolean compareProp(final Object o1, final ResultatTest res, final String name, final Object a,
- final Object b, final TesterContext context) throws Exception {
+ final Object b, final TesterContext context) throws Exception {
boolean isLoi = a instanceof Loi || (a == null && b instanceof Loi);
if (a == null) {
if (b != null) {
final ResultatTest addDiff = addDiff(o1, res, name, a, b, context);
if (isLoi) {
- addDiff.setPrintA(getPrintForLoi(a));
- addDiff.setPrintB(getPrintForLoi(b));
+ addDiff.setPrintA(getPrintForLoi(a, context));
+ addDiff.setPrintB(getPrintForLoi(b, context));
}
return false;
}
@@ -248,8 +260,8 @@
final ResultatTest addDiff = addDiff(o1, res, name, a, b, context);
// pour les lois, on enleve le premier noeud qui reprend le titre.
if (isLoi) {
- addDiff.setPrintA(getPrintForLoi(a));
- addDiff.setPrintB(getPrintForLoi(b));
+ addDiff.setPrintA(getPrintForLoi(a, context));
+ addDiff.setPrintB(getPrintForLoi(b, context));
if (CollectionUtils.isNotEmpty(subResultat.getFils())) {
subResultat = subResultat.getFils().get(0);
}
@@ -272,14 +284,14 @@
*/
@SuppressWarnings("unchecked")
private EqualsTester getTesterToUse(final Object parentObject, final String name, final TesterContext context,
- final Object init) {
+ final Object init) {
if ("emh".equals(name)) {
if (parentObject instanceof InfosEMH) {
return null;
}
}
final EqualsTester tester = factory.buildTesterFor(parentObject.getClass(), init.getClass(), name,
- context.getError());
+ context.getError());
if (context.getError().containsSevereError()) {
return null;
}
@@ -301,13 +313,13 @@
}
private ResultatTest addDiff(final Object o1, final ResultatTest res, final String propName, final Object a,
- final Object b, final TesterContext context) {
+ final Object b, final TesterContext context) {
if (res != null) {
final CrueConfigMetier crueProperties = factory.getPropertyDefinition();
final ResultatTest item = new ResultatTest(crueProperties.format(propName, a),
- crueProperties.format(propName, b), "compare.property.diff", getPrefix(o1),
- BusinessMessages.getStringOrDefault(propName, StringUtils.capitalize(propName)));
+ crueProperties.format(propName, b), "compare.property.diff", getPrefix(o1),
+ BusinessMessages.getStringOrDefault(propName, StringUtils.capitalize(propName)));
item.setPropertyTested(propName);
item.updatePrint(context.getToStringTransformer());
res.addDiff(item);
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterRPTG.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterRPTG.java 2012-10-11 07:04:33 UTC (rev 7737)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/comparaison/tester/EqualsTesterRPTG.java 2012-10-11 08:29:17 UTC (rev 7738)
@@ -10,12 +10,13 @@
import org.fudaa.dodico.crue.metier.emh.ResPrtGeo;
/**
- * @author denf01a @creation 22 juin 2009
+ * @author denf01a
+ * @creation 22 juin 2009
* @version
*/
@SuppressWarnings("unchecked")
public class EqualsTesterRPTG extends AbstractEqualsTester<ResPrtGeo> {
-
+
final EqualsTesterBean beanTester;
/**
@@ -26,15 +27,15 @@
this.beanTester = new EqualsTesterBean(equalsTester);
beanTester.setUseNameForLoi(false);
}
-
+
@Override
protected boolean mustTestAlreadyDone() {
return false;
}
-
+
@Override
public boolean isSameSafe(final ResPrtGeo o1, final ResPrtGeo o2, final ResultatTest res,
- final TesterContext context) {
+ final TesterContext context) {
boolean isEquals = true;
try {
Map<String, Object> values1 = o1.getValues();
@@ -51,17 +52,21 @@
ResultatTest tmp = new ResultatTest();
List<String> orderedProp = new ArrayList<String>(props);
Collections.sort(orderedProp);
- boolean activated = context.isActivated(TestOption.RELATIVE_FOR_DOUBLE);
isEquals = beanTester.isSame(dynaMap1, dynaMap2, tmp, context, orderedProp);
if (!isEquals) {
- res.addDiffs(tmp.getFils().get(0).getFils());
+ final List<ResultatTest> fils = tmp.getFils();
+ if (!fils.get(0).getObjetA().getClass().equals(LazyDynaMap.class)) {
+ res.addDiffs(fils);
+ } else {
+ res.addDiffs(fils.get(0).getFils());
+ }
}
-
+
} catch (Exception e) {
context.addError(e.getMessage(), e);
}
-
-
+
+
return isEquals;
}
}
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/InitPerspectiveInstaller.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/InitPerspectiveInstaller.java 2012-10-11 07:04:33 UTC (rev 7737)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/InitPerspectiveInstaller.java 2012-10-11 08:29:17 UTC (rev 7738)
@@ -55,12 +55,15 @@
closing = selectedPerspectiveService.getCurrentPerspectiveService().closing();
}
if (closing) {
- selectedPerspectiveService.activePerspective(PerspectiveEnum.STUDY);//on active pour enregistrer la taille de la fenetre.
- //on ferme la perspective etude pour enlever le verrou.
+ Set<TopComponent> opened = TopComponent.getRegistry().getOpened();
+ for (TopComponent topComponent : opened) {
+ topComponent.close();
+ }
PerspectiveService perspectiveService = selectedPerspectiveService.getPerspectiveService(PerspectiveEnum.STUDY);
if (perspectiveService != null) {
closing = perspectiveService.closing();
}
+
JDialog d = new JDialog();
JLabel jLabel = new JLabel(org.openide.util.NbBundle.getMessage(InitPerspectiveInstaller.class, "FudaaCrueClosing.Label"));
d.setTitle(jLabel.getText());
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalBannerConfig.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalBannerConfig.java 2012-10-11 07:04:33 UTC (rev 7737)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalBannerConfig.java 2012-10-11 08:29:17 UTC (rev 7738)
@@ -12,6 +12,7 @@
import org.fudaa.ebli.trace.TraceBox;
import org.fudaa.ebli.trace.TraceLigne;
import org.fudaa.ebli.trace.TraceLigneModel;
+import org.openide.util.Exceptions;
/**
*
@@ -35,22 +36,29 @@
private int verticalSpace = 5;
public ReportLongitudinalBannerConfig() {
- brancheBox.setTraceLigne(new TraceLigne(TraceLigne.LISSE, 1, Color.GRAY));
- brancheBox.setVPosition(SwingConstants.TOP);
- brancheBox.setVMargin(2);
- brancheBox.setHPosition(SwingConstants.CENTER);
- brancheBox.setDrawBox(false);
- brancheBox.setDrawFond(false);
- sectionBox.setTraceLigne(new TraceLigne(TraceLigne.LISSE, 1, Color.LIGHT_GRAY));
- sectionBox.setColorBoite(Color.LIGHT_GRAY);
- sectionBox.setVPosition(SwingConstants.TOP);
- sectionBox.setHPosition(SwingConstants.CENTER);
- sectionBox.setVMargin(3);
- sectionBox.setDrawBox(true);
- sectionBox.setDrawFond(false);
- sectionBox.setVertical(true);
+ createBrancheBox();
+ createSectionBox();
}
+ public void reinit() {
+ if (sectionFont == null) {
+ sectionFont = CtuluLibSwing.getMiniFont();
+ }
+ if (brancheFont == null) {
+ brancheFont = CtuluLibSwing.getMiniFont();
+ }
+ try {
+ if (brancheBox == null) {
+ createBrancheBox();
+ }
+ if (sectionBox == null) {
+ createSectionBox();
+ }
+ } catch (Exception e) {
+ Exceptions.printStackTrace(e);
+ }
+ }
+
public Color getSectionFontColor() {
return sectionBox.getColorText();
}
@@ -145,4 +153,30 @@
public void setSectionVisible(boolean sectionVisible) {
this.sectionVisible = sectionVisible;
}
+
+ private void createBrancheBox() {
+ if (brancheBox == null) {
+ brancheBox = new TraceBox();
+ }
+ brancheBox.setTraceLigne(new TraceLigne(TraceLigne.LISSE, 1, Color.GRAY));
+ brancheBox.setVPosition(SwingConstants.TOP);
+ brancheBox.setVMargin(2);
+ brancheBox.setHPosition(SwingConstants.CENTER);
+ brancheBox.setDrawBox(false);
+ brancheBox.setDrawFond(false);
+ }
+
+ private void createSectionBox() {
+ if (sectionBox == null) {
+ sectionBox = new TraceBox();
+ }
+ sectionBox.setTraceLigne(new TraceLigne(TraceLigne.LISSE, 1, Color.LIGHT_GRAY));
+ sectionBox.setColorBoite(Color.LIGHT_GRAY);
+ sectionBox.setVPosition(SwingConstants.TOP);
+ sectionBox.setHPosition(SwingConstants.CENTER);
+ sectionBox.setVMargin(3);
+ sectionBox.setDrawBox(true);
+ sectionBox.setDrawFond(false);
+ sectionBox.setVertical(true);
+ }
}
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalConfig.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalConfig.java 2012-10-11 07:04:33 UTC (rev 7737)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalConfig.java 2012-10-11 08:29:17 UTC (rev 7738)
@@ -98,6 +98,10 @@
loiLegendConfig = new ViewCourbeConfig();
}
loiLegendConfig.reinit();
+ if (bannerConfig == null) {
+ bannerConfig = new ReportLongitudinalBannerConfig();
+ }
+ bannerConfig.reinit();
}
public ReportLongitudinalBannerConfig getBannerConfig() {
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/view/ReportViewsSave.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/view/ReportViewsSave.java 2012-10-11 07:04:33 UTC (rev 7737)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/view/ReportViewsSave.java 2012-10-11 08:29:17 UTC (rev 7738)
@@ -95,6 +95,9 @@
ReportConfigLoaderProcessor loader = new ReportConfigLoaderProcessor(configFile);
final String actionTitle = NbBundle.getMessage(ReportViewsSave.class, "Load.ActionName", line.getInfo().getNom());
CrueIOResu<AbstractReportConfig> result = CrueProgressUtils.showProgressDialogAndRun(loader, actionTitle);
+ if (result == null) {
+ return null;
+ }
if (result.getAnalyse().isNotEmpty()) {
LogsDisplayer.displayError(result.getAnalyse(), actionTitle);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-10-11 15:23:36
|
Revision: 7741
http://fudaa.svn.sourceforge.net/fudaa/?rev=7741&view=rev
Author: deniger
Date: 2012-10-11 15:23:25 +0000 (Thu, 11 Oct 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHConteneurHelper.java
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/log/property/PropertyColumnFilterable.java
trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostAvctTopComponent.java
trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostEmhExplorerTopComponent.java
trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostReportStdoutTopComponent.java
trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/perspective/PerspectiveServicePost.java
Modified: trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHConteneurHelper.java
===================================================================
--- trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHConteneurHelper.java 2012-10-11 08:45:12 UTC (rev 7740)
+++ trunk/soft/fudaa-crue/crue-server/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHConteneurHelper.java 2012-10-11 15:23:25 UTC (rev 7741)
@@ -14,7 +14,7 @@
* @author deniger ( genesis)
*/
public class CatEMHConteneurHelper {
-
+
public static List<CatEMHSection> getSections(EMHSousModele sousModele) {
List<CatEMHSection> res = new ArrayList<CatEMHSection>();
List<CatEMHBranche> branches = getBranches(sousModele);
@@ -33,9 +33,10 @@
}
}
Collections.sort(sectionsWithoutBranches, ObjetNommeByNameComparator.INSTANCE);
+ res.addAll(sectionsWithoutBranches);
return res;
}
-
+
public static List<CatEMHSection> getSections(List<EMHSousModele> sousModeles) {
List<CatEMHSection> res = new ArrayList<CatEMHSection>();
for (EMHSousModele sousModele : sousModeles) {
@@ -43,7 +44,7 @@
}
return res;
}
-
+
public static List<CatEMHNoeud> getNoeuds(EMHSousModele sousModele) {
return EMHHelper.collectEMHInRelationEMHContient(sousModele, EnumCatEMH.NOEUD);
}
@@ -68,11 +69,11 @@
}
return res;
}
-
+
public static List<CatEMHBranche> getBranches(EMHSousModele sousModele) {
return EMHHelper.collectEMHInRelationEMHContient(sousModele, EnumCatEMH.BRANCHE);
}
-
+
public static List<CatEMHBranche> getBranches(List<EMHSousModele> sousModeles) {
List<CatEMHBranche> res = new ArrayList<CatEMHBranche>();
for (EMHSousModele sousModele : sousModeles) {
@@ -80,12 +81,12 @@
}
return res;
}
-
+
public static List<EMHBrancheSaintVenant> getBranchesSaintVenant(EMHSousModele sousModele) {
List<EMH> inRelationEMHContient = EMHHelper.collectEMHInRelationEMHContient(sousModele, EnumCatEMH.BRANCHE);
return EMHHelper.selectClass(inRelationEMHContient, EMHBrancheSaintVenant.class);
}
-
+
public static List<EMHBrancheSaintVenant> getBranchesSaintVenant(List<EMHSousModele> sousModeles) {
List<EMHBrancheSaintVenant> res = new ArrayList<EMHBrancheSaintVenant>();
for (EMHSousModele sousModele : sousModeles) {
@@ -93,12 +94,12 @@
}
return res;
}
-
+
public static List<CatEMHBranche> getBranchesAvecSectionPilote(EMHSousModele sousModele) {
List<EMH> inRelationEMHContient = EMHHelper.collectEMHInRelationEMHContient(sousModele, EnumCatEMH.BRANCHE);
return EMHHelper.selectInClasses(inRelationEMHContient, EMHBrancheBarrageFilEau.class, EMHBrancheBarrageGenerique.class);
}
-
+
public static List<CatEMHBranche> getBranchesAvecSectionPilote(List<EMHSousModele> sousModeles) {
List<CatEMHBranche> res = new ArrayList<CatEMHBranche>();
for (EMHSousModele sousModele : sousModeles) {
@@ -118,7 +119,7 @@
Collections.sort(res, comparator);
return res;
}
-
+
public static List<CatEMHCasier> getCasiers(List<EMHSousModele> sousModeles) {
List<CatEMHCasier> res = new ArrayList<CatEMHCasier>();
for (EMHSousModele sousModele : sousModeles) {
@@ -168,12 +169,12 @@
setForUniqueEMH.add(emh);
list.add(emh);
}
-
+
}
}
return list;
}
-
+
public static List<EMH> getAllSimpleEMH(EMHSousModele sousModele) {
return EMHHelper.collectEMHInRelationEMHContient(sousModele);
}
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/log/property/PropertyColumnFilterable.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/log/property/PropertyColumnFilterable.java 2012-10-11 08:45:12 UTC (rev 7740)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/log/property/PropertyColumnFilterable.java 2012-10-11 15:23:25 UTC (rev 7741)
@@ -24,19 +24,21 @@
JMenu menu = new JMenu(NbBundle.getMessage(PropertyColumnFilterable.class, "filter.mainMenuName", displayName));
res.add(menu);
ETable et = (ETable) component;
- CtuluLogsTopComponent logs = (CtuluLogsTopComponent) ((JComponent) component).getClientProperty(
- CtuluLogsTopComponent.class.getSimpleName());
- menu.add(create(new NodeQuickFilterEmptyValue(columnId, displayName), logs));
- menu.add(create(new NodeQuickFilterNotEmptyValue(columnId, displayName), logs));
- Object valueAt = et.getValueAt(row, column);
- if (valueAt instanceof Node.Property) {
- try {
- valueAt = ((Node.Property) valueAt).getValue();
- } catch (Exception ex) {
- Exceptions.printStackTrace(ex);
+ if (et.getRowCount() > 0) {
+ CtuluLogsTopComponent logs = (CtuluLogsTopComponent) ((JComponent) component).getClientProperty(
+ CtuluLogsTopComponent.class.getSimpleName());
+ menu.add(create(new NodeQuickFilterEmptyValue(columnId, displayName), logs));
+ menu.add(create(new NodeQuickFilterNotEmptyValue(columnId, displayName), logs));
+ Object valueAt = et.getValueAt(row, column);
+ if (valueAt instanceof Node.Property) {
+ try {
+ valueAt = ((Node.Property) valueAt).getValue();
+ } catch (Exception ex) {
+ Exceptions.printStackTrace(ex);
+ }
}
+ menu.add(create(new NodeQuickFilterEqualsTo(columnId, displayName, valueAt), logs));
}
- menu.add(create(new NodeQuickFilterEqualsTo(columnId, displayName, valueAt), logs));
}
@Override
Modified: trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostAvctTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostAvctTopComponent.java 2012-10-11 08:45:12 UTC (rev 7740)
+++ trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostAvctTopComponent.java 2012-10-11 15:23:25 UTC (rev 7741)
@@ -38,7 +38,7 @@
autostore = false)
@TopComponent.Description(preferredID = PostAvctTopComponent.TOPCOMPONENT_ID,
iconBase = "org/fudaa/fudaa/crue/post/carre-vert_16.png",
- persistenceType = TopComponent.PERSISTENCE_ALWAYS)
+ persistenceType = TopComponent.PERSISTENCE_ALWAYS )
@TopComponent.Registration(mode = "post-bottomRight", openAtStartup = false)
@ActionID(category = "Window", id = "org.fudaa.fudaa.crue.post.PostAvctTopComponent")
@ActionReference(path = "Menu/Window/Post",position=5)
Modified: trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostEmhExplorerTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostEmhExplorerTopComponent.java 2012-10-11 08:45:12 UTC (rev 7740)
+++ trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostEmhExplorerTopComponent.java 2012-10-11 15:23:25 UTC (rev 7741)
@@ -25,15 +25,15 @@
* Top component which displays something.
*/
@ConvertAsProperties(dtd = "-//org.fudaa.fudaa.crue.post//PostEmhExplorerTopComponent//EN",
- autostore = false)
+autostore = false)
@TopComponent.Description(preferredID = PostEmhExplorerTopComponent.TOPCOMPONENT_ID,
- iconBase = "org/fudaa/fudaa/crue/post/carre-vert_16.png",
- persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED)
+iconBase = "org/fudaa/fudaa/crue/post/carre-vert_16.png",
+persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = "post-topLeft", openAtStartup = false)
@ActionID(category = "Window", id = "org.fudaa.fudaa.crue.post.PostEmhExplorerTopComponent")
-@ActionReference(path = "Menu/Window/Post",position=4)
+@ActionReference(path = "Menu/Window/Post", position = 4)
@TopComponent.OpenActionRegistration(displayName = "#CTL_PostEmhExplorerTopComponent",
- preferredID = PostEmhExplorerTopComponent.TOPCOMPONENT_ID)
+preferredID = PostEmhExplorerTopComponent.TOPCOMPONENT_ID)
public final class PostEmhExplorerTopComponent extends AbstractTopComponent implements LookupListener {
public static final String TOPCOMPONENT_ID = "PostEmhExplorerTopComponent";
@@ -78,8 +78,8 @@
}
/**
- * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of
- * this method is always regenerated by the Form Editor.
+ * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
Modified: trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostReportStdoutTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostReportStdoutTopComponent.java 2012-10-11 08:45:12 UTC (rev 7740)
+++ trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/PostReportStdoutTopComponent.java 2012-10-11 15:23:25 UTC (rev 7741)
@@ -31,7 +31,7 @@
autostore = false)
@TopComponent.Description(preferredID = PostReportStdoutTopComponent.TOPCOMPONENT_ID,
iconBase = "org/fudaa/fudaa/crue/post/carre-vert_16.png",
- persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED)
+ persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = "post-topRight", openAtStartup = false)
@ActionID(category = "Window", id = "org.fudaa.fudaa.crue.post.PostReportStdoutTopComponent")
@ActionReference(path = "Menu/Window/Post",position=3)
Modified: trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/perspective/PerspectiveServicePost.java
===================================================================
--- trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/perspective/PerspectiveServicePost.java 2012-10-11 08:45:12 UTC (rev 7740)
+++ trunk/soft/fudaa-crue/ui-post/src/main/java/org/fudaa/fudaa/crue/post/perspective/PerspectiveServicePost.java 2012-10-11 15:23:25 UTC (rev 7741)
@@ -28,7 +28,6 @@
import org.openide.util.lookup.ServiceProvider;
import org.openide.util.lookup.ServiceProviders;
import org.openide.windows.TopComponent;
-import org.openide.windows.WindowManager;
/**
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-10-17 22:23:28
|
Revision: 7756
http://fudaa.svn.sourceforge.net/fudaa/?rev=7756&view=rev
Author: deniger
Date: 2012-10-17 22:23:21 +0000 (Wed, 17 Oct 2012)
Log Message:
-----------
CRUE-321
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-emh/pom.xml
trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/EMHTreePanel.java
trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/TableSelectionHistory.java
trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/NodeEMHDefault.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java
trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/LinkedEMHTableCellRenderer.java
Removed Paths:
-------------
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/LinkedTableCellRenderer.java
Deleted: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/LinkedTableCellRenderer.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/LinkedTableCellRenderer.java 2012-10-17 20:14:30 UTC (rev 7755)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/LinkedTableCellRenderer.java 2012-10-17 22:23:21 UTC (rev 7756)
@@ -1,29 +0,0 @@
-/*
- GPL 2
- */
-package org.fudaa.fudaa.crue.common.swing;
-
-import java.awt.Color;
-import java.awt.Component;
-import javax.swing.JTable;
-import javax.swing.table.TableCellRenderer;
-
-/**
- *
- * @author Frederic Deniger
- */
-public class LinkedTableCellRenderer implements TableCellRenderer {
-
- private final TableCellRenderer init;
-
- public LinkedTableCellRenderer(TableCellRenderer init) {
- this.init = init;
- }
-
- @Override
- public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
- Component comp = init.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
- comp.setForeground(Color.BLUE);
- return comp;
- }
-}
Modified: trunk/soft/fudaa-crue/ui-emh/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/pom.xml 2012-10-17 20:14:30 UTC (rev 7755)
+++ trunk/soft/fudaa-crue/ui-emh/pom.xml 2012-10-17 22:23:21 UTC (rev 7756)
@@ -52,6 +52,16 @@
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
+ <artifactId>org-openide-explorer</artifactId>
+ <version>${netbeans.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.netbeans.api</groupId>
+ <artifactId>org-netbeans-swing-outline</artifactId>
+ <version>${netbeans.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
<version>${netbeans.version}</version>
</dependency>
@@ -81,7 +91,7 @@
</plugin>
<plugin>
- <!-- NetBeans 6.9+ requires JDK 6 -->
+ <!-- NetBeans 6.9+ requires JDK 6 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
@@ -94,14 +104,14 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
- <!-- to have the jar plugin pickup the nbm generated manifest -->
+ <!-- to have the jar plugin pickup the nbm generated manifest -->
<useDefaultManifestFile>true</useDefaultManifestFile>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
Modified: trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/EMHTreePanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/EMHTreePanel.java 2012-10-17 20:14:30 UTC (rev 7755)
+++ trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/EMHTreePanel.java 2012-10-17 22:23:21 UTC (rev 7756)
@@ -212,6 +212,7 @@
nameY = nomY;
}
+ @Override
public int getColumnCount() {
return 2;
}
@@ -229,10 +230,12 @@
return nameY;
}
+ @Override
public int getRowCount() {
return loi.getEvolutionFF().getPtEvolutionFF().size();
}
+ @Override
public Object getValueAt(final int rowIndex, final int columnIndex) {
final PtEvolutionFF pt = loi.getEvolutionFF().getPtEvolutionFF().get(rowIndex);
return Double.valueOf(columnIndex == 0 ? pt.getAbscisse() : pt.getOrdonnee());
@@ -267,6 +270,7 @@
Collections.sort(keys);
}
+ @Override
public int getColumnCount() {
return isCrue9 ? 3 : 2;
}
@@ -282,6 +286,7 @@
return "Rui";
}
+ @Override
public int getRowCount() {
return pdt.getNbResultats();
}
@@ -297,6 +302,7 @@
return fmtRui;
}
+ @Override
public Object getValueAt(final int rowIndex, final int columnIndex) {
ResultatKey key = getKey(rowIndex);
if (columnIndex == 0) {
@@ -345,6 +351,7 @@
this.colYName = colYName;
}
+ @Override
public int getColumnCount() {
return 2;
}
@@ -357,10 +364,12 @@
return colYName;
}
+ @Override
public int getRowCount() {
return loi.size();
}
+ @Override
public Object getValueAt(final int rowIndex, final int columnIndex) {
final PtProfil pt = loi.get(rowIndex);
return Double.valueOf(columnIndex == 0 ? pt.getAbscisse() : pt.getOrdonnee());
@@ -450,28 +459,6 @@
}
}
-// @SuppressWarnings("serial")
-// private class PasDeTempsCellRenderer extends CtuluCellTextRenderer {
-//
-// final Crue9ResultatCalculPasDeTemps resPdt;
-// final NumberFormat fmtPdt;
-//
-// /**
-// * @param pdt
-// */
-// public PasDeTempsCellRenderer(final Crue9ResultatCalculPasDeTemps pdt, final CrueConfigMetier crueProperties) {
-// super();
-// this.resPdt = pdt;
-// fmtPdt = crueProperties.getFormatter("pdt");
-// }
-//
-// @Override
-// protected void setValue(final Object value) {
-// final int idx = (Integer) value;
-// final double pdt = resPdt.getPdt(idx);
-// super.setValue("Pas " + (idx + 1) + ": " + fmtPdt == null ? Double.toString(pdt) : fmtPdt.format(pdt));
-// }
-// }
@SuppressWarnings("serial")
private static class ResultatValueColumnCellRenderer extends CtuluCellTextRenderer {
@@ -532,14 +519,17 @@
return column == 0 ? "Propriétés" : "Valeurs";
}
+ @Override
public int getColumnCount() {
return 2;
}
+ @Override
public int getRowCount() {
return props.size();
}
+ @Override
public Object getValueAt(final int rowIndex, final int columnIndex) {
if (columnIndex == 0) {
return props.get(rowIndex);
Copied: trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java (from rev 7523, trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/TableSelectionHistory.java)
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java 2012-10-17 22:23:21 UTC (rev 7756)
@@ -0,0 +1,155 @@
+package org.fudaa.fudaa.crue.emh.common;
+
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+
+import javax.swing.Action;
+import javax.swing.KeyStroke;
+
+import com.memoire.bu.BuResource;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyVetoException;
+import javax.swing.event.ListSelectionEvent;
+
+import org.fudaa.ctulu.CtuluCommand;
+import org.fudaa.ctulu.CtuluCommandAction;
+import org.fudaa.ctulu.CtuluCommandManager;
+import org.fudaa.fudaa.crue.common.node.NodeHelper;
+import org.openide.explorer.ExplorerManager;
+import org.openide.explorer.view.OutlineView;
+import org.openide.nodes.Node;
+import org.openide.util.Exceptions;
+
+/**
+ * @author deniger
+ */
+public class OutlineSelectionHistory implements PropertyChangeListener {
+
+ private class ChangeSelectionCommand implements CtuluCommand {
+
+ Node[] newPath;
+ Node[] oldPath;
+
+ /**
+ * @param oldPath
+ * @param newPath
+ */
+ public ChangeSelectionCommand(Node[] oldPath, Node[] newPath) {
+ super();
+ this.oldPath = oldPath;
+ this.newPath = newPath;
+ }
+
+ private void changePath(Node[] path) {
+ isUpdatingFromHistory = true;
+ try {
+// for (Node node : path) {
+// NodeHelper.expandNode(node, outlineView);
+// }
+ em.setSelectedNodes(path);
+ } catch (PropertyVetoException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ isUpdatingFromHistory = false;
+ }
+
+ @Override
+ public void redo() {
+ changePath(newPath);
+ }
+
+ @Override
+ public void undo() {
+ changePath(oldPath);
+ }
+ }
+ CtuluCommandManager history;
+ private boolean isUpdatingFromHistory;
+ private Action nextAction;
+ private Action previousAction;
+ private final OutlineView outlineView;
+ private final ExplorerManager em;
+
+ /**
+ * WARN: il faut bien faire attention a désinstaller cet history
+ *
+ * @param outlineView
+ */
+ public OutlineSelectionHistory(OutlineView table) {
+ super();
+ this.outlineView = table;
+ em = ExplorerManager.find(table);
+ em.addPropertyChangeListener(this);
+ }
+
+ /**
+ * @return l'historique des selections.
+ */
+ public CtuluCommandManager getHistory() {
+ if (history == null) {
+ history = new CtuluCommandManager();
+
+ }
+ return history;
+ }
+
+ /**
+ * @return the nextAction
+ */
+ public Action getNextAction() {
+ if (nextAction == null) {
+ nextAction = new CtuluCommandAction.Redo(getHistory());
+ nextAction.putValue(Action.NAME, "history.next");
+ String value = EMHUiMessages.getMessage("History.next");
+ nextAction.putValue(Action.LONG_DESCRIPTION, value);
+ nextAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.ALT_MASK));
+ nextAction.putValue(Action.SHORT_DESCRIPTION, "<html><body style='margin:1px'>" + value + "<br>"
+ + CommonGuiLib.getAcceleratorText((KeyStroke) nextAction.getValue(Action.ACCELERATOR_KEY))
+ + "</body></html>");
+ nextAction.putValue(Action.SMALL_ICON, BuResource.BU.getToolIcon("crystal_avancervite"));
+ }
+ return nextAction;
+ }
+
+ /**
+ * @return the previousAction
+ */
+ public Action getPreviousAction() {
+ if (previousAction == null) {
+ previousAction = new CtuluCommandAction.Undo(getHistory());
+ previousAction.putValue(Action.NAME, "history.back");
+ String value = EMHUiMessages.getMessage("History.back");
+ previousAction.putValue(Action.LONG_DESCRIPTION, value);
+ previousAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.ALT_MASK));
+ previousAction.putValue(Action.SHORT_DESCRIPTION, "<html><body style='margin:1px'>" + value + "<br>"
+ + CommonGuiLib.getAcceleratorText((KeyStroke) previousAction.getValue(Action.ACCELERATOR_KEY))
+ + "</body></html>");
+ previousAction.putValue(Action.SMALL_ICON, BuResource.BU.getToolIcon("crystal_reculervite"));
+ }
+ return previousAction;
+ }
+
+ /**
+ *
+ */
+ public void uninstallListener() {
+ em.removePropertyChangeListener(this);
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (!isUpdatingFromHistory) {
+ if (ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) {
+ Node[] oldNode = (Node[]) evt.getOldValue();
+ Node[] newNode = (Node[]) evt.getNewValue();
+ if (oldNode.length > 0 && newNode.length > 0) {
+ getHistory().addCmd(new ChangeSelectionCommand(oldNode, newNode));
+ }
+ } else if (ExplorerManager.PROP_ROOT_CONTEXT.equals(evt.getPropertyName())) {
+ getHistory().clean();
+
+ }
+ }
+ }
+}
Modified: trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/TableSelectionHistory.java
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/TableSelectionHistory.java 2012-10-17 20:14:30 UTC (rev 7755)
+++ trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/TableSelectionHistory.java 2012-10-17 22:23:21 UTC (rev 7756)
@@ -24,8 +24,8 @@
private class ChangeSelectionCommand implements CtuluCommand {
- Object newPath;
- Object oldPath;
+ private Object newPath;
+ private Object oldPath;
/**
* @param oldPath
@@ -53,16 +53,15 @@
changePath(oldPath);
}
}
- CtuluCommandManager history;
+ private CtuluCommandManager history;
private boolean isUpdatingFromHistory;
- Action nextAction;
- int oldRow = -1;
- Action previousAction;
- final JXTreeTableExtended table;
+ private Action nextAction;
+ private Action previousAction;
+ private final JXTreeTableExtended table;
/**
* WARN: il faut bien faire attention a désinstaller cet history
- *
+ *
* @param table
*/
public TableSelectionHistory(JXTreeTableExtended table) {
@@ -77,7 +76,7 @@
public CtuluCommandManager getHistory() {
if (history == null) {
history = new CtuluCommandManager();
-
+
}
return history;
}
@@ -119,7 +118,7 @@
}
/**
- *
+ *
*/
public void uninstallListener() {
table.removeTreeSelectionListener(this);
Copied: trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/LinkedEMHTableCellRenderer.java (from rev 7754, trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/LinkedTableCellRenderer.java)
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/LinkedEMHTableCellRenderer.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/LinkedEMHTableCellRenderer.java 2012-10-17 22:23:21 UTC (rev 7756)
@@ -0,0 +1,61 @@
+/*
+ GPL 2
+ */
+package org.fudaa.fudaa.crue.emh.node;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.lang.reflect.InvocationTargetException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.JTable;
+import javax.swing.table.TableCellRenderer;
+import org.openide.nodes.Node;
+
+/**
+ *
+ * @author Frederic Deniger
+ */
+public class LinkedEMHTableCellRenderer implements TableCellRenderer {
+
+ private final TableCellRenderer init;
+
+ public LinkedEMHTableCellRenderer(TableCellRenderer init) {
+ this.init = init;
+ }
+
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+ Component comp = init.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+ if (value != null) {
+ Node.Property property = (Node.Property) value;
+ if (Boolean.TRUE.equals(property.getValue(NodeEMHDefault.PROP_LINK))) {
+ Color htmlColor = table.getForeground();
+ if (isSelected) {
+ htmlColor = table.getSelectionForeground();
+ } else {
+ htmlColor = Color.BLUE;
+ }
+ try {
+ String hexred = Integer.toHexString(htmlColor.getRed());
+ String hexgreen = Integer.toHexString(htmlColor.getGreen());
+ String hexblue = Integer.toHexString(htmlColor.getBlue());
+ if ("0".equals(hexred)) {
+ hexred = "00";
+ }
+ if ("0".equals(hexgreen)) {
+ hexgreen = "00";
+ }
+ if ("0".equals(hexblue)) {
+ hexblue = "00";
+ }
+ String html = "<u><font color=\"#" + hexred + hexgreen + hexblue + "\">" + (String) property.getValue() + "</font></u>";
+ property.setValue("htmlDisplayValue", html);
+ } catch (Exception illegalAccessException) {
+ Logger.getLogger(LinkedEMHTableCellRenderer.class.getName()).log(Level.INFO, "message {0}", illegalAccessException);
+ }
+ }
+ }
+ return comp;
+ }
+}
Modified: trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/NodeEMHDefault.java
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/NodeEMHDefault.java 2012-10-17 20:14:30 UTC (rev 7755)
+++ trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/NodeEMHDefault.java 2012-10-17 22:23:21 UTC (rev 7756)
@@ -22,6 +22,7 @@
public static final String PROP_VALUE = "Value";
public static final String PROP_TYPE = "Type";
+ public static final String PROP_LINK = "LINK";
/**
* Avec ce constructeur, la propriété value représentera le nom de l'EMH
@@ -40,6 +41,10 @@
setDisplayName(emh.getNom());
}
+ public boolean isLinkableNode() {
+ return getLookup().lookup(String.class) != null;
+ }
+
@Override
protected Sheet createSheet() {
Sheet sheet = Sheet.createDefault();
@@ -58,6 +63,8 @@
PropertyStringReadOnly prop = new PropertyStringReadOnly(emh.getNom() + suffix, PROP_VALUE,
propertyDisplayName,
propertyDisplayName);
+ prop.setValue(PROP_LINK, Boolean.TRUE);
+ prop.setValue("htmlDisplayValue", "<u>" + emh.getNom() + suffix + "</u>");
PropertyCrueUtils.configureNoCustomEditor(prop);
set.put(prop);
}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java 2012-10-17 20:14:30 UTC (rev 7755)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java 2012-10-17 22:23:21 UTC (rev 7756)
@@ -6,6 +6,10 @@
import com.rits.cloning.Cloner;
import java.awt.BorderLayout;
+import java.awt.EventQueue;
+import java.awt.FlowLayout;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
import java.beans.PropertyVetoException;
import java.util.ArrayList;
import java.util.Collection;
@@ -13,8 +17,9 @@
import java.util.List;
import java.util.Set;
import javax.swing.ActionMap;
-import javax.swing.table.TableCellRenderer;
-import javax.swing.table.TableColumn;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.edition.EditionChangeSousModele;
import org.fudaa.dodico.crue.edition.EditionChangeSousModele.ChangeRes;
import org.fudaa.dodico.crue.edition.EditionDelete;
@@ -24,7 +29,8 @@
import org.fudaa.dodico.crue.metier.emh.EMHSousModele;
import org.fudaa.dodico.crue.metier.transformer.TransformerHelper;
import org.fudaa.fudaa.crue.common.log.LogsDisplayer;
-import org.fudaa.fudaa.crue.common.swing.LinkedTableCellRenderer;
+import org.fudaa.fudaa.crue.emh.common.OutlineSelectionHistory;
+import org.fudaa.fudaa.crue.emh.node.LinkedEMHTableCellRenderer;
import org.fudaa.fudaa.crue.emh.node.NodeEMHDefault;
import org.fudaa.fudaa.crue.modelling.node.ModellingNodeEMHFactory;
import org.openide.util.LookupEvent;
@@ -83,10 +89,41 @@
ActionMap map = this.getActionMap();
associateLookup(ExplorerUtils.createLookup(em, map));
outlineView.setDefaultActionAllowed(true);
-// final TableColumn valueColumn = outlineView.getOutline().getColumnModel().getColumn(1);
-// TableCellRenderer cellRenderer = valueColumn.getCellRenderer();
-// outlineView.getOutline().getColumnModel().getColumn(1).setCellRenderer(new LinkedTableCellRenderer(cellRenderer));
+ outlineView.getOutline().addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ if (e.isAltDown()) {
+ int columnAtPoint = outlineView.getOutline().columnAtPoint(e.getPoint());
+ if (columnAtPoint != 1) {
+ return;
+ }
+ Node[] selectedNodes = getExplorerManager().getSelectedNodes();
+ if (selectedNodes.length != 1) {
+ return;
+ }
+ NodeEMHDefault node = (NodeEMHDefault) selectedNodes[0];
+ if (node.isLinkableNode()) {
+ EMH emh = node.getLookup().lookup(EMH.class);
+ if (emh != null) {
+ final Set<Long> uids = new HashSet<Long>();
+ uids.add(emh.getUiId());
+ selectEMHs(uids);
+ }
+ }
+ }
+ }
+ });
+ outlineView.getOutline().getColumnModel().getColumn(1).setCellRenderer(new LinkedEMHTableCellRenderer(outlineView.getOutline().getDefaultRenderer(Node.Property.class)));
+ OutlineSelectionHistory history = new OutlineSelectionHistory(outlineView);
+ JPanel pnTop = new JPanel(new FlowLayout(FlowLayout.LEFT));
+ final JButton btPrev = new JButton(history.getPreviousAction());
+ btPrev.setText(StringUtils.EMPTY);
+ pnTop.add(btPrev);
+ final JButton btNext = new JButton(history.getNextAction());
+ btNext.setText(StringUtils.EMPTY);
+ pnTop.add(btNext);
+ add(pnTop, BorderLayout.NORTH);
}
@Override
@@ -209,25 +246,26 @@
selectedUid.add(emh.getUiId());
}
}
- Node[] nodes = em.getRootContext().getChildren().getNodes();
- List<Node> toSelect = new ArrayList<Node>();
- for (Node node : nodes) {
- if (node.getLookup() != null) {
- EMH emh = node.getLookup().lookup(EMH.class);
- if (emh != null && selectedUid.contains(emh.getUiId())) {
- toSelect.add(node);
- }
+ selectEMHs(selectedUid);
+ }
+ }
+
+ protected void selectEMHs(Set<Long> selectedUid) {
+ Node[] nodes = em.getRootContext().getChildren().getNodes();
+ List<Node> toSelect = new ArrayList<Node>();
+ for (Node node : nodes) {
+ if (node.getLookup() != null) {
+ EMH emh = node.getLookup().lookup(EMH.class);
+ if (emh != null && selectedUid.contains(emh.getUiId())) {
+ toSelect.add(node);
}
}
- try {
- em.setSelectedNodes((Node[]) toSelect.toArray(new Node[toSelect.size()]));
- if (!toSelect.isEmpty()) {
-// outlineView.getOutline().sscrollRectToVisible(null);
- }
- } catch (PropertyVetoException ex) {
- Exceptions.printStackTrace(ex);
- }
}
+ try {
+ em.setSelectedNodes((Node[]) toSelect.toArray(new Node[toSelect.size()]));
+ } catch (PropertyVetoException ex) {
+ Exceptions.printStackTrace(ex);
+ }
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-10-17 22:51:43
|
Revision: 7758
http://fudaa.svn.sourceforge.net/fudaa/?rev=7758&view=rev
Author: deniger
Date: 2012-10-17 22:51:37 +0000 (Wed, 17 Oct 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java
trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/ModeleListTopComponent.java
Modified: trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java 2012-10-17 22:30:58 UTC (rev 7757)
+++ trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java 2012-10-17 22:51:37 UTC (rev 7758)
@@ -10,12 +10,12 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyVetoException;
-import javax.swing.event.ListSelectionEvent;
+import org.apache.commons.lang.ArrayUtils;
import org.fudaa.ctulu.CtuluCommand;
import org.fudaa.ctulu.CtuluCommandAction;
import org.fudaa.ctulu.CtuluCommandManager;
-import org.fudaa.fudaa.crue.common.node.NodeHelper;
+import org.fudaa.ctulu.CtuluLibArray;
import org.openide.explorer.ExplorerManager;
import org.openide.explorer.view.OutlineView;
import org.openide.nodes.Node;
@@ -44,9 +44,6 @@
private void changePath(Node[] path) {
isUpdatingFromHistory = true;
try {
-// for (Node node : path) {
-// NodeHelper.expandNode(node, outlineView);
-// }
em.setSelectedNodes(path);
} catch (PropertyVetoException ex) {
Exceptions.printStackTrace(ex);
@@ -68,7 +65,6 @@
private boolean isUpdatingFromHistory;
private Action nextAction;
private Action previousAction;
- private final OutlineView outlineView;
private final ExplorerManager em;
/**
@@ -78,7 +74,6 @@
*/
public OutlineSelectionHistory(OutlineView table) {
super();
- this.outlineView = table;
em = ExplorerManager.find(table);
em.addPropertyChangeListener(this);
}
@@ -136,6 +131,7 @@
public void uninstallListener() {
em.removePropertyChangeListener(this);
}
+ Node[] keptOldSelection;
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -143,10 +139,22 @@
if (ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) {
Node[] oldNode = (Node[]) evt.getOldValue();
Node[] newNode = (Node[]) evt.getNewValue();
+ //cela peut arriver...
+
+ if (oldNode.length == 0 && keptOldSelection != null) {
+ oldNode = keptOldSelection;
+ }
+ if (CtuluLibArray.isEquals(newNode, oldNode)) {
+ return;
+ }
+ keptOldSelection = null;
if (oldNode.length > 0 && newNode.length > 0) {
getHistory().addCmd(new ChangeSelectionCommand(oldNode, newNode));
+ } else if (newNode.length == 0 && oldNode.length > 0) {
+ keptOldSelection = oldNode;
}
} else if (ExplorerManager.PROP_ROOT_CONTEXT.equals(evt.getPropertyName())) {
+ keptOldSelection = null;
getHistory().clean();
}
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java 2012-10-17 22:30:58 UTC (rev 7757)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java 2012-10-17 22:51:37 UTC (rev 7758)
@@ -16,6 +16,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import javax.swing.Action;
import javax.swing.ActionMap;
import javax.swing.JButton;
import javax.swing.JPanel;
@@ -28,6 +29,7 @@
import org.fudaa.dodico.crue.metier.emh.EMHScenario;
import org.fudaa.dodico.crue.metier.emh.EMHSousModele;
import org.fudaa.dodico.crue.metier.transformer.TransformerHelper;
+import org.fudaa.ebli.commun.EbliLib;
import org.fudaa.fudaa.crue.common.log.LogsDisplayer;
import org.fudaa.fudaa.crue.emh.common.OutlineSelectionHistory;
import org.fudaa.fudaa.crue.emh.node.LinkedEMHTableCellRenderer;
@@ -124,6 +126,7 @@
btNext.setText(StringUtils.EMPTY);
pnTop.add(btNext);
add(pnTop, BorderLayout.NORTH);
+ EbliLib.updateMapKeyStroke(this, new Action[]{history.getPreviousAction(), history.getNextAction()});
}
@Override
Modified: trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/ModeleListTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/ModeleListTopComponent.java 2012-10-17 22:30:58 UTC (rev 7757)
+++ trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/ModeleListTopComponent.java 2012-10-17 22:51:37 UTC (rev 7758)
@@ -19,14 +19,14 @@
* Top component which displays something.
*/
@ConvertAsProperties(dtd = "-//org.fudaa.fudaa.crue.study//ModeleList//EN",
- autostore = false)
+autostore = false)
@TopComponent.Description(preferredID = ModeleListTopComponent.TOPCOMPONENT_ID,
- iconBase = "org/fudaa/fudaa/crue/study/icons/modele_16.png",
- persistenceType = TopComponent.PERSISTENCE_ALWAYS)
-@TopComponent.Registration(mode = "study-topRight",position = 2, openAtStartup = false)
+iconBase = "org/fudaa/fudaa/crue/study/icons/modele_16.png",
+persistenceType = TopComponent.PERSISTENCE_ALWAYS)
+@TopComponent.Registration(mode = "study-topRight", position = 2, openAtStartup = false)
@ActionID(category = "Window", id = "org.fudaa.fudaa.crue.study.ModeleListTopComponent")
@TopComponent.OpenActionRegistration(displayName = "#CTL_ModeleListAction",
- preferredID = ModeleListTopComponent.TOPCOMPONENT_ID)
+preferredID = ModeleListTopComponent.TOPCOMPONENT_ID)
@ActionReference(path = "Menu/Window/Study", position = 2)
public final class ModeleListTopComponent extends ListTopComponentAbstract {
@@ -40,7 +40,6 @@
outlineView.getOutline().setToolTipText(null);
outlineView.getOutline().setColumnHidingAllowed(false);
outlineView.getOutline().addFocusListener(new FocusAdapter() {
-
@Override
public void focusGained(FocusEvent e) {
super.focusGained(e);
@@ -55,8 +54,8 @@
}
/**
- * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of
- * this method is always regenerated by the Form Editor.
+ * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-10-18 13:40:23
|
Revision: 7759
http://fudaa.svn.sourceforge.net/fudaa/?rev=7759&view=rev
Author: deniger
Date: 2012-10-18 13:40:16 +0000 (Thu, 18 Oct 2012)
Log Message:
-----------
CRUE-311
Issue #CRUE-311 - Vue r?\195?\169seau et vue EMHs : probl?\195?\168mes
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-emh/pom.xml
trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/EMHTreePanel.java
trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java
trunk/soft/fudaa-crue/ui-emh/src/main/resources/org/fudaa/fudaa/crue/emh/common/Bundle.properties
trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java
trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/Bundle.properties
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/ReportNetworkTopComponent.java
trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/Bundle.properties
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/LinkedEMHHelper.java
Modified: trunk/soft/fudaa-crue/ui-emh/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/pom.xml 2012-10-17 22:51:37 UTC (rev 7758)
+++ trunk/soft/fudaa-crue/ui-emh/pom.xml 2012-10-18 13:40:16 UTC (rev 7759)
@@ -25,6 +25,11 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.fudaa.framework.ebli</groupId>
+ <artifactId>ebli-common</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.fudaa.soft.fudaa-crue</groupId>
<artifactId>ui-wrapper</artifactId>
<type>nbm</type>
Modified: trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/EMHTreePanel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/EMHTreePanel.java 2012-10-17 22:51:37 UTC (rev 7758)
+++ trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/EMHTreePanel.java 2012-10-18 13:40:16 UTC (rev 7759)
@@ -40,8 +40,12 @@
import com.memoire.bu.BuLib;
import com.memoire.bu.BuPanel;
import com.memoire.bu.BuScrollPane;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.util.Collection;
import java.util.Enumeration;
+import javax.swing.Action;
+import javax.swing.JMenuItem;
import org.apache.commons.beanutils.LazyDynaMap;
import org.apache.commons.beanutils.PropertyUtils;
@@ -49,6 +53,7 @@
import org.apache.commons.lang.StringUtils;
import org.fudaa.ctulu.gui.CtuluCellTextRenderer;
import org.fudaa.ctulu.gui.CtuluDialogPanel;
+import org.fudaa.ctulu.gui.PopupMenuReceiver;
import org.fudaa.dodico.crue.comparaison.config.OrdResDynamicPropertyFilter;
import org.fudaa.dodico.crue.config.ConfigLoi;
import org.fudaa.dodico.crue.config.CrueConfigMetier;
@@ -68,6 +73,7 @@
import org.fudaa.dodico.crue.metier.emh.ResultatPasDeTempsDelegate;
import org.fudaa.dodico.crue.metier.etude.EMHProjet;
import org.fudaa.dodico.crue.metier.transformer.ToStringTransformerPoint2d;
+import org.fudaa.ebli.commun.EbliLib;
import org.fudaa.fudaa.crue.common.swingx.AbstractTreeNode;
import org.fudaa.fudaa.crue.common.swingx.TreeNodeCleValeur;
import org.fudaa.fudaa.crue.emh.common.CommonGuiLib;
@@ -78,12 +84,15 @@
import org.fudaa.fudaa.crue.common.helper.UiContext;
import org.fudaa.fudaa.crue.common.UserPreferencesSaver;
import org.fudaa.fudaa.crue.emh.common.TreeNodeEMH;
+import org.fudaa.fudaa.crue.emh.node.LinkedEMHHelper;
+import org.fudaa.fudaa.crue.emh.node.NodeEMHDefault;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.AbstractHighlighter;
import org.jdesktop.swingx.decorator.ComponentAdapter;
import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
import org.jdesktop.swingx.treetable.TreeTableNode;
import org.openide.util.Exceptions;
+import org.openide.util.NbBundle;
/**
* Affichage rapide des EMH.
@@ -655,25 +664,47 @@
colonnes.add(EMHUiMessages.getMessage("EMHTreeView.ColumnValueName"));
treeModel.setColumnIdentifiers(colonnes);
treeEMH = new UiContext().createTreeTable(treeModel, true);
+ PopupMenuReceiver receiver = new PopupMenuReceiver() {
+ JMenuItem add;
+
+ @Override
+ protected void updateItemStateBeforeShow() {
+ super.updateItemStateBeforeShow();
+ add.setEnabled(false);
+ final TreePath path = treeEMH.getTreeSelectionModel().getSelectionPath();
+ if (path != null) {
+ final AbstractTreeNode lastPathComponent = (AbstractTreeNode) path.getLastPathComponent();
+ final AbstractTreeNode dest = ref.get(lastPathComponent.getLinkId(1));
+ add.setEnabled(dest != null);
+ }
+ }
+
+ @Override
+ protected void addItems() {
+ super.addItems();
+ popupMenu.addSeparator();
+ add = popupMenu.add(NbBundle.getMessage(CommonGuiLib.class, "FollowLink.Action"));
+ add.setToolTipText(NbBundle.getMessage(CommonGuiLib.class, "FollowLink.ActionTooltip"));
+
+ add.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ followLink(ref);
+ }
+ });
+ }
+ };
+ receiver.install(treeEMH, null);
treeEMH.setName("emhTree.treeTable");
treeEMH.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
- if (e.isControlDown()) {
+ if (e.isAltDown()) {
final int columnAtPoint = treeEMH.columnAtPoint(e.getPoint());
if (columnAtPoint != 1) {
return;
}
- final TreePath path = treeEMH.getTreeSelectionModel().getSelectionPath();
- if (path == null) {
- return;
- }
- final AbstractTreeNode lastPathComponent = (AbstractTreeNode) path.getLastPathComponent();
- if (lastPathComponent == null) {
- return;
- }
- final AbstractTreeNode dest = ref.get(lastPathComponent.getLinkId(1));
- treeEMH.selectAndShow(dest);
+ followLink(ref);
} else if (e.getClickCount() == 2) {
displayInfo(treeEMH.getTreeSelectionModel().getSelectionPath());
@@ -753,8 +784,21 @@
pn.add(tb, BorderLayout.NORTH);
pn.add(new JScrollPane(treeEMH), BorderLayout.CENTER);
UserPreferencesSaver.loadTablePreferences(treeEMH);
+ EbliLib.updateMapKeyStroke(treeEMH, new Action[]{history.getPreviousAction(), history.getNextAction()});
return pn;
+ }
+ public void followLink(final Map<String, AbstractTreeNode> ref) {
+ final TreePath path = treeEMH.getTreeSelectionModel().getSelectionPath();
+ if (path == null) {
+ return;
+ }
+ final AbstractTreeNode lastPathComponent = (AbstractTreeNode) path.getLastPathComponent();
+ if (lastPathComponent == null) {
+ return;
+ }
+ final AbstractTreeNode dest = ref.get(lastPathComponent.getLinkId(1));
+ treeEMH.selectAndShow(dest);
}
JToolBar tb;
private JLabel lbTitle;
Modified: trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java 2012-10-17 22:51:37 UTC (rev 7758)
+++ trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java 2012-10-18 13:40:16 UTC (rev 7759)
@@ -10,7 +10,6 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyVetoException;
-import org.apache.commons.lang.ArrayUtils;
import org.fudaa.ctulu.CtuluCommand;
import org.fudaa.ctulu.CtuluCommandAction;
Added: trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/LinkedEMHHelper.java
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/LinkedEMHHelper.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/node/LinkedEMHHelper.java 2012-10-18 13:40:16 UTC (rev 7759)
@@ -0,0 +1,131 @@
+/*
+ GPL 2
+ */
+package org.fudaa.fudaa.crue.emh.node;
+
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import javax.swing.Action;
+import javax.swing.JButton;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import org.apache.commons.lang.StringUtils;
+import org.fudaa.dodico.crue.metier.emh.EMH;
+import org.fudaa.ebli.commun.EbliLib;
+import org.fudaa.fudaa.crue.emh.common.CommonGuiLib;
+import org.fudaa.fudaa.crue.emh.common.OutlineSelectionHistory;
+import org.openide.explorer.ExplorerManager;
+import org.openide.explorer.view.NodePopupFactory;
+import org.openide.explorer.view.OutlineView;
+import org.openide.nodes.Node;
+import org.openide.nodes.NodeOp;
+import org.openide.util.Exceptions;
+import org.openide.util.NbBundle;
+import org.openide.util.Utilities;
+
+/**
+ *
+ * @author Frederic Deniger
+ */
+public class LinkedEMHHelper {
+
+ public static void installShortcutsAndCellRenderer(final OutlineView outlineView, final ExplorerManager em) {
+ outlineView.getOutline().addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ if (e.isAltDown()) {
+ int columnAtPoint = outlineView.getOutline().columnAtPoint(e.getPoint());
+ if (columnAtPoint != 1) {
+ return;
+ }
+ followLink(em);
+ }
+ }
+ });
+ outlineView.setNodePopupFactory(new NodePopupFactory() {
+ @Override
+ public JPopupMenu createPopupMenu(int row, int column, Node[] selectedNodes,
+ Component component) {
+
+ Action[] actions = NodeOp.findActions(selectedNodes);
+ JPopupMenu res = Utilities.actionsToPopup(actions, component);
+ res.addSeparator();
+ JMenuItem add = res.add(NbBundle.getMessage(CommonGuiLib.class, "FollowLink.Action"));
+ add.setToolTipText(NbBundle.getMessage(CommonGuiLib.class, "FollowLink.ActionTooltip"));
+ add.setEnabled(false);
+ if (selectedNodes != null && selectedNodes.length == 1) {
+ NodeEMHDefault emhNode = (NodeEMHDefault) selectedNodes[0];
+ add.setEnabled(emhNode.isLinkableNode());
+ }
+ add.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ followLink(em);
+ }
+ });
+
+ return res;
+ }
+ });
+ outlineView.getOutline().getColumnModel().getColumn(1).setCellRenderer(new LinkedEMHTableCellRenderer(outlineView.getOutline().getDefaultRenderer(Node.Property.class)));
+ }
+
+ public static boolean followLink(ExplorerManager em) {
+ Node[] selectedNodes = em.getSelectedNodes();
+ if (selectedNodes.length != 1) {
+ return true;
+ }
+ NodeEMHDefault node = (NodeEMHDefault) selectedNodes[0];
+ if (node.isLinkableNode()) {
+ EMH emh = node.getLookup().lookup(EMH.class);
+ if (emh != null) {
+ final Set<Long> uids = new HashSet<Long>();
+ uids.add(emh.getUiId());
+ selectEMHs(em, uids);
+
+ }
+ }
+ return false;
+ }
+
+ public static void selectEMHs(ExplorerManager em, Set<Long> selectedUid) {
+ Node[] nodes = em.getRootContext().getChildren().getNodes();
+ List<Node> toSelect = new ArrayList<Node>();
+ for (Node node : nodes) {
+ if (node.getLookup() != null) {
+ EMH emh = node.getLookup().lookup(EMH.class);
+ if (emh != null && selectedUid.contains(emh.getUiId())) {
+ toSelect.add(node);
+ }
+ }
+ }
+ try {
+ em.setSelectedNodes((Node[]) toSelect.toArray(new Node[toSelect.size()]));
+ } catch (PropertyVetoException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ }
+
+ public static JPanel installBackNextButtons(OutlineView outlineView) {
+ OutlineSelectionHistory history = new OutlineSelectionHistory(outlineView);
+ JPanel pnTop = new JPanel(new FlowLayout(FlowLayout.LEFT));
+ final JButton btPrev = new JButton(history.getPreviousAction());
+ btPrev.setText(StringUtils.EMPTY);
+ pnTop.add(btPrev);
+ final JButton btNext = new JButton(history.getNextAction());
+ btNext.setText(StringUtils.EMPTY);
+ pnTop.add(btNext);
+ EbliLib.updateMapKeyStroke(outlineView, new Action[]{history.getPreviousAction(), history.getNextAction()});
+ return pnTop;
+ }
+}
Modified: trunk/soft/fudaa-crue/ui-emh/src/main/resources/org/fudaa/fudaa/crue/emh/common/Bundle.properties
===================================================================
--- trunk/soft/fudaa-crue/ui-emh/src/main/resources/org/fudaa/fudaa/crue/emh/common/Bundle.properties 2012-10-17 22:51:37 UTC (rev 7758)
+++ trunk/soft/fudaa-crue/ui-emh/src/main/resources/org/fudaa/fudaa/crue/emh/common/Bundle.properties 2012-10-18 13:40:16 UTC (rev 7759)
@@ -22,3 +22,5 @@
EMHTreeView.EMHNonActive=(non active)
regle.isActive=active
regle.isNotActive=non active
+FollowLink.Action=Aller \u00e0...
+FollowLink.ActionTooltip=Utiliser Ctrl+clic sur le lien pour le suivre
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java 2012-10-17 22:51:37 UTC (rev 7758)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java 2012-10-18 13:40:16 UTC (rev 7759)
@@ -6,21 +6,11 @@
import com.rits.cloning.Cloner;
import java.awt.BorderLayout;
-import java.awt.EventQueue;
-import java.awt.FlowLayout;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.beans.PropertyVetoException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
-import javax.swing.Action;
import javax.swing.ActionMap;
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.edition.EditionChangeSousModele;
import org.fudaa.dodico.crue.edition.EditionChangeSousModele.ChangeRes;
import org.fudaa.dodico.crue.edition.EditionDelete;
@@ -29,10 +19,8 @@
import org.fudaa.dodico.crue.metier.emh.EMHScenario;
import org.fudaa.dodico.crue.metier.emh.EMHSousModele;
import org.fudaa.dodico.crue.metier.transformer.TransformerHelper;
-import org.fudaa.ebli.commun.EbliLib;
import org.fudaa.fudaa.crue.common.log.LogsDisplayer;
-import org.fudaa.fudaa.crue.emh.common.OutlineSelectionHistory;
-import org.fudaa.fudaa.crue.emh.node.LinkedEMHTableCellRenderer;
+import org.fudaa.fudaa.crue.emh.node.LinkedEMHHelper;
import org.fudaa.fudaa.crue.emh.node.NodeEMHDefault;
import org.fudaa.fudaa.crue.modelling.node.ModellingNodeEMHFactory;
import org.openide.util.LookupEvent;
@@ -45,7 +33,6 @@
import org.openide.explorer.ExplorerUtils;
import org.openide.explorer.view.OutlineView;
import org.openide.nodes.Node;
-import org.openide.util.Exceptions;
import org.openide.util.Lookup;
import org.openide.util.LookupListener;
import org.openide.util.Utilities;
@@ -84,49 +71,16 @@
outlineView.addPropertyColumn(NodeEMHDefault.PROP_VALUE,
NbBundle.getMessage(ModellingNetworkTopComponent.class,
"ModellingNetworkTopComponent." + NodeEMHDefault.PROP_VALUE + ".Name"));
- add(outlineView);
- add(createCancelSaveButtons(), BorderLayout.SOUTH);
+
setName(NbBundle.getMessage(ModellingNetworkTopComponent.class, TOPCOMPONENT_ACTION));
setToolTipText(NbBundle.getMessage(ModellingNetworkTopComponent.class, "HINT_" + TOPCOMPONENT_ID));
ActionMap map = this.getActionMap();
associateLookup(ExplorerUtils.createLookup(em, map));
outlineView.setDefaultActionAllowed(true);
- outlineView.getOutline().addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent e) {
- if (e.isAltDown()) {
- int columnAtPoint = outlineView.getOutline().columnAtPoint(e.getPoint());
- if (columnAtPoint != 1) {
- return;
- }
- Node[] selectedNodes = getExplorerManager().getSelectedNodes();
- if (selectedNodes.length != 1) {
- return;
- }
- NodeEMHDefault node = (NodeEMHDefault) selectedNodes[0];
- if (node.isLinkableNode()) {
- EMH emh = node.getLookup().lookup(EMH.class);
- if (emh != null) {
- final Set<Long> uids = new HashSet<Long>();
- uids.add(emh.getUiId());
- selectEMHs(uids);
-
- }
- }
- }
- }
- });
- outlineView.getOutline().getColumnModel().getColumn(1).setCellRenderer(new LinkedEMHTableCellRenderer(outlineView.getOutline().getDefaultRenderer(Node.Property.class)));
- OutlineSelectionHistory history = new OutlineSelectionHistory(outlineView);
- JPanel pnTop = new JPanel(new FlowLayout(FlowLayout.LEFT));
- final JButton btPrev = new JButton(history.getPreviousAction());
- btPrev.setText(StringUtils.EMPTY);
- pnTop.add(btPrev);
- final JButton btNext = new JButton(history.getNextAction());
- btNext.setText(StringUtils.EMPTY);
- pnTop.add(btNext);
- add(pnTop, BorderLayout.NORTH);
- EbliLib.updateMapKeyStroke(this, new Action[]{history.getPreviousAction(), history.getNextAction()});
+ add(outlineView);
+ add(createCancelSaveButtons(), BorderLayout.SOUTH);
+ LinkedEMHHelper.installShortcutsAndCellRenderer(outlineView, em);
+ add(LinkedEMHHelper.installBackNextButtons(outlineView), BorderLayout.NORTH);
}
@Override
@@ -254,21 +208,7 @@
}
protected void selectEMHs(Set<Long> selectedUid) {
- Node[] nodes = em.getRootContext().getChildren().getNodes();
- List<Node> toSelect = new ArrayList<Node>();
- for (Node node : nodes) {
- if (node.getLookup() != null) {
- EMH emh = node.getLookup().lookup(EMH.class);
- if (emh != null && selectedUid.contains(emh.getUiId())) {
- toSelect.add(node);
- }
- }
- }
- try {
- em.setSelectedNodes((Node[]) toSelect.toArray(new Node[toSelect.size()]));
- } catch (PropertyVetoException ex) {
- Exceptions.printStackTrace(ex);
- }
+ LinkedEMHHelper.selectEMHs(getExplorerManager(), selectedUid);
}
/**
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/Bundle.properties
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/Bundle.properties 2012-10-17 22:51:37 UTC (rev 7758)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/Bundle.properties 2012-10-18 13:40:16 UTC (rev 7759)
@@ -40,3 +40,4 @@
AddCalcTransitoire.Menu=Ajouter un calcul transitoire
AddCalcPseudoPerm.Menu=Ajouter un calcul pseudo-permanent
ModellingContainersTopComponent.ColumnVisible=Visible
+FollowLink.Action=Aller \u00e0
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/ReportNetworkTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/ReportNetworkTopComponent.java 2012-10-17 22:51:37 UTC (rev 7758)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/ReportNetworkTopComponent.java 2012-10-18 13:40:16 UTC (rev 7759)
@@ -4,16 +4,27 @@
*/
package org.fudaa.fudaa.crue.report;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
import java.beans.PropertyVetoException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import javax.swing.Action;
import javax.swing.ActionMap;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
import org.fudaa.dodico.crue.metier.emh.EMH;
import org.fudaa.dodico.crue.metier.emh.EMHScenario;
import org.fudaa.fudaa.crue.emh.node.HierarchyChildFactory;
+import org.fudaa.fudaa.crue.emh.node.LinkedEMHHelper;
+import org.fudaa.fudaa.crue.emh.node.LinkedEMHTableCellRenderer;
import org.fudaa.fudaa.crue.emh.node.NodeEMHDefault;
import org.fudaa.fudaa.crue.report.node.ReportNodeEMHFactory;
import org.openide.util.LookupEvent;
@@ -24,8 +35,10 @@
import org.openide.awt.ActionReference;
import org.openide.explorer.ExplorerManager;
import org.openide.explorer.ExplorerUtils;
+import org.openide.explorer.view.NodePopupFactory;
import org.openide.explorer.view.OutlineView;
import org.openide.nodes.Node;
+import org.openide.nodes.NodeOp;
import org.openide.util.Exceptions;
import org.openide.util.Lookup;
import org.openide.util.LookupListener;
@@ -72,6 +85,8 @@
ActionMap map = this.getActionMap();
associateLookup(ExplorerUtils.createLookup(em, map));
outlineView.setDefaultActionAllowed(true);
+ LinkedEMHHelper.installShortcutsAndCellRenderer(outlineView, em);
+ add(LinkedEMHHelper.installBackNextButtons(outlineView), BorderLayout.NORTH);
}
@Override
Modified: trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/Bundle.properties
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/Bundle.properties 2012-10-17 22:51:37 UTC (rev 7758)
+++ trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/Bundle.properties 2012-10-18 13:40:16 UTC (rev 7759)
@@ -27,3 +27,4 @@
AnimationDelay.Label=Delai de l'animation (en sec)
ChangeParameter.DialogTitle=Editer les param\u00e8tres
ExternFile.ActioName=Configurer fichiers externes
+FollowLink.Action=Aller \u00e0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-10-18 15:28:26
|
Revision: 7761
http://fudaa.svn.sourceforge.net/fudaa/?rev=7761&view=rev
Author: deniger
Date: 2012-10-18 15:28:14 +0000 (Thu, 18 Oct 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/pom.xml
trunk/soft/fudaa-crue/ui-planimetry/pom.xml
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/NodeConfiguration.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/VisuConfiguration.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerNodeController.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryNodeLayer.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryNodeLayerModel.java
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryPointLayer.java
trunk/soft/fudaa-crue/ui-report/pom.xml
trunk/soft/fudaa-crue/ui-report/src/test/java/org/fudaa/fudaa/crue/report/ReportTestHelper.java
trunk/soft/fudaa-crue/ui-report/src/test/java/org/fudaa/fudaa/crue/report/ReportVisualTopComponentTest.java
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/NodeConfigurationExtra.java
Modified: trunk/soft/fudaa-crue/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/pom.xml 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/pom.xml 2012-10-18 15:28:14 UTC (rev 7761)
@@ -247,6 +247,17 @@
<artifactId>jide-oss</artifactId>
<version>3.4.3</version>
</dependency>
+ <!--utiliser pour construire les graphes-->
+ <dependency>
+ <groupId>jgrapht</groupId>
+ <artifactId>jgrapht</artifactId>
+ <version>0.8.3</version>
+ </dependency>
+ <dependency>
+ <groupId>jgraphx</groupId>
+ <artifactId>jgraphx</artifactId>
+ <version>1.10.0.5</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<build>
@@ -278,16 +289,16 @@
</plugins>
</pluginManagement>
<plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>nbm-maven-plugin</artifactId>
- <version>3.5</version>
- <extensions>true</extensions>
- <configuration>
- <brandingToken>${brandingToken}</brandingToken>
- <cluster>${brandingToken}</cluster>
- </configuration>
- </plugin>
- </plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>nbm-maven-plugin</artifactId>
+ <version>3.5</version>
+ <extensions>true</extensions>
+ <configuration>
+ <brandingToken>${brandingToken}</brandingToken>
+ <cluster>${brandingToken}</cluster>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
</project>
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/ui-planimetry/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/pom.xml 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/ui-planimetry/pom.xml 2012-10-18 15:28:14 UTC (rev 7761)
@@ -124,12 +124,10 @@
<dependency>
<groupId>jgrapht</groupId>
<artifactId>jgrapht</artifactId>
- <version>0.8.3</version>
</dependency>
<dependency>
<groupId>jgraphx</groupId>
<artifactId>jgraphx</artifactId>
- <version>1.10.0.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/NodeConfiguration.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/NodeConfiguration.java 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/NodeConfiguration.java 2012-10-18 15:28:14 UTC (rev 7761)
@@ -7,6 +7,7 @@
import org.fudaa.ebli.trace.TraceIconModel;
import org.fudaa.ebli.trace.TraceLigne;
import org.fudaa.fudaa.crue.planimetry.controller.LayerNodeController;
+import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryNodeLayerModel;
import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryPointLayerModel;
/**
@@ -30,6 +31,9 @@
this.parent = parent;
}
+// public NodeConfigurationExtra getExtra() {
+// return parent.getNodeExtra();
+// }
public void setDisplayCasierLabel(boolean displayCasier) {
this.displayCasierLabel = displayCasier;
}
@@ -38,17 +42,36 @@
return displayCasierLabel;
}
+ public String getDisplayedLabel(CatEMHNoeud noeud, PlanimetryNodeLayerModel model) {
+ if (model.getNodeConfigurationExtra() != null) {
+ return model.getNodeConfigurationExtra().getDisplayedLabel(noeud, this);
+ }
+ String nom = noeud.getNom();
+ if (isDisplayCasierLabel()) {
+ if (noeud.getCasier() != null) {
+ if (noeud.getCasier().getActuallyActive() || isInactiveEMHVisible()) {
+ nom = nom + "\n" + noeud.getCasier().getNom();
+ }
+ }
+ }
+ return nom;
+ }
+
public boolean isInactiveEMHVisible() {
return parent.isInactiveEMHVisible();
}
@Override
public void initTraceIcon(TraceIconModel _ligne, int _idxPoint, PlanimetryPointLayerModel model) {
+ PlanimetryNodeLayerModel nodeModel = (PlanimetryNodeLayerModel) model;
super.initTraceIcon(_ligne, _idxPoint, model);
- CatEMHNoeud noeud = ((LayerNodeController) (model.getLayerController())).getNoeud(_idxPoint);
+ CatEMHNoeud noeud = nodeModel.getLayerController().getNoeud(_idxPoint);
if (!noeud.getActuallyActive()) {
_ligne.setCouleur(parent.getInactiveEMHColor());
}
+ if (nodeModel.getNodeConfigurationExtra() != null) {
+ nodeModel.getNodeConfigurationExtra().configureTraceIcon(_ligne, noeud, model);
+ }
}
public VisuConfiguration getParent() {
Added: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/NodeConfigurationExtra.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/NodeConfigurationExtra.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/NodeConfigurationExtra.java 2012-10-18 15:28:14 UTC (rev 7761)
@@ -0,0 +1,20 @@
+/*
+ GPL 2
+ */
+package org.fudaa.fudaa.crue.planimetry.configuration;
+
+import org.fudaa.dodico.crue.metier.emh.CatEMHNoeud;
+import org.fudaa.ebli.trace.TraceIconModel;
+import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryPointLayerModel;
+
+/**
+ *
+ * @author Frederic Deniger
+ */
+public interface NodeConfigurationExtra {
+
+ public void configureTraceIcon(TraceIconModel _ligne, CatEMHNoeud noeud, PlanimetryPointLayerModel model);
+
+ public String getDisplayedLabel(CatEMHNoeud noeud, NodeConfiguration aThis);
+
+}
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/VisuConfiguration.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/VisuConfiguration.java 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/configuration/VisuConfiguration.java 2012-10-18 15:28:14 UTC (rev 7761)
@@ -30,6 +30,7 @@
CasierConfiguration casierConfiguration;
CondLimitConfiguration condLimiteConfiguration;
public static final Font DEFAULT_FONT = createDefaultFont();
+
private static final Font createDefaultFont() {
// Theme.font
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerNodeController.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerNodeController.java 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/controller/LayerNodeController.java 2012-10-18 15:28:14 UTC (rev 7761)
@@ -18,6 +18,7 @@
import org.fudaa.fudaa.crue.planimetry.GeometryIndexer;
import org.fudaa.fudaa.crue.planimetry.PlanimetryVisuPanel;
import org.fudaa.fudaa.crue.planimetry.action.OpenEMHAction;
+import org.fudaa.fudaa.crue.planimetry.configuration.NodeConfigurationExtra;
import org.fudaa.fudaa.crue.planimetry.configuration.VisuConfiguration;
import org.fudaa.fudaa.crue.planimetry.layer.LayerControllerEMH;
import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryNodeLayer;
@@ -33,7 +34,16 @@
public class LayerNodeController extends LayerModelControllerDefault<PlanimetryNodeLayer> implements LayerControllerEMH {
GeometryIndexer nodeIndexer;
+ NodeConfigurationExtra nodeConfigurationExtra;
+ public NodeConfigurationExtra getNodeConfigurationExtra() {
+ return nodeConfigurationExtra;
+ }
+
+ public void setNodeConfigurationExtra(NodeConfigurationExtra nodeConfigurationExtra) {
+ this.nodeConfigurationExtra = nodeConfigurationExtra;
+ }
+
protected static LayerNodeController install(PlanimetryController ctx, PlanimetryVisuPanel res,
VisuConfiguration configuration) {
LayerNodeController nodeController = new LayerNodeController();
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryNodeLayer.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryNodeLayer.java 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryNodeLayer.java 2012-10-18 15:28:14 UTC (rev 7761)
@@ -23,8 +23,8 @@
*
* @author deniger ( genesis)
*/
-public class PlanimetryNodeLayer extends PlanimetryPointLayer<NodeConfiguration>
- implements LayerWithCascadeDeleteAction, PlanimetryLayerWithEMHContrat,CalqueWithDynamicActions {
+public class PlanimetryNodeLayer extends PlanimetryPointLayer<NodeConfiguration>
+ implements LayerWithCascadeDeleteAction, PlanimetryLayerWithEMHContrat, CalqueWithDynamicActions {
public PlanimetryNodeLayer(PlanimetryNodeLayerModel _modele, FSigEditor _editor) {
super(_modele, _editor);
@@ -35,6 +35,11 @@
}
@Override
+ public PlanimetryNodeLayerModel modeleDonnees() {
+ return (PlanimetryNodeLayerModel) super.modeleDonnees();
+ }
+
+ @Override
public EbliFindActionInterface getFinder() {
return new PlanimetryFindEMHLayerAction(this);
}
@@ -113,14 +118,7 @@
return;
}
CatEMHNoeud noeud = getNoeudController().getNoeud(idx);
- String nom = noeud.getNom();
- if (layerConfiguration.isDisplayCasierLabel()) {
- if (noeud.getCasier() != null) {
- if (noeud.getCasier().getActuallyActive() || layerConfiguration.isInactiveEMHVisible()) {
- nom = nom + "\n" + noeud.getCasier().getNom();
- }
- }
- }
+ String nom = layerConfiguration.getDisplayedLabel(noeud, (PlanimetryNodeLayerModel) modeleDonnees());
painter.paintLabels(g2d, pEcran, nom, labelConfiguration, alpha_);
}
}
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryNodeLayerModel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryNodeLayerModel.java 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryNodeLayerModel.java 2012-10-18 15:28:14 UTC (rev 7761)
@@ -15,6 +15,7 @@
import org.fudaa.dodico.crue.metier.emh.EnumNoeudType;
import org.fudaa.ebli.calque.edition.ZEditionAttributesDataI;
import org.fudaa.ebli.geometrie.GrPoint;
+import org.fudaa.fudaa.crue.planimetry.configuration.NodeConfigurationExtra;
import org.fudaa.fudaa.crue.planimetry.controller.LayerNodeController;
import org.fudaa.fudaa.crue.planimetry.controller.PlanimetryControllerHelper;
import org.fudaa.fudaa.crue.planimetry.controller.PlanimetryGisModelContainer;
@@ -25,10 +26,16 @@
*/
public class PlanimetryNodeLayerModel extends PlanimetryPointLayerModel<LayerNodeController> {
+ private NodeConfigurationExtra nodeConfigurationExtra;
+
public PlanimetryNodeLayerModel(GISZoneCollectionPoint _zone, LayerNodeController layerModelController) {
super(_zone, layerModelController);
}
+ public void setNodeConfigurationExtra(NodeConfigurationExtra nodeConfigurationExtra) {
+ this.nodeConfigurationExtra = nodeConfigurationExtra;
+ }
+
@Override
public boolean removePoint(int[] _idx, CtuluCommandContainer _cmd) {
return removeNoeuds(_idx, false);
@@ -103,4 +110,8 @@
List data = planimetryGisAttributeContext.buildNodeData(nd);
getGeometries().addGeometry(gisPt, data.toArray(), null);
}
+
+ public NodeConfigurationExtra getNodeConfigurationExtra() {
+ return nodeConfigurationExtra;
+ }
}
Modified: trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryPointLayer.java
===================================================================
--- trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryPointLayer.java 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/ui-planimetry/src/main/java/org/fudaa/fudaa/crue/planimetry/layer/PlanimetryPointLayer.java 2012-10-18 15:28:14 UTC (rev 7761)
@@ -36,6 +36,7 @@
return getLayerController().isEditable();
}
+ @Override
public LayerController getLayerController() {
return modeleDonnees().getLayerController();
}
Modified: trunk/soft/fudaa-crue/ui-report/pom.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-report/pom.xml 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/ui-report/pom.xml 2012-10-18 15:28:14 UTC (rev 7761)
@@ -167,7 +167,19 @@
<scope>provided</scope>
</dependency>
+ <!--bizarre, nécessaire pour les test-->
<dependency>
+ <groupId>jgrapht</groupId>
+ <artifactId>jgrapht</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jgraphx</groupId>
+ <artifactId>jgraphx</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
Modified: trunk/soft/fudaa-crue/ui-report/src/test/java/org/fudaa/fudaa/crue/report/ReportTestHelper.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/test/java/org/fudaa/fudaa/crue/report/ReportTestHelper.java 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/ui-report/src/test/java/org/fudaa/fudaa/crue/report/ReportTestHelper.java 2012-10-18 15:28:14 UTC (rev 7761)
@@ -10,7 +10,9 @@
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
@@ -21,6 +23,7 @@
import org.fudaa.dodico.crue.metier.emh.EMHScenario;
import org.fudaa.dodico.crue.metier.emh.IdRegistry;
import org.fudaa.dodico.crue.metier.emh.ResultatKey;
+import org.fudaa.dodico.crue.metier.etude.EMHProjectInfos;
import org.fudaa.dodico.crue.metier.etude.EMHProjet;
import org.fudaa.dodico.crue.projet.EMHScenarioContainer;
import org.fudaa.dodico.crue.projet.coeur.TestCoeurConfig;
@@ -38,10 +41,18 @@
public static Pair<EMHScenarioContainer, File> readScenario() {
Pair<EMHScenarioContainer, File> readScenarioAndRun = TestScenarioLoader.readScenarioAndRun();
PostServiceImpl postService = Lookup.getDefault().lookup(PostServiceImpl.class);
+ EMHProjet projet = new EMHProjet();
+ final EMHProjectInfos infos = new EMHProjectInfos();
+ Map<String, String> dir = new HashMap<String, String>();
+ dir.put(EMHProjectInfos.CONFIG, "nowherer");
+ infos.setDirectories(dir);
+ projet.setInfos(infos);
+
+ projet.setPropDefinition(TestCoeurConfig.INSTANCE);
+
//appele pour avoir le chargement:
ReportService reportService = Lookup.getDefault().lookup(ReportService.class);
- EMHProjet projet = new EMHProjet();
- projet.setPropDefinition(TestCoeurConfig.INSTANCE);
+
final EMHScenarioContainer first = readScenarioAndRun.first;
EMHScenario emhScenario = first.getEmhScenario();
IdRegistry idRegistry = new IdRegistry();
Modified: trunk/soft/fudaa-crue/ui-report/src/test/java/org/fudaa/fudaa/crue/report/ReportVisualTopComponentTest.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/test/java/org/fudaa/fudaa/crue/report/ReportVisualTopComponentTest.java 2012-10-18 14:00:59 UTC (rev 7760)
+++ trunk/soft/fudaa-crue/ui-report/src/test/java/org/fudaa/fudaa/crue/report/ReportVisualTopComponentTest.java 2012-10-18 15:28:14 UTC (rev 7761)
@@ -4,8 +4,22 @@
package org.fudaa.fudaa.crue.report;
import java.awt.EventQueue;
+import java.io.File;
+import org.fudaa.dodico.crue.common.Pair;
+import org.fudaa.dodico.crue.metier.emh.CatEMHNoeud;
+import org.fudaa.dodico.crue.projet.EMHScenarioContainer;
+import org.fudaa.ebli.trace.TraceIconModel;
+import org.fudaa.fudaa.crue.planimetry.PlanimetryVisuPanel;
+import org.fudaa.fudaa.crue.planimetry.configuration.NodeConfiguration;
+import org.fudaa.fudaa.crue.planimetry.configuration.NodeConfigurationExtra;
+import org.fudaa.fudaa.crue.planimetry.layer.PlanimetryPointLayerModel;
+import org.fudaa.fudaa.crue.report.service.ReportVisuPanelService;
import org.junit.Assert;
import org.junit.Test;
+import org.openide.util.Lookup;
+import org.openide.util.Lookup.Result;
+import org.openide.util.LookupEvent;
+import org.openide.util.LookupListener;
/**
*
@@ -33,4 +47,50 @@
Assert.fail(ex.getMessage());
}
}
+
+ private static class TestConfig implements NodeConfigurationExtra {
+
+ @Override
+ public void configureTraceIcon(TraceIconModel _ligne, CatEMHNoeud noeud, PlanimetryPointLayerModel model) {
+ }
+
+ @Override
+ public String getDisplayedLabel(CatEMHNoeud noeud, NodeConfiguration aThis) {
+ return "essai\nessai";
+ }
+ }
+
+ public static void main(String[] args) {
+ //pour activer le service
+ System.setProperty("dev.etcDir", "C:\\data\\Fudaa-Crue\\etc");
+ final ReportVisuPanelService reportVisuPanelService = Lookup.getDefault().lookup(ReportVisuPanelService.class);
+ Result<PlanimetryVisuPanel> lookup = reportVisuPanelService.getLookup().lookupResult(PlanimetryVisuPanel.class);
+ lookup.addLookupListener(new LookupListener() {
+ @Override
+ public void resultChanged(LookupEvent ev) {
+ PlanimetryVisuPanel planimetryVisuPanel = reportVisuPanelService.getPlanimetryVisuPanel();
+ if (planimetryVisuPanel != null) {
+ planimetryVisuPanel.getPlanimetryController().getCqNoeud().modeleDonnees().setNodeConfigurationExtra(new TestConfig());
+ }
+ }
+ });
+ PlanimetryVisuPanel planimetryVisuPanel = reportVisuPanelService.getPlanimetryVisuPanel();
+ if (planimetryVisuPanel != null) {
+ planimetryVisuPanel.getPlanimetryController().getCqNoeud().modeleDonnees().setNodeConfigurationExtra(new TestConfig());
+ }
+ final Pair<EMHScenarioContainer, File> load = ReportTestHelper.readScenario();
+ final ReportVisualTopComponent topComponent = new ReportVisualTopComponent();
+ topComponent.open();
+ topComponent.runLoaded();
+ topComponent.setEditable(true);
+ reportVisuPanelService.resultChanged(null);
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ ReportTestHelper.display(topComponent, load.second);
+ }
+ };
+ EventQueue.invokeLater(runnable);
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-10-24 22:27:38
|
Revision: 7802
http://fudaa.svn.sourceforge.net/fudaa/?rev=7802&view=rev
Author: deniger
Date: 2012-10-24 22:27:31 +0000 (Wed, 24 Oct 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/log/CtuluLogsTopComponent.java
trunk/soft/fudaa-crue/ui-sysdoc/src/main/java/org/fudaa/fudaa/crue/sysdoc/services/SysdocService.java
trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/Bundle.properties
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/services/
trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/services/Bundle.properties
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/log/CtuluLogsTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/log/CtuluLogsTopComponent.java 2012-10-24 22:17:46 UTC (rev 7801)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/log/CtuluLogsTopComponent.java 2012-10-24 22:27:31 UTC (rev 7802)
@@ -142,11 +142,11 @@
}
TableColumn getLinkTableColumn() {
- return getTableColumn(DocProperty.ID);
+ return getTableColumn(DocProperty.getDefaultDisplayName());
}
TableColumn getMediaTableColumn() {
- return getTableColumn(MultimediaDocProperty.ID);
+ return getTableColumn(MultimediaDocProperty.getDefaultDisplayName());
}
public void initForTrace(TObjectIntHashMap<String> verbosityByLevel) {
@@ -240,7 +240,7 @@
if (record != null) {
if (media) {
if (record.getHelpSupportUrl() != null) {
- sysdocContrat.displayMedia(record.getHelpUrl());
+ sysdocContrat.displayMedia(record.getHelpSupportUrl());
}
} else if (record.getHelpUrl() != null) {
Modified: trunk/soft/fudaa-crue/ui-sysdoc/src/main/java/org/fudaa/fudaa/crue/sysdoc/services/SysdocService.java
===================================================================
--- trunk/soft/fudaa-crue/ui-sysdoc/src/main/java/org/fudaa/fudaa/crue/sysdoc/services/SysdocService.java 2012-10-24 22:17:46 UTC (rev 7801)
+++ trunk/soft/fudaa-crue/ui-sysdoc/src/main/java/org/fudaa/fudaa/crue/sysdoc/services/SysdocService.java 2012-10-24 22:27:31 UTC (rev 7802)
@@ -7,6 +7,8 @@
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.fudaa.ctulu.CtuluLibFile;
import org.fudaa.dodico.crue.metier.emh.EMH;
import org.fudaa.fudaa.crue.common.helper.DialogHelper;
@@ -29,13 +31,13 @@
@ServiceProvider(service = SysdocService.class),
@ServiceProvider(service = SysdocContrat.class)})
public class SysdocService implements SysdocContrat {
-
+
private ConfigurationManagerService configurationManagerService = Lookup.getDefault().lookup(ConfigurationManagerService.class);
-
+
@Override
public void displayHelp(EMH emh) {
}
-
+
@Override
public void display(String path) {
SysdocTopComponent findTopComponent = (SysdocTopComponent) WindowManager.getDefault().findTopComponent(SysdocTopComponent.TOPCOMPONENT_ID);
@@ -45,7 +47,7 @@
}
findTopComponent.requestActive();
}
-
+
@Override
public void displayMedia(String helpUrl) {
File sysdocLocaleDir = getSysdocLocalizedDir();
@@ -56,10 +58,10 @@
try {
Desktop.getDesktop().open(target);
} catch (IOException ex) {
- Exceptions.printStackTrace(ex);
+ Logger.getLogger(SysdocService.class.getName()).log(Level.WARNING, "message {0}", ex);
}
}
-
+
public File getSysdocLocalizedDir() {
File sysdocBaseDir = new File(configurationManagerService.getCoeurManager().getSiteDir(), "sysdoc");
String local = configurationManagerService.getCurrentLocale();
Modified: trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/Bundle.properties
===================================================================
--- trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/Bundle.properties 2012-10-24 22:17:46 UTC (rev 7801)
+++ trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/Bundle.properties 2012-10-24 22:27:31 UTC (rev 7802)
@@ -18,4 +18,3 @@
Sysdoc.SearchTooltip=Rechercher
searchTextField.Tooltip=<html><body>Utiliser * pour inclure les mots contenants l'\u00e9l\u00e9ment de recheche.<br>Appuyer sur entr\u00e9e pour lancer la recherche</body></html>
SearchResultat.Accuracy=Pertinence: {0} %
-Sysdoc.DisplayMediaNotFound=Le m\u00e9dia n''est pas trouv\u00e9. Chemin: {0}
Copied: trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/services/Bundle.properties (from rev 7801, trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/Bundle.properties)
===================================================================
--- trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/services/Bundle.properties (rev 0)
+++ trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/services/Bundle.properties 2012-10-24 22:27:31 UTC (rev 7802)
@@ -0,0 +1 @@
+Sysdoc.DisplayMediaNotFound=Le m\u00e9dia n''est pas trouv\u00e9. Chemin: {0}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-10-24 22:34:50
|
Revision: 7804
http://fudaa.svn.sourceforge.net/fudaa/?rev=7804&view=rev
Author: deniger
Date: 2012-10-24 22:34:42 +0000 (Wed, 24 Oct 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml
trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/layer.xml
trunk/soft/fudaa-crue/ui-options/src/main/resources/org/fudaa/fudaa/crue/options/layer.xml
trunk/soft/fudaa-crue/ui-otfa/src/main/resources/org/fudaa/fudaa/crue/otfa/layer.xml
trunk/soft/fudaa-crue/ui-post/src/main/resources/org/fudaa/fudaa/crue/post/layer.xml
trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/layer.xml
trunk/soft/fudaa-crue/ui-study/src/main/resources/org/fudaa/fudaa/crue/study/layer.xml
trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/layer.xml
Modified: trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml 2012-10-24 22:29:03 UTC (rev 7803)
+++ trunk/soft/fudaa-crue/ui-branding/src/main/resources/org/fudaa/fudaa/crue/branding/layer.xml 2012-10-24 22:34:42 UTC (rev 7804)
@@ -67,9 +67,7 @@
<file name="org-netbeans-modules-favorites-View.shadow_hidden"/>
</folder>
</folder>
- <folder name="Shortcuts">
- <file name="F1.shadow_hidden"/>
- </folder>
+ <folder name="Shortcuts"/>
<folder name="Toolbars">
<file name="Standard.xml_hidden"/>
<file name="UndoRedo_hidden"/>
Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/layer.xml 2012-10-24 22:29:03 UTC (rev 7803)
+++ trunk/soft/fudaa-crue/ui-modelling/src/main/resources/org/fudaa/fudaa/crue/modelling/layer.xml 2012-10-24 22:34:42 UTC (rev 7804)
@@ -24,9 +24,7 @@
</folder>
</folder>
</folder>
- <folder name="Shortcuts">
- <file name="F1.shadow_hidden"/>
- </folder>
+ <folder name="Shortcuts"/>
<folder name="Toolbars">
<folder name="Perspective">
<file name="org-fudaa-fudaa-crue-modelling-perspective-ActiveModelisation.shadow">
Modified: trunk/soft/fudaa-crue/ui-options/src/main/resources/org/fudaa/fudaa/crue/options/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-options/src/main/resources/org/fudaa/fudaa/crue/options/layer.xml 2012-10-24 22:29:03 UTC (rev 7803)
+++ trunk/soft/fudaa-crue/ui-options/src/main/resources/org/fudaa/fudaa/crue/options/layer.xml 2012-10-24 22:34:42 UTC (rev 7804)
@@ -7,9 +7,7 @@
<file name="default-coeurs.zip" url="/default-coeurs.zip"/>
<file name="comparaisons.zip" url="/comparaisons.zip"/>
</folder>
- <folder name="Shortcuts">
- <file name="F1.shadow_hidden"/>
- </folder>
+ <folder name="Shortcuts"/>
<folder name="etc">
<file name="fudaacrue.conf" url="etc/fudaacrue.conf"/>
</folder>
Modified: trunk/soft/fudaa-crue/ui-otfa/src/main/resources/org/fudaa/fudaa/crue/otfa/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-otfa/src/main/resources/org/fudaa/fudaa/crue/otfa/layer.xml 2012-10-24 22:29:03 UTC (rev 7803)
+++ trunk/soft/fudaa-crue/ui-otfa/src/main/resources/org/fudaa/fudaa/crue/otfa/layer.xml 2012-10-24 22:34:42 UTC (rev 7804)
@@ -9,9 +9,7 @@
</folder>
</folder>
</folder>
- <folder name="Shortcuts">
- <file name="F1.shadow_hidden"/>
- </folder>
+ <folder name="Shortcuts"/>
<folder name="Toolbars">
<folder name="Perspective">
<file name="org-fudaa-fudaa-crue-otfa-perspective-ActiveOtfa.shadow">
Modified: trunk/soft/fudaa-crue/ui-post/src/main/resources/org/fudaa/fudaa/crue/post/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-post/src/main/resources/org/fudaa/fudaa/crue/post/layer.xml 2012-10-24 22:29:03 UTC (rev 7803)
+++ trunk/soft/fudaa-crue/ui-post/src/main/resources/org/fudaa/fudaa/crue/post/layer.xml 2012-10-24 22:34:42 UTC (rev 7804)
@@ -30,9 +30,7 @@
</folder>
</folder>
</folder>
- <folder name="Shortcuts">
- <file name="F1.shadow_hidden"/>
- </folder>
+ <folder name="Shortcuts"/>
<folder name="Toolbars">
<folder name="Perspective">
<file name="org-fudaa-fudaa-crue-post-perspective-ActivePost.shadow">
Modified: trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/layer.xml 2012-10-24 22:29:03 UTC (rev 7803)
+++ trunk/soft/fudaa-crue/ui-report/src/main/resources/org/fudaa/fudaa/crue/report/layer.xml 2012-10-24 22:34:42 UTC (rev 7804)
@@ -13,9 +13,7 @@
</folder>
</folder>
</folder>
- <folder name="Shortcuts">
- <file name="F1.shadow_hidden"/>
- </folder>
+ <folder name="Shortcuts"/>
<folder name="Toolbars">
<folder name="Perspective">
<file name="org-fudaa-fudaa-crue-report-perspective-ActiveReport.shadow">
Modified: trunk/soft/fudaa-crue/ui-study/src/main/resources/org/fudaa/fudaa/crue/study/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-study/src/main/resources/org/fudaa/fudaa/crue/study/layer.xml 2012-10-24 22:29:03 UTC (rev 7803)
+++ trunk/soft/fudaa-crue/ui-study/src/main/resources/org/fudaa/fudaa/crue/study/layer.xml 2012-10-24 22:34:42 UTC (rev 7804)
@@ -74,9 +74,7 @@
</folder>
</folder>
</folder>
- <folder name="Shortcuts">
- <file name="F1.shadow_hidden"/>
- </folder>
+ <folder name="Shortcuts"/>
<folder name="Toolbars">
<!--Perspective repris dans toolbar.xml et dans InitGeneralUIInstaller-->
<folder name="Perspective">
Modified: trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/layer.xml
===================================================================
--- trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/layer.xml 2012-10-24 22:29:03 UTC (rev 7803)
+++ trunk/soft/fudaa-crue/ui-sysdoc/src/main/resources/org/fudaa/fudaa/crue/sysdoc/layer.xml 2012-10-24 22:34:42 UTC (rev 7804)
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
- <folder name="Menu">
+ <folder name="Actions">
+ <folder name="Window"/>
+ </folder>
+ <folder name="Menu">
<folder name="Window">
<folder name="Sysdoc">
<attr name="displayName" bundlevalue="org.fudaa.fudaa.crue.sysdoc.Bundle#Menu/Sysdoc"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|