|
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.
|