Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- 3175 discussions
r1669 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by tchemit@users.labs.libre-entreprise.org 13 Dec '08
by tchemit@users.labs.libre-entreprise.org 13 Dec '08
13 Dec '08
Author: tchemit
Date: 2008-12-13 10:24:41 +0000 (Sat, 13 Dec 2008)
New Revision: 1669
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
Log:
scroll to selected node
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-13 09:35:22 UTC (rev 1668)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-13 10:24:41 UTC (rev 1669)
@@ -253,6 +253,7 @@
NavigationTreeNode node = NavigationUtil.findNode(this, null, path);
TreePath pathToRoot = new TreePath(getContextValue(NavigationTreeModel.class).getPathToRoot(node));
navigation.setSelectionPath(pathToRoot);
+ navigation.scrollPathToVisible(pathToRoot);
}
protected void setInfoText(String s){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
1
0
r1668 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/ui/input src/main/java/fr/ifremer/isisfish/ui/result
by tchemit@users.labs.libre-entreprise.org 13 Dec '08
by tchemit@users.labs.libre-entreprise.org 13 Dec '08
13 Dec '08
Author: tchemit
Date: 2008-12-13 09:35:22 +0000 (Sat, 13 Dec 2008)
New Revision: 1668
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EquationEditorPaneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java
Log:
remove deprecated code, javadoc, lissage code
pas de System.out.println
InputContent est un JAXXObject
passage de log en trace
refactor du builder de node :)
utilisation de r?\195?\169pertoires absolues pour les plugins maven
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/pom.xml 2008-12-13 09:35:22 UTC (rev 1668)
@@ -341,17 +341,17 @@
<id>Generator</id>
<phase>process-sources</phase>
<configuration>
- <srcDirUml>src/main/xmi</srcDirUml>
- <srcXmiDest>target/generated-sources/xmi/</srcXmiDest>
+ <srcDirUml>${project.basedir}/src/main/xmi</srcDirUml>
+ <srcXmiDest>${maven.gen.dir}/xmi/</srcXmiDest>
<fullPackagePath>fr.ifremer.isisfish</fullPackagePath>
<extractedPackages>fr.ifremer.isisfish</extractedPackages>
<!--Config generator-->
- <srcGenDest>target/generated-sources/objectmodel/</srcGenDest>
+ <srcGenDest>${maven.gen.dir}/objectmodel/</srcGenDest>
<includes>**/*.objectmodel</includes>
<templates>org.codelutin.topia.generator.TopiaMetaGenerator</templates>
- <destDirGen>target/generated-sources/java</destDirGen>
+ <destDirGen>${maven.gen.dir}/java</destDirGen>
<defaultPackage>fr.ifremer.isisfish</defaultPackage>
- <copyVersionDir>src/main/resources/oldmappings/%MODELNAME%</copyVersionDir>
+ <copyVersionDir>${project.basedir}/src/main/resources/oldmappings/%MODELNAME%</copyVersionDir>
<copyVersionFiles>**/*.hbm.xml</copyVersionFiles>
<copyOverwrite>true</copyOverwrite>
</configuration>
@@ -383,7 +383,7 @@
<goal>generate</goal>
</goals>
<configuration>
- <src>src/main/java</src>
+ <src>${project.basedir}/src/main/java</src>
</configuration>
</execution>
</executions>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EquationEditorPaneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EquationEditorPaneUI.jaxx 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EquationEditorPaneUI.jaxx 2008-12-13 09:35:22 UTC (rev 1668)
@@ -53,7 +53,7 @@
doc.setPage(e.getURL());
}
} catch (Exception eee) {
- System.out.println("Error for : " + e.getURL());
+ log.error("Error for : " + e.getURL(),eee);
eee.printStackTrace();
}
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-13 09:35:22 UTC (rev 1668)
@@ -128,7 +128,9 @@
protected boolean isNull = true;
public InputAction() {
- log.info("new instance");
+ if (log.isDebugEnabled()) {
+ log.debug("new instance");
+ }
}
protected void showMsgBox(Exception eee){
ErrorDialogUI.showError(eee);
@@ -290,9 +292,7 @@
//TODO Should use a shared model ?
simulationName = selectSimulation(SimulationStorage.getSimulationNames());
if (simulationName == null) {
- {
- return null;
- }
+ return null;
}
} catch (Exception e) {
@@ -303,7 +303,9 @@
return null;
}
- log.info("simulation used " + simulationName);
+ if (log.isInfoEnabled()) {
+ log.info("simulation used " + simulationName);
+ }
// ask new region name
String regionName = showInputDialog(_("isisfish.message.import.region.name"),"region from "+simulationName);
@@ -315,7 +317,9 @@
}
- log.info("new region name " + regionName);
+ if (log.isInfoEnabled()) {
+ log.info("new region name " + regionName);
+ }
try {
SimulationStorage.getSimulation(simulationName).extractRegion(regionName);
@@ -440,7 +444,9 @@
* @return if ok return null else OutView error
*/
public void loadRegion(String name) {
- log.debug("loadRegion called");
+ if (log.isTraceEnabled()) {
+ log.trace("loadRegion called");
+ }
try {
regionStorage = null;
fisheryRegion = null;
@@ -465,8 +471,10 @@
* @return if ok return null else OutView error
*/
public void newRegion(String name) {
- try {
- log.debug("newRegion called");
+ if (log.isTraceEnabled()) {
+ log.trace("newRegion called");
+ }
+ try {
if ("".equals(name)) {
// showMsgBox("error " + _("isisfish.error.region.name.empty"));
}
@@ -508,7 +516,9 @@
*/
@SuppressWarnings("unchecked")
public TopiaEntity create(String type) {
- log.debug("create called for " + type);
+ if (log.isTraceEnabled()) {
+ log.trace("create called for " + type);
+ }
try {
String name = type + "_new";
@@ -532,12 +542,12 @@
/**
* Save entity passed in argument, and commit
*
- * @param idToRefresh
- * id to refresh after commit
- * @return if ok return null else OutView error
+ * @return the saved entity
*/
public TopiaEntity save() {
- log.debug("save called");
+ if (log.isTraceEnabled()) {
+ log.trace("save called");
+ }
try {
if (selected == null) {
log.warn("Try to save null entity");
@@ -559,13 +569,12 @@
* Cancel all modification on entity (rollback), and force reload it and
* refresh all ui component that name match 'type'Tab
*
- * @param type
- * entity type (Zone, Gear, Population, ...), prefix of user
- * interface Tab to refresh after rollback and reload
- * @return if ok return null else OutView error
+ * @return the roolbacked entity
*/
public TopiaEntity cancel() {
- log.debug("cancel called");
+ if (log.isTraceEnabled()) {
+ log.trace("cancel called");
+ }
try {
isisContext.rollbackTransaction();
@@ -591,7 +600,9 @@
* @return if ok return null else OutView error
*/
public String remove() {
- log.debug("remove called");
+ if (log.isTraceEnabled()) {
+ log.trace("remove called");
+ }
String msg = "";
try {
boolean doDelete = true;
@@ -684,7 +695,9 @@
}
public Object openEditor(String category, String name,
Class javaInterface, String content, Editor editor) {
- log.debug("openEditor");
+ if (log.isTraceEnabled()) {
+ log.trace("openEditor");
+ }
try {
EquationEditorPaneUI pane = new EquationEditorPaneUI();
pane.setEquation(category, name, javaInterface, content);
@@ -785,7 +798,9 @@
}
public Object removeSelectivity(Selectivity selectivity){
- log.debug("removeTargetSpecies called: " + selectivity);
+ if (log.isTraceEnabled()) {
+ log.trace("removeTargetSpecies called: " + selectivity);
+ }
try {
if (gear != null && selectivity != null) {
gear.removePopulationSelectivity(selectivity);
@@ -800,7 +815,9 @@
// InputMetier
public Object createSeasonInfo(){
- log.debug("createSeasonInfo called");
+ if (log.isTraceEnabled()) {
+ log.trace("createSeasonInfo called");
+ }
try {
MetierSeasonInfoDAO metierSeasonInfoPS = IsisFishDAOHelper.getMetierSeasonInfoDAO(isisContext);
MetierSeasonInfo metierSeasonInfo = metierSeasonInfoPS.create();
@@ -819,7 +836,9 @@
}
public Object removeSeasonInfo(MetierSeasonInfo info){
- log.debug("createSeasonInfo called");
+ if (log.isTraceEnabled()) {
+ log.trace("createSeasonInfo called");
+ }
try {
metier.removeMetierSeasonInfo(info);
metier.update();
@@ -832,7 +851,9 @@
}
public Object addTargetSpecies(MetierSeasonInfo m, Species species, String targetFactorEquation, boolean primaryCatch){
- log.debug("addTargetSpecies called: " + metier + " " + species + " " + primaryCatch + " " + targetFactorEquation);
+ if (log.isTraceEnabled()) {
+ log.trace("addTargetSpecies called: " + metier + " " + species + " " + primaryCatch + " " + targetFactorEquation);
+ }
try {
TargetSpeciesDAO dao = IsisFishDAOHelper.getTargetSpeciesDAO(isisContext);
TargetSpecies targetSpecies = dao.create();
@@ -849,7 +870,9 @@
}
public Object removeTargetSpecies(MetierSeasonInfo m, TargetSpecies targetSpecies){
- log.debug("removeTargetSpecies called: " + targetSpecies);
+ if (log.isTraceEnabled()) {
+ log.trace("removeTargetSpecies called: " + targetSpecies);
+ }
try {
if (targetSpecies != null) {
m.removeSpeciesTargetSpecies(targetSpecies);
@@ -864,7 +887,9 @@
// SetOfVessels
public void addEffortDescription(SetOfVessels setOfVessels, Metier metier) {
- log.debug("addEffortDescription called: " + setOfVessels + " metier: " + metier);
+ if (log.isTraceEnabled()) {
+ log.trace("addEffortDescription called: " + setOfVessels + " metier: " + metier);
+ }
try {
EffortDescriptionDAO effortDescriptionPS = IsisFishDAOHelper.getEffortDescriptionDAO(isisContext);
EffortDescription effortDescription = effortDescriptionPS.create();
@@ -879,7 +904,9 @@
}
public Object removeEffortDescription(SetOfVessels sov, EffortDescription effort) {
- log.debug("remove called");
+ if (log.isTraceEnabled()) {
+ log.trace("remove called");
+ }
try {
sov.removePossibleMetiers(effort);
isisContext.commitTransaction();
@@ -893,7 +920,9 @@
// Population
public Population createPopulation() {
- log.debug("create called");
+ if (log.isTraceEnabled()) {
+ log.trace("create called");
+}
try {
String name = "Population_new";
@@ -918,7 +947,9 @@
}
public Object createRecruitmentDistribution() {
- log.debug("createRecruitmentDistributionontext called: " + population);
+ if (log.isTraceEnabled()) {
+ log.trace("createRecruitmentDistributionontext called: " + population);
+ }
try {
String val = JOptionPane.showInputDialog(_("isisfish.message.recruitment.number.month"));
int num = -1;
@@ -956,7 +987,9 @@
// Migration
public Object addMigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, Zone arrival, double coeff) {
- log.debug("addMigration called");
+ if (log.isTraceEnabled()) {
+ log.trace("addMigration called");
+ }
try {
MatrixND mat = info.getMigrationMatrix().copy();
mat.setValue(group, departure, arrival, coeff);
@@ -971,7 +1004,9 @@
public Object addEmigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, double coeff) {
- log.debug("addEmigration called");
+ if (log.isTraceEnabled()) {
+ log.trace("addEmigration called");
+ }
try {
MatrixND mat = info.getEmigrationMatrix().copy();
mat.setValue(group, departure, coeff);
@@ -985,7 +1020,9 @@
}
public Object addImmigration(PopulationSeasonInfo info, PopulationGroup group, Zone arrival, double coeff) {
- log.debug("addImmigration called");
+ if (log.isTraceEnabled()) {
+ log.trace("addImmigration called");
+ }
try {
MatrixND mat = info.getImmigrationMatrix().copy();
mat.setValue(group, arrival, coeff);
@@ -998,11 +1035,14 @@
return null;
}
// FisheryRegion
- /**
- * @param list la list dans lequel il faut ajouter la carte
- */
+ /**
+ *
+ * @return TODO
+ */
public Object addMap(){
- log.debug("AddMap called");
+ if (log.isTraceEnabled()) {
+ log.trace("AddMap called");
+ }
File shp = FileUtil.getFile(".*\\.shp", "shp file");
try {
@@ -1041,10 +1081,13 @@
}
/**
- * @param list la list dans lequel il faut retirer la carte
+ * @param selectedMaps la list dans lequel il faut retirer la carte
+ * @return TODO
*/
public Object removeMap(Object[] selectedMaps){
- log.debug("removeMap called");
+ if (log.isTraceEnabled()) {
+ log.trace("removeMap called");
+ }
try {
List<String> maps = fisheryRegion.getMapFileList();
@@ -1074,14 +1117,19 @@
* Affiche une boite de dialogue demandant a l'utilisateur de rentrer
* un nom de fichier, et met ce nom dans la textField.
* Passe le saveButton en enabled pour marque que la region a ete modifié
+ * @param cellFile file of cells
*/
public void loadCellFile(String cellFile){
- log.debug("loadCell called");
+ if (log.isTraceEnabled()) {
+ log.trace("loadCell called");
+ }
// FIXME todo loadCellFile
}
public Object saveFisheryRegion(String type){
- log.debug("save called");
+ if (log.isTraceEnabled()) {
+ log.trace("save called");
+ }
try{
TopiaContext isisContext = fisheryRegion.getTopiaContext();
@@ -1156,7 +1204,9 @@
public Object checkFisheryRegion(){
try {
- log.debug("check called: ");
+ if (log.isTraceEnabled()) {
+ log.trace("check called: ");
+ }
// frame.setInfoText(_("isisfish.message.check.region"));
CheckResult result = new CheckResult();
CheckRegion.check(fisheryRegion, result);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java 2008-12-13 09:35:22 UTC (rev 1668)
@@ -5,11 +5,13 @@
package fr.ifremer.isisfish.ui.input;
+import jaxx.runtime.JAXXObject;
+
/**
*
* @author letellier
*/
-public interface InputContent {
+public interface InputContent extends JAXXObject {
void refresh();
@@ -20,4 +22,6 @@
void setActif(java.lang.Boolean b);
void setChanged(java.lang.Boolean b);
+
+ String getName();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-13 09:35:22 UTC (rev 1668)
@@ -5,20 +5,36 @@
package fr.ifremer.isisfish.ui.input;
+import fr.ifremer.isisfish.entities.Cell;
+import fr.ifremer.isisfish.entities.FisheryRegion;
+import fr.ifremer.isisfish.entities.Gear;
+import fr.ifremer.isisfish.entities.Metier;
+import fr.ifremer.isisfish.entities.Population;
+import fr.ifremer.isisfish.entities.Port;
+import fr.ifremer.isisfish.entities.SetOfVessels;
+import fr.ifremer.isisfish.entities.Species;
+import fr.ifremer.isisfish.entities.TripType;
+import fr.ifremer.isisfish.entities.VesselType;
+import fr.ifremer.isisfish.entities.Zone;
+import jaxx.runtime.Decorator;
+import jaxx.runtime.JAXXContextEntryDef;
import jaxx.runtime.swing.CardLayout2;
import jaxx.runtime.swing.JAXXTree;
import jaxx.runtime.swing.navigation.NavigationTreeModel;
import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
+import jaxx.runtime.swing.navigation.NavigationTreeModelBuilder;
+import jaxx.runtime.swing.navigation.NavigationTreeModelBuilder.ChildBuilder;
import jaxx.runtime.swing.navigation.NavigationTreeSelectionAdapterWithCardLayout;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import static org.codelutin.i18n.I18n._;
+import org.codelutin.topia.persistence.TopiaEntity;
+import javax.swing.JOptionPane;
import javax.swing.JPanel;
+import javax.swing.JTree;
import javax.swing.event.TreeSelectionEvent;
import java.awt.Component;
-import javax.swing.JOptionPane;
-import javax.swing.JTree;
-import static org.codelutin.i18n.I18n._;
/** @author letellier */
public class InputNavigationTreeSelectionAdapter extends NavigationTreeSelectionAdapterWithCardLayout {
@@ -27,6 +43,7 @@
static private final Log log = LogFactory.getLog(InputNavigationTreeSelectionAdapter.class);
protected NavigationTreeNode currentNode = null;
+
public InputNavigationTreeSelectionAdapter(InputUI context, boolean register) {
super(InputUI.class, null, context, Strategy.PER_UI_TYPE);
@@ -77,7 +94,9 @@
try {
InputContent ui = (InputContent) newUI;
boolean parameter = !context.getContextValue(InputAction.class).isNull();
- log.debug(parameter);
+ if (log.isDebugEnabled()) {
+ log.debug(parameter);
+ }
// Method setActif = newUI.getClass().getDeclaredMethod("setActif", Boolean.class);
// setActif.setAccessible(true);
// setActif.invoke(newUI, parameter);
@@ -100,9 +119,11 @@
}
public boolean checkEdit(TreeSelectionEvent event, Component content) {
boolean exit = true;
- if (content != null){
+ if (content != null) {
InputContent ui = (InputContent) content;
- System.out.println(ui + " " + ui.isChanged() + " " + ui.isActif());
+ if (log.isDebugEnabled()) {
+ log.debug(ui.getClass()+"["+ui.getName() + "] <changed:" + ui.isChanged() + ", actif: " + ui.isActif()+">");
+ }
if (ui.isActif()) {
if (ui.isChanged()) {
// ask user to close edition
@@ -111,18 +132,16 @@
if (responce == JOptionPane.NO_OPTION) {
context.getContextValue(InputAction.class).cancel();
exit = true;
- }
- else if (responce == JOptionPane.OK_OPTION){
+ } else if (responce == JOptionPane.OK_OPTION) {
context.getContextValue(InputAction.class).save();
ui.setChanged(false);
- JTree tree = (JTree)event.getSource();
- NavigationTreeModel model = (NavigationTreeModel)tree.getModel();
- if (currentNode != null){
+ JTree tree = (JTree) event.getSource();
+ NavigationTreeModel model = (NavigationTreeModel) tree.getModel();
+ if (currentNode != null) {
model.nodeChanged(currentNode);
}
exit = true;
- }
- else{
+ } else {
exit = false;
}
}
@@ -148,4 +167,81 @@
}
action.setPath(node.getContextPath());
}
+
+ public static NavigationTreeModel getTreeModel(String regionName, FisheryRegion fisheryRegion) {
+
+ //String regionName = context.getContextValue(InputAction.class).getFisheryRegionName();
+ NavigationTreeModelBuilder builder = new NavigationTreeModelBuilder("/");
+
+ if (regionName == null) {
+ return null;
+ }
+
+ ChildBuilder<TopiaEntity> childBuilder = new ChildBuilder<TopiaEntity>(builder) {
+
+ Decorator<? extends TopiaEntity> decorator;
+
+ public void init(Class<? extends TopiaEntity> klass) {
+ decorator = jaxx.runtime.PropertyDecorator.newDecorator(klass, "name");
+ }
+
+ public Decorator<? extends TopiaEntity> getDecorator(TopiaEntity child) {
+ return decorator;
+ }
+
+ public String getJXPath(TopiaEntity child) {
+ return "..[@topiaId=\"" + child.getTopiaId() + "\"]";
+ }
+
+ public String getNavigationPath(TopiaEntity child) {
+ return child.getTopiaId();
+ }
+ };
+
+ try {
+
+ NavigationTreeNode root = builder.build(null, regionName, JAXXContextEntryDef.newDef(FisheryRegion.class), "$root", FisheryRegionUI.class, null);
+
+ childBuilder.build(builder.build(root, "Cells", "../cell", "$cells", CellUI.class, null),
+ true, Cell.class, fisheryRegion.getCell(), CellUI.class, null);
+
+ childBuilder.build(builder.build(root, "Zones", "../zone", "$zones", ZoneUI.class, null),
+ true, Zone.class, fisheryRegion.getZone(), ZoneUI.class, null);
+
+ childBuilder.build(builder.build(root, "Ports", "../port", "$ports", PortUI.class, null),
+ true, Port.class, fisheryRegion.getPort(), PortUI.class, null
+ );
+
+ NavigationTreeNode species = builder.build(root, "Species", "../species", "$species", SpeciesUI.class, null);
+
+ for (Species specie : fisheryRegion.getSpecies()) {
+ NavigationTreeNode speciesChild = builder.build(species, specie.toString(), "..[@topiaId=\"" + specie.getTopiaId() + "\"]", specie.getTopiaId(), SpeciesUI.class, null);
+ NavigationTreeNode populations = builder.build(speciesChild, "Populations", "../population", "$populations", PopulationUI.class, null);
+ childBuilder.build(populations, true, Population.class, specie.getPopulation(), PopulationUI.class, null);
+ }
+
+ childBuilder.build(builder.build(root, "Gears", "../gear", "$gears", GearUI.class, null),
+ true, Gear.class, fisheryRegion.getGear(), GearUI.class, null);
+
+ childBuilder.build(builder.build(root, "Metiers", "../metier", "$metiers", MetierUI.class, null),
+ true, Metier.class, fisheryRegion.getMetier(), MetierUI.class, null);
+
+ childBuilder.build(builder.build(root, "TripTypes", "../tripType", "$tripTypes", TripTypeUI.class, null),
+ true, TripType.class, fisheryRegion.getTripType(), TripTypeUI.class, null);
+
+ childBuilder.build(builder.build(root, "VesselTypes", "../vesselType", "$vesselTypes", VesselTypeUI.class, null),
+ true, VesselType.class, fisheryRegion.getVesselType(), VesselTypeUI.class, null);
+
+ childBuilder.build(builder.build(root, "SetOfVessels", "../setOfVessels", "$setOfVessels", SetOfVesselsUI.class, null),
+ true, SetOfVessels.class, fisheryRegion.getSetOfVessels(), SetOfVesselsUI.class, null);
+
+ childBuilder.build(builder.build(root, "Strategies", "../strategy", "$strategies", StrategyUI.class, null),
+ true, fr.ifremer.isisfish.entities.Strategy.class, fisheryRegion.getStrategy(), StrategyUI.class, null);
+
+ } catch (Exception ex) {
+ log.error(ex.getMessage(), ex);
+ }
+ return builder.getModel();
+ }
+
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-13 09:35:22 UTC (rev 1668)
@@ -231,63 +231,19 @@
return result;
} */
protected void setTreeModel(){
-
String regionName = getContextValue(InputAction.class).getFisheryRegionName();
- if (regionName != null){
- try {
- NavigationTreeModelBuilder builder = new NavigationTreeModelBuilder("/");
- FisheryRegion fisheryRegion = getContextValue(InputAction.class).getFisheryRegion();
- setContextValue(fisheryRegion);
- NavigationTreeNode root = builder.build(null, regionName, JAXXContextEntryDef.newDef(FisheryRegion.class), "$root", FisheryRegionUI.class, null);
- NavigationTreeNode cells = builder.build(root, "Cells", "../cell", "$cells", CellUI.class, null);
- NavigationTreeNode zones = builder.build(root, "Zones", "../zone", "$zones", ZoneUI.class, null);
- NavigationTreeNode ports = builder.build(root, "Ports", "../port", "$ports", PortUI.class, null);
- NavigationTreeNode species = builder.build(root, "Species", "../species", "$species", SpeciesUI.class, null);
- NavigationTreeNode gears = builder.build(root, "Gears", "../gear", "$gears", GearUI.class, null);
- NavigationTreeNode metiers = builder.build(root, "Metiers", "../metier", "$metiers", MetierUI.class, null);
- NavigationTreeNode tripTypes = builder.build(root, "TripTypes", "../tripType", "$tripTypes", TripTypeUI.class, null);
- NavigationTreeNode vesselTypes = builder.build(root, "VesselTypes", "../vesselType", "$vesselTypes", VesselTypeUI.class, null);
- NavigationTreeNode setOfVessels = builder.build(root, "SetOfVessels", "../setOfVessels", "$setOfVessels", SetOfVesselsUI.class, null);
- NavigationTreeNode strategies = builder.build(root, "Strategies", "../strategy", "$strategies", StrategyUI.class, null);
+ FisheryRegion fisheryRegion = getContextValue(InputAction.class).getFisheryRegion();
+ setContextValue(fisheryRegion);
+ NavigationTreeModel model = InputNavigationTreeSelectionAdapter.getTreeModel(regionName, fisheryRegion);
+ navigation.setSelectionModel(navigationSelectionModel);
+ navigation.setCellRenderer(new NavigationTreeCellRenderer(this));
- setNode(builder, cells, fisheryRegion.getCell().toArray(), CellUI.class, Cell.class);
- setNode(builder, zones, fisheryRegion.getZone().toArray(), ZoneUI.class, Zone.class);
- setNode(builder, ports, fisheryRegion.getPort().toArray(), PortUI.class, Port.class);
- setNode(builder, gears, fisheryRegion.getGear().toArray(), GearUI.class, Gear.class);
- setNode(builder, metiers, fisheryRegion.getMetier().toArray(), MetierUI.class, Metier.class);
- setNode(builder, tripTypes, fisheryRegion.getTripType().toArray(), TripTypeUI.class, TripType.class);
- setNode(builder, vesselTypes, fisheryRegion.getVesselType().toArray(), VesselTypeUI.class, VesselType.class);
- setNode(builder, setOfVessels, fisheryRegion.getSetOfVessels().toArray(), SetOfVesselsUI.class, SetOfVessels.class);
- setNode(builder, strategies, fisheryRegion.getStrategy().toArray(), StrategyUI.class, Strategy.class);
-
- for (Species specie : fisheryRegion.getSpecies()){
- TopiaEntity topiaEntity = (TopiaEntity)specie;
- NavigationTreeNode speciesChild = builder.build(species, specie.toString() , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), SpeciesUI.class, null);
- NavigationTreeNode populations = builder.build(speciesChild, "Populations", "../population", "$populations", PopulationUI.class, null);
- if (specie.getPopulation() != null){
- setNode(builder, populations, specie.getPopulation().toArray(), PopulationUI.class, Population.class);
- }
- }
-
- navigation.setSelectionModel(navigationSelectionModel);
- navigation.setCellRenderer(new NavigationTreeCellRenderer(this));
- NavigationTreeModel model = builder.getModel();
- setContextValue(model);
- navigation.setModel(model);
- new InputNavigationTreeSelectionAdapter(this, true);
- setTreeSelection("$root");
- } catch (Exception ex) {
- Logger.getLogger(InputUI.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
+ setContextValue(model);
+ navigation.setModel(model);
+ new InputNavigationTreeSelectionAdapter(this, true);
+ setTreeSelection("$root");
}
- protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui, Class<?> type){
- Decorator deco = jaxx.runtime.PropertyDecorator.newDecorator(type, "name");
- for (Object o : values){
- TopiaEntity topiaEntity = (TopiaEntity)o;
- builder.build(parent, deco , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), ui, null);
- }
- }
+
public void repaintNode(String path){
NavigationTreeModel model = getContextValue(NavigationTreeModel.class);
NavigationTreeNode currentNode = model.findNode(path);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-13 09:35:22 UTC (rev 1668)
@@ -116,7 +116,9 @@
int i = 0;
for (Cell c : cellsSelected){
indexs[i] = zoneCellsModel.indexOf(c);
- System.out.println("refresh " + c + " " + i);
+ if (log.isDebugEnabled()) {
+ log.debug("refresh " + c + " " + i);
+ }
i++;
}
zoneCells.setSelectedIndices(indexs);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java 2008-12-13 09:35:22 UTC (rev 1668)
@@ -91,11 +91,9 @@
setStatusOK(true);
}
- /* (non-Javadoc)
- * @see java.lang.Object#finalize()
- */
@Override
protected void finalize() throws Throwable {
+ super.finalize();
if (this.tx != null) {
this.tx.closeContext();
}
@@ -139,6 +137,7 @@
* infoItemTab. Le 0 contient les dates.
*
* @param group le group utilise pour mettre a jour le infoItemTab
+ * @return todo
*/
protected InfoPanelable [] createInfoPanel(MatrixND group) {
if (group == null){
@@ -177,7 +176,7 @@
getInfoPanel().setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
- c.gridy = 0000;
+ c.gridy = 0;
c.weightx = 1;
c.weighty = 1;
c.gridwidth = 1;
@@ -204,7 +203,7 @@
/**
* Set the value of simulation.
- * @param v Value to assign to simulation.
+ * @param simulation Value to assign to simulation.
*/
public void setSimulation(SimulationStorage simulation) {
try {
@@ -213,8 +212,9 @@
this.tx.closeContext();
}
this.tx = simulation.getStorage().beginTransaction();
- FisheryRegion region = simulation.getFisheryRegion();
-
+ FisheryRegion region = SimulationStorage.getFisheryRegion(this.tx);
+ //FisheryRegion region = simulation.getFisheryRegion();
+
mapBean.setRegion(region);
resultManager = simulation.getResultStorage();
@@ -264,13 +264,13 @@
mat1 = mat1.sumOverDim(0);
mat1 = mat1.sumOverDim(1);
mat1 = mat1.reduce();
- resume.append(_("isisfish.result.begin.simulation")+mat1.getName()+": "+mat1.getValue(0)+"\n");
+ resume.append(_("isisfish.result.begin.simulation")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
mat1 = resultManager.getMatrix(resultManager.getLastDate(), name, tx);
mat1 = mat1.sumOverDim(0);
mat1 = mat1.sumOverDim(1);
mat1 = mat1.reduce();
- resume.append(_("isisfish.result.end.simulation")+mat1.getName()+": "+mat1.getValue(0)+"\n");
+ resume.append(_("isisfish.result.end.simulation")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
}
else if(name.startsWith(REJETPARMETIER_STRING)){
MatrixND mat1 = resultManager.getMatrix(name, tx);
@@ -280,7 +280,7 @@
mat1 = mat1.sumOverDim(3);
mat1 = mat1.reduce();
- resume.append(_("isisfish.common.sum")+mat1.getName()+": "+mat1.getValue(0)+"\n");
+ resume.append(_("isisfish.common.sum")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
}
else if (!name.startsWith(CAPTUREPARMETIER_STRING) && name.startsWith(CAPTURE_STRING)){
MatrixND mat1 = resultManager.getMatrix(name, tx);
@@ -289,7 +289,7 @@
mat1 = mat1.sumOverDim(2);
mat1 = mat1.reduce();
- resume.append(_("isisfish.common.sum")+mat1.getName()+": "+mat1.getValue(0)+"\n");
+ resume.append(_("isisfish.common.sum")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
}
} catch (Exception eee) {
resume.append(_("isisfish.error.no.matrix" + name));
@@ -334,8 +334,11 @@
* Method reduction permet de reduire la matrice en fonction des
* selections de l'utilisateur dans l'interface.
*
- * @param group
- */
+ * @param matrix todo
+ *
+ * @param infoItems todo
+ * @return todo
+ */
protected MatrixND createAndReduce(MatrixND matrix, InfoPanelable [] infoItems){
// Reduit la matrice en fonction des choix de l utilisateur
@@ -525,7 +528,7 @@
* les methods que l'on trouve dans les scripts de l'objet Export.
*/
public Vector getMenuExport_menuChilds(){
- Vector result = new Vector();
+ Vector<JMenuItem> result = new Vector<JMenuItem>();
for (String name : ExportStorage.getExportNames()) {
JMenuItem item = getExportMenu(name);
result.add(item);
@@ -536,7 +539,9 @@
/**
* Retourne l'item de menu qui permet l'appelle de la method du code
* ECMAScript d'export.
- */
+ * @param methodName todo
+ * @return todo
+ */
protected JMenuItem getExportMenu(String methodName){
JMenuItem result = new JMenuItem(_(methodName));
result.addActionListener(new ExportActionListener(methodName));
1
0
r1667 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/ui/input
by tchemit@users.labs.libre-entreprise.org 12 Dec '08
by tchemit@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: tchemit
Date: 2008-12-12 20:41:08 +0000 (Fri, 12 Dec 2008)
New Revision: 1667
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
Log:
utilisation jaxx en snapshot pour avoir l'amelioration du rendu des nodes mais c'est pas encore ?\195?\167a.
ajout de TODO dans CellUI pour utiliser des PCS et le binding jaxx
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-12 19:51:39 UTC (rev 1666)
+++ isis-fish/trunk/pom.xml 2008-12-12 20:41:08 UTC (rev 1667)
@@ -306,7 +306,7 @@
<!--labs.project>isis-fish</labs.project-->
<!-- jaxx version -->
- <jaxx.version>0.7</jaxx.version>
+ <jaxx.version>0.8-SNAPSHOT</jaxx.version>
<!-- generator version -->
<generator.version>0.62</generator.version>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-12 19:51:39 UTC (rev 1666)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-12 20:41:08 UTC (rev 1667)
@@ -113,9 +113,9 @@
getParentContainer(InputUI.class).setTreeSelection("$root/$zones");
}
protected void valueChanged(boolean b){
- changed=b;
- save.setEnabled(b);
- cancel.setEnabled(b);
+ //TODO remove method valueChanged
+ // must use the setter to fire property changes, and make possible bindings
+ setChanged(b);
}
protected void setInfoText(String txt){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
@@ -125,21 +125,25 @@
Cell c = (Cell)fieldCell.getSelectedItem();
getContextValue(InputAction.class).setValue(c);
getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+c.getTopiaId());
+ //fixme no :) as you select a new node, you should not do anything more on ui ?
refresh();
valueChanged(true);
}
protected void nameChanged(){
getContextValue(InputAction.class).getCell().setName(fieldCellName.getText());
+ //fixme no :) use a propertyChangeListener on the bean
refresh();
valueChanged(true);
}
protected void cellLandChanged(){
getContextValue(InputAction.class).getCell().setLand(fieldCellLand.isSelected());
+ //fixme no :) use a propertyChangeListener on the bean
refresh();
valueChanged(true);
}
protected void commentChanged(){
getContextValue(InputAction.class).getCell().setComment(fieldCellComment.getText());
+ //fixme no :) use a propertyChangeListener on the bean
refresh();
valueChanged(true);
}
1
0
r1666 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by tchemit@users.labs.libre-entreprise.org 12 Dec '08
by tchemit@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: tchemit
Date: 2008-12-12 19:51:39 +0000 (Fri, 12 Dec 2008)
New Revision: 1666
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
Log:
chargement des regions sans frezzer l'ordinateur :)
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-12 19:51:39 UTC (rev 1666)
@@ -100,11 +100,15 @@
return new DefaultComboBoxModel(Common.getRegionItem());
}
protected void regionChange(){
- String name = fieldCurrentRegion.getSelectedItem().toString();
+ final String name = fieldCurrentRegion.getSelectedItem().toString();
setInfoText(_("isisfish.message.loading.region", name));
- getContextValue(InputAction.class).loadRegion(name);
- setInfoText(_("isisfish.message.load.finished"));
- setTreeModel();
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ getContextValue(InputAction.class).loadRegion(name);
+ setInfoText(_("isisfish.message.load.finished"));
+ setTreeModel();
+ }
+ });
}
/* protected void setTreeModel(){
tree.setModel(getTreeModel());
@@ -277,10 +281,10 @@
}
}
}
- protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui, Class type){
+ protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui, Class<?> type){
+ Decorator deco = jaxx.runtime.PropertyDecorator.newDecorator(type, "name");
for (Object o : values){
- TopiaEntity topiaEntity = (TopiaEntity)o;
- Decorator deco = JXPathDecorator.newDecorator(type, "${name}$s");
+ TopiaEntity topiaEntity = (TopiaEntity)o;
builder.build(parent, deco , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), ui, null);
}
}
1
0
r1665 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by sletellier@users.labs.libre-entreprise.org 12 Dec '08
by sletellier@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: sletellier
Date: 2008-12-12 16:35:44 +0000 (Fri, 12 Dec 2008)
New Revision: 1665
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
Log:
Remove entity works
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -97,6 +97,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$gears");
valueChanged(false);
refresh();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -179,6 +179,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$metiers");
valueChanged(false);
seasonInit = false;
refresh();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -109,6 +109,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$metiers");
valueChanged(false);
refresh();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -289,6 +289,9 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species/" + species.getTopiaId() + "/$populations");
valueChanged(false);
refresh();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -184,6 +184,9 @@
}
protected void setInfoText(String txt){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species/" + species.getTopiaId() + "/$populations");
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -133,6 +133,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$ports");
valueChanged(false);
refresh();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -165,6 +165,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels");
valueChanged(false);
refresh();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -98,6 +98,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species");
valueChanged(false);
refresh();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -160,6 +160,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$strategies");
valueChanged(false);
refresh();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -113,6 +113,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes");
valueChanged(false);
refresh();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -107,6 +107,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes");
valueChanged(false);
refresh();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -172,6 +172,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$zones");
valueChanged(false);
refresh();
}
1
0
r1664 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by sletellier@users.labs.libre-entreprise.org 12 Dec '08
by sletellier@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: sletellier
Date: 2008-12-12 16:23:58 +0000 (Fri, 12 Dec 2008)
New Revision: 1664
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
Log:
Save popup works
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -98,15 +98,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$cells/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Cell");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void goToZone(){
@@ -201,10 +201,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -113,16 +113,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$setOfVessels/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("SetOfVessels");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -130,7 +129,7 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(GearUI.class).setChanged(b);
save.setEnabled(b);
cancel.setEnabled(b);
}
@@ -366,10 +365,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.3'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.3'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.3'>
<JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -93,6 +93,7 @@
fieldMapfiles.setModel(model);
}
protected void valueChanged(boolean b){
+ changed = b;
save.setEnabled(b);
cancel.setEnabled(b);
}
@@ -155,16 +156,15 @@
protected void save(){
setMsg(_("isisfish.message.checking.cell"));
getContextValue(InputAction.class).saveFisheryRegion("FisheryRegion");
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root");
valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root");
setMsg(_("isisfish.message.save.finished"));
+ refresh();
}
protected void cancel(){
- getContextValue(InputAction.class).cancel("FisheryRegion");
+ getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root");
}
protected void check(){
getContextValue(InputAction.class).checkFisheryRegion();
@@ -312,10 +312,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.3'>
- <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/>
+ <JButton id='save' enabled='{isChanged()}' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.3'>
- <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
+ <JButton id='cancel' enabled='{isChanged()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
</cell>
<cell fill='horizontal' weightx='0.3'>
<JButton id='check' text="isisfish.common.check" onActionPerformed='check()'/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -42,7 +42,9 @@
import fr.ifremer.isisfish.ui.WelcomePanelUI;
import org.codelutin.topia.persistence.TopiaEntity;
import org.codelutin.topia.TopiaException;
-
+ import jaxx.runtime.swing.navigation.NavigationTreeModel;
+ import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
+
public GearTabUI (InputAction action){
setContextValue(action);
@@ -82,17 +84,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$gears/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Gear");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -105,9 +105,7 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
- cancel.setEnabled(b);
- save.setEnabled(b);
+ getParentContainer(GearUI.class).setChanged(b);
}
protected void nameChanged(){
getContextValue(InputAction.class).getGear().setName(fieldGearName.getText());
@@ -204,15 +202,15 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id="save" enabled='{isActif()}' text="isisfish.common.save" onActionPerformed='save()'/>
+ <JButton id="save" enabled='{isChanged()}' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' enabled='{isActif()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
+ <JButton id='cancel' enabled='{isChanged()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id="create" text="isisfish.common.new" onActionPerformed='create()' enabled='{isActif()}'/>
+ <JButton id="create" text="isisfish.common.new" onActionPerformed='create()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
<JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -44,14 +44,31 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.Metier;
+ init();
public GearUI (InputAction action){
-
+
setContextValue(action);
}
public void refresh() {
gearTabUI.refresh();
selectivityUI.refresh();
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ gearTabUI.setActif((Boolean)evt.getNewValue());
+ selectivityUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ gearTabUI.setChanged((Boolean)evt.getNewValue());
+ selectivityUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void goToMetier(){
getParentContainer(InputUI.class).setTreeSelection("$root/$metiers");
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-12 16:23:58 UTC (rev 1664)
@@ -125,6 +125,7 @@
protected VesselType vesselType;
protected SetOfVessels setOfVessels;
protected Strategy strategy;
+ protected boolean isNull = true;
public InputAction() {
log.info("new instance");
@@ -133,22 +134,24 @@
ErrorDialogUI.showError(eee);
}
public void setValue(Object value) {
- cell = null;
- zone = null;
- port = null;
- species = null;
- population = null;
- gear = null;
- metier = null;
- tripType = null;
- vesselType = null;
- setOfVessels = null;
- strategy = null;
- selected=null;
+// cell = null;
+// zone = null;
+// port = null;
+// species = null;
+// population = null;
+// gear = null;
+// metier = null;
+// tripType = null;
+// vesselType = null;
+// setOfVessels = null;
+// strategy = null;
+// selected=null;
if (!(value instanceof TopiaEntity)) {
// this is not a TopiaEntity value, so quit
+ isNull = true;
return;
}
+ isNull = false;
switch (IsisFishEntityEnum.valueOf(value.getClass())){
case Zone:
zone = (Zone) value;
@@ -185,8 +188,11 @@
strategy = (Strategy) value;
break;
}
- selected = (TopiaEntity) value;
+ selected = (TopiaEntity) value;
}
+ public boolean isNull(){
+ return isNull;
+ }
public void setPath(String path){
this.path = path;
}
@@ -558,7 +564,7 @@
* interface Tab to refresh after rollback and reload
* @return if ok return null else OutView error
*/
- public TopiaEntity cancel(String type) {
+ public TopiaEntity cancel() {
log.debug("cancel called");
try {
isisContext.rollbackTransaction();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-12 16:23:58 UTC (rev 1664)
@@ -17,6 +17,7 @@
import javax.swing.event.TreeSelectionEvent;
import java.awt.Component;
import javax.swing.JOptionPane;
+import javax.swing.JTree;
import static org.codelutin.i18n.I18n._;
/** @author letellier */
@@ -25,6 +26,7 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private final Log log = LogFactory.getLog(InputNavigationTreeSelectionAdapter.class);
+ protected NavigationTreeNode currentNode = null;
public InputNavigationTreeSelectionAdapter(InputUI context, boolean register) {
super(InputUI.class, null, context, Strategy.PER_UI_TYPE);
@@ -74,13 +76,14 @@
// apply refresh method (should a contract for all this ui with a method refresh...)
try {
InputContent ui = (InputContent) newUI;
- boolean parameter = context.getContextValue(InputAction.class).getSelected() != null;
+ boolean parameter = !context.getContextValue(InputAction.class).isNull();
log.debug(parameter);
// Method setActif = newUI.getClass().getDeclaredMethod("setActif", Boolean.class);
// setActif.setAccessible(true);
// setActif.invoke(newUI, parameter);
ui.setActif(parameter);
ui.refresh();
+ currentNode = node;
// Method refresh = newUI.getClass().getDeclaredMethod("refresh");
// refresh.setAccessible(true);
// refresh.invoke(newUI);
@@ -92,32 +95,46 @@
@Override
protected boolean closeUI(TreeSelectionEvent event, Component component) throws Exception {
// by default, we says that component was succesfull closed
- return checkEdit(component);
+ boolean exit = checkEdit(event, component);
+ return exit;
}
- public boolean checkEdit(Component content) {
- boolean wasClosed = true;
+ public boolean checkEdit(TreeSelectionEvent event, Component content) {
+ boolean exit = true;
if (content != null){
InputContent ui = (InputContent) content;
+ System.out.println(ui + " " + ui.isChanged() + " " + ui.isActif());
if (ui.isActif()) {
if (ui.isChanged()) {
// ask user to close edition
// still in edit mode, must warn user
- boolean willQuit = askUser(content, _("isisfish.message.page.modified"));
- if (!willQuit) {
- return false;
+ int responce = askUser(content, _("isisfish.message.page.modified"));
+ if (responce == JOptionPane.NO_OPTION) {
+ context.getContextValue(InputAction.class).cancel();
+ exit = true;
}
+ else if (responce == JOptionPane.OK_OPTION){
+ context.getContextValue(InputAction.class).save();
+ ui.setChanged(false);
+ JTree tree = (JTree)event.getSource();
+ NavigationTreeModel model = (NavigationTreeModel)tree.getModel();
+ if (currentNode != null){
+ model.nodeChanged(currentNode);
+ }
+ exit = true;
+ }
+ else{
+ exit = false;
+ }
}
- context.getContextValue(InputAction.class).save();
- ui.setChanged(false);
}
}
- return wasClosed;
+ return exit;
}
- public boolean askUser(Component parent, String message) {
+ public int askUser(Component parent, String message) {
int response = JOptionPane.showConfirmDialog(parent, message,
- _("isisfish.input.menu.commit"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
- return response == JOptionPane.OK_OPTION;
+ _("isisfish.input.menu.commit"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
+ return response;
}
@Override
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -69,6 +69,8 @@
import fr.ifremer.isisfish.entities.FisheryRegion;
import jaxx.runtime.swing.navigation.NavigationTreeCellRenderer;
import jaxx.runtime.swing.navigation.NavigationTreeModel;
+ import jaxx.runtime.Decorator;
+ import jaxx.runtime.JXPathDecorator;
/* tree.addTreeSelectionListener(new TreeSelectionListener() {
@Override
@@ -244,22 +246,22 @@
NavigationTreeNode setOfVessels = builder.build(root, "SetOfVessels", "../setOfVessels", "$setOfVessels", SetOfVesselsUI.class, null);
NavigationTreeNode strategies = builder.build(root, "Strategies", "../strategy", "$strategies", StrategyUI.class, null);
- setNode(builder, cells, fisheryRegion.getCell().toArray(), CellUI.class);
- setNode(builder, zones, fisheryRegion.getZone().toArray(), ZoneUI.class);
- setNode(builder, ports, fisheryRegion.getPort().toArray(), PortUI.class);
- setNode(builder, gears, fisheryRegion.getGear().toArray(), GearUI.class);
- setNode(builder, metiers, fisheryRegion.getMetier().toArray(), MetierUI.class);
- setNode(builder, tripTypes, fisheryRegion.getTripType().toArray(), TripTypeUI.class);
- setNode(builder, vesselTypes, fisheryRegion.getVesselType().toArray(), VesselTypeUI.class);
- setNode(builder, setOfVessels, fisheryRegion.getSetOfVessels().toArray(), SetOfVesselsUI.class);
- setNode(builder, strategies, fisheryRegion.getStrategy().toArray(), StrategyUI.class);
+ setNode(builder, cells, fisheryRegion.getCell().toArray(), CellUI.class, Cell.class);
+ setNode(builder, zones, fisheryRegion.getZone().toArray(), ZoneUI.class, Zone.class);
+ setNode(builder, ports, fisheryRegion.getPort().toArray(), PortUI.class, Port.class);
+ setNode(builder, gears, fisheryRegion.getGear().toArray(), GearUI.class, Gear.class);
+ setNode(builder, metiers, fisheryRegion.getMetier().toArray(), MetierUI.class, Metier.class);
+ setNode(builder, tripTypes, fisheryRegion.getTripType().toArray(), TripTypeUI.class, TripType.class);
+ setNode(builder, vesselTypes, fisheryRegion.getVesselType().toArray(), VesselTypeUI.class, VesselType.class);
+ setNode(builder, setOfVessels, fisheryRegion.getSetOfVessels().toArray(), SetOfVesselsUI.class, SetOfVessels.class);
+ setNode(builder, strategies, fisheryRegion.getStrategy().toArray(), StrategyUI.class, Strategy.class);
for (Species specie : fisheryRegion.getSpecies()){
TopiaEntity topiaEntity = (TopiaEntity)specie;
NavigationTreeNode speciesChild = builder.build(species, specie.toString() , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), SpeciesUI.class, null);
- NavigationTreeNode populations = builder.build(speciesChild, "Population", "../population", "$populations", PopulationUI.class, null);
+ NavigationTreeNode populations = builder.build(speciesChild, "Populations", "../population", "$populations", PopulationUI.class, null);
if (specie.getPopulation() != null){
- setNode(builder, populations, specie.getPopulation().toArray(), PopulationUI.class);
+ setNode(builder, populations, specie.getPopulation().toArray(), PopulationUI.class, Population.class);
}
}
@@ -275,14 +277,19 @@
}
}
}
- protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui){
+ protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui, Class type){
for (Object o : values){
TopiaEntity topiaEntity = (TopiaEntity)o;
- builder.build(parent, o.toString() , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), ui, null);
+ Decorator deco = JXPathDecorator.newDecorator(type, "${name}$s");
+ builder.build(parent, deco , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), ui, null);
}
}
- protected void setTreeSelection(String path){
- System.out.println(path);
+ public void repaintNode(String path){
+ NavigationTreeModel model = getContextValue(NavigationTreeModel.class);
+ NavigationTreeNode currentNode = model.findNode(path);
+ model.nodeChanged(currentNode);
+ }
+ public void setTreeSelection(String path){
NavigationTreeNode node = NavigationUtil.findNode(this, null, path);
TreePath pathToRoot = new TreePath(getContextValue(NavigationTreeModel.class).getPathToRoot(node));
navigation.setSelectionPath(pathToRoot);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -192,22 +192,22 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$metiers/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(MetierUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
protected void openEditor(){
getContextValue(InputAction.class).openEditor("TargetFactor","new",fr.ifremer.isisfish.equation.TargetSpeciesTargetFactorEquation.class, fieldTargetFactorScript.getText(), fieldTargetFactorScript);
@@ -306,10 +306,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='false'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='false'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -165,16 +165,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$metiers/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
- seasonInit = false;
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -188,8 +188,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
+ getParentContainer(MetierUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
protected void zonesChanged(){
Object selected = fieldMetierSeasonChoice.getSelectedItem();
@@ -272,10 +273,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id ='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id ='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -96,17 +96,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$metiers/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -119,9 +117,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
- cancel.setEnabled(b);
+ getParentContainer(MetierUI.class).setChanged(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
]]></script>
<row>
@@ -169,10 +167,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id="save" text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id="save" text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id="cancel" text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id="cancel" text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -43,6 +43,8 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.TripType;
+
+ init();
public MetierUI (InputAction action){
setContextValue(action);
@@ -54,6 +56,24 @@
metierSeasonInfoUI.setSeasonInit(true);
metierSeasonInfoUI.refresh();
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ metierTabUI.setActif((Boolean)evt.getNewValue());
+ metierSeasonSpeciesUI.setActif((Boolean)evt.getNewValue());
+ metierSeasonInfoUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ metierTabUI.setChanged((Boolean)evt.getNewValue());
+ metierSeasonSpeciesUI.setChanged((Boolean)evt.getNewValue());
+ metierSeasonInfoUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void goToTripType(){
getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes");
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -120,7 +120,7 @@
GenericCell c = new GenericCell(f.getName(), f, Formule.class);
model.addElement(c);
if (pop != null){
- if (((Equation)f).equals(pop.getGrowth())){
+ if (f.equals((Formule)pop.getGrowth())){
selected = c;
}
}
@@ -275,18 +275,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- Population population = (Population) topia;
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+ population.getSpecies().getTopiaId() +"/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Population");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -299,9 +297,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
- cancel.setEnabled(b);
+ getParentContainer(PopulationUI.class).setChanged(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
]]>
</script>
@@ -446,10 +444,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -80,16 +80,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$population/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -97,9 +97,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
]]>
</script>
@@ -127,10 +127,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -45,6 +45,7 @@
import fr.ifremer.isisfish.entities.Population;
protected Population pop = null;
+ init();
public PopulationEquationUI (InputAction action){
setContextValue(action);
@@ -58,21 +59,39 @@
naturalDeathRate.refresh();
meanWeight.refresh();
price.refresh();
- valueChanged(false);
}
}
+
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ naturalDeathRate.setActif((Boolean)evt.getNewValue());
+ meanWeight.setActif((Boolean)evt.getNewValue());
+ price.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ naturalDeathRate.setChanged((Boolean)evt.getNewValue());
+ meanWeight.setChanged((Boolean)evt.getNewValue());
+ price.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Population");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -80,7 +99,7 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
save.setEnabled(b);
cancel.setEnabled(b);
}
@@ -103,10 +122,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" enabled='{isActif()}' onActionPerformed='cancel()'/>
+ <JButton id='cancel' text="isisfish.common.cancel" enabled='{isChanged()}' onActionPerformed='cancel()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" enabled='{isActif()}' onActionPerformed='save()'/>
+ <JButton id='save' text="isisfish.common.save" enabled='{isChanged()}' onActionPerformed='save()'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -114,16 +114,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Population");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -131,8 +131,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
]]>
</script>
@@ -210,10 +211,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' enabled='{isActif()}' text="isisfish.common.save" onActionPerformed='save()'/>
+ <JButton id='save' enabled='{isChanged()}' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' enabled='{isActif()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
+ <JButton id='cancel' enabled='{isChanged()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -45,6 +45,7 @@
protected Population pop = null;
protected PopulationSeasonInfo popInfo = null;
+ init();
public PopulationMigrationEquationUI (InputAction action){
setContextValue(action);
@@ -68,6 +69,24 @@
emigrationEquation.refresh();
immigrationEquation.refresh();
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ migrationEquation.setActif((Boolean)evt.getNewValue());
+ emigrationEquation.setActif((Boolean)evt.getNewValue());
+ immigrationEquation.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ migrationEquation.setChanged((Boolean)evt.getNewValue());
+ emigrationEquation.setChanged((Boolean)evt.getNewValue());
+ immigrationEquation.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
]]>
</script>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -48,6 +48,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+ init();
protected Population pop;
// protected PopulationSeasonInfo populationSeasonInfoSelected = null;
public PopulationMigrationUI (InputAction action){
@@ -79,6 +80,26 @@
fieldPopulationMigrationComment.setText("");
}
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ populationMigrationEquationUI.setActif((Boolean)evt.getNewValue());
+ populationMigrationMigrationUI.setActif((Boolean)evt.getNewValue());
+ populationMigrationImmigrationUI.setActif((Boolean)evt.getNewValue());
+ populationMigrationEmigrationUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ populationMigrationEquationUI.setChanged((Boolean)evt.getNewValue());
+ populationMigrationMigrationUI.setChanged((Boolean)evt.getNewValue());
+ populationMigrationImmigrationUI.setChanged((Boolean)evt.getNewValue());
+ populationMigrationEmigrationUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void setFieldPopulationMigrationSeasonChooserModel(){
DefaultComboBoxModel model = new DefaultComboBoxModel();
for (PopulationSeasonInfo psi : pop.getPopulationSeasonInfo()){
@@ -116,16 +137,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Population");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -133,9 +154,9 @@
root.setInfoText(txt);
}
public void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
]]>
</script>
@@ -179,10 +200,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -135,16 +135,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -152,9 +152,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
]]>
</script>
@@ -237,10 +237,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -165,15 +165,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -186,9 +187,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
]]>
</script>
@@ -245,10 +246,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -46,6 +46,8 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.Gear;
+
+ init();
public PopulationUI (InputAction action){
setContextValue(action);
}
@@ -60,6 +62,34 @@
populationMigrationUI.refresh();
setSpecies();
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ populationBasicsUI.setActif((Boolean)evt.getNewValue());
+ populationGroupUI.setActif((Boolean)evt.getNewValue());
+ populationEquationUI.setActif((Boolean)evt.getNewValue());
+ populationZoneUI.setActif((Boolean)evt.getNewValue());
+ populationSeasonsUI.setActif((Boolean)evt.getNewValue());
+ populationCapturabilityUI.setActif((Boolean)evt.getNewValue());
+ populationRecruitementUI.setActif((Boolean)evt.getNewValue());
+ populationMigrationUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ populationBasicsUI.setChanged((Boolean)evt.getNewValue());
+ populationGroupUI.setChanged((Boolean)evt.getNewValue());
+ populationEquationUI.setChanged((Boolean)evt.getNewValue());
+ populationZoneUI.setChanged((Boolean)evt.getNewValue());
+ populationSeasonsUI.setChanged((Boolean)evt.getNewValue());
+ populationCapturabilityUI.setChanged((Boolean)evt.getNewValue());
+ populationRecruitementUI.setChanged((Boolean)evt.getNewValue());
+ populationMigrationUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void setSpecies(){
String[] paths = getContextValue(InputAction.class).getPath().split("/");
String topiaId = null;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -160,16 +160,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Population");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -177,7 +177,7 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
save.setEnabled(b);
cancel.setEnabled(b);
}
@@ -226,12 +226,12 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -120,17 +120,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$ports/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$ports/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Port");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$ports/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -147,8 +145,8 @@
}
protected void valueChanged(boolean b){
changed=b;
- cancel.setEnabled(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
protected void nameChanged(){
getContextValue(InputAction.class).getPort().setName(fieldPortName.getText());
@@ -206,10 +204,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -150,22 +150,19 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$gears/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Gear");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void valueChanged(boolean b){
- changed=b;
- cancel.setEnabled(b);
- save.setEnabled(b);
+ getParentContainer(GearUI.class).setChanged(b);
}
protected void equationChanged(){
GenericCell g = (GenericCell)fieldSelectivityEquation.getSelectedItem();
@@ -252,10 +249,10 @@
</row>
<row>
<cell fill='horizontal' weightx='1.0'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -152,17 +152,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$setOfVessels/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("SetOfVessels");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -175,9 +173,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
- cancel.setEnabled(b);
+ getParentContainer(GearUI.class).setChanged(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
protected void nameChanged(){
getContextValue(InputAction.class).getSetOfVessels().setName(fieldSetOfVesselsName.getText());
@@ -333,10 +331,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='1.0'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -44,6 +44,7 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.Strategy;
+ init();
public SetOfVesselsUI (InputAction action){
setContextValue(action);
@@ -51,7 +52,23 @@
public void refresh() {
setOfVesselsTabsUI.refresh();
effortDescriptionUI.refresh();
- }
+ }
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ setOfVesselsTabsUI.setActif((Boolean)evt.getNewValue());
+ effortDescriptionUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ setOfVesselsTabsUI.setChanged((Boolean)evt.getNewValue());
+ effortDescriptionUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void goToStrategies(){
getParentContainer(InputUI.class).setTreeSelection("$root/$strategies");
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -73,6 +73,7 @@
fieldSpeciesComment.setText("");
goToPopulation.setEnabled(false);
}
+ valueChanged(false);
}
protected void create(){
TopiaEntity topia = getContextValue(InputAction.class).create("Species");
@@ -84,18 +85,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+topia.getTopiaId());
-
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Species");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -109,8 +107,8 @@
}
protected void valueChanged(boolean b){
changed=b;
- cancel.setEnabled(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
protected void setInfoText(String txt){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
@@ -212,10 +210,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -44,6 +44,7 @@
import fr.ifremer.isisfish.ui.WelcomePanelUI;
import org.codelutin.topia.persistence.TopiaEntity;
+ init();
public StrategyMonthInfoUI (InputAction action){
setContextValue(action);
@@ -74,17 +75,53 @@
strategyNovember.refresh();
strategyDecember.refresh();
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ strategyJanuary.setActif((Boolean)evt.getNewValue());
+ strategyFebuary.setActif((Boolean)evt.getNewValue());
+ strategyMarch.setActif((Boolean)evt.getNewValue());
+ strategyApril.setActif((Boolean)evt.getNewValue());
+ strategyMay.setActif((Boolean)evt.getNewValue());
+ strategyJune.setActif((Boolean)evt.getNewValue());
+ strategyJuly.setActif((Boolean)evt.getNewValue());
+ strategyAugust.setActif((Boolean)evt.getNewValue());
+ strategySeptember.setActif((Boolean)evt.getNewValue());
+ strategyOctober.setActif((Boolean)evt.getNewValue());
+ strategyNovember.setActif((Boolean)evt.getNewValue());
+ strategyDecember.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ strategyJanuary.setChanged((Boolean)evt.getNewValue());
+ strategyFebuary.setChanged((Boolean)evt.getNewValue());
+ strategyMarch.setChanged((Boolean)evt.getNewValue());
+ strategyApril.setChanged((Boolean)evt.getNewValue());
+ strategyMay.setChanged((Boolean)evt.getNewValue());
+ strategyJune.setChanged((Boolean)evt.getNewValue());
+ strategyJuly.setChanged((Boolean)evt.getNewValue());
+ strategyAugust.setChanged((Boolean)evt.getNewValue());
+ strategySeptember.setChanged((Boolean)evt.getNewValue());
+ strategyOctober.setChanged((Boolean)evt.getNewValue());
+ strategyNovember.setChanged((Boolean)evt.getNewValue());
+ strategyDecember.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$strategies/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Strategy");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -92,9 +129,9 @@
root.setInfoText(txt);
}
public void valueChanged(boolean b){
+ changed = b;
save.setEnabled(b);
cancel.setEnabled(b);
- changed = b;
}
]]></script>
<Table constraints='BorderLayout.CENTER'>
@@ -150,10 +187,10 @@
<Table constraints='BorderLayout.SOUTH'>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/>
+ <JButton id='save' enabled='{isChanged()}' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
+ <JButton id='cancel' enabled='{isChanged()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -119,7 +119,6 @@
}
protected void valueChanged(boolean b){
getParentContainer(StrategyMonthInfoUI.class).valueChanged(b);
- changed = b;
}
]]></script>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -147,17 +147,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$strategies/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Strategy");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -171,8 +169,8 @@
}
protected void valueChanged(boolean b){
changed=b;
- cancel.setEnabled(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
]]></script>
<row>
@@ -260,10 +258,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -42,13 +42,30 @@
<Boolean id='changed' javaBean='false'/>
<script><![CDATA[
+ init();
public StrategyUI (InputAction action){
setContextValue(action);
}
public void refresh() {
strategyTabUI.refresh();
strategyMonthInfoUI.refresh();
- }
+ }
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ strategyTabUI.setActif((Boolean)evt.getNewValue());
+ strategyMonthInfoUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ strategyTabUI.setChanged((Boolean)evt.getNewValue());
+ strategyMonthInfoUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
]]></script>
<tab title='{_("isisfish.strategy.title")}'><StrategyTabUI id='strategyTabUI' constructorParams='getContextValue(InputAction.class)'/></tab>
<tab title='{_("isisfish.strategyMonthInfo.title")}'><StrategyMonthInfoUI id='strategyMonthInfoUI' constructorParams='getContextValue(InputAction.class)'/></tab>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -71,8 +71,8 @@
}
protected void valueChanged(boolean b){
changed=b;
- cancel.setEnabled(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
protected void nameChanged(){
getContextValue(InputAction.class).getTripType().setName(fieldTripTypeName.getText());
@@ -100,17 +100,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$tripTypes/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("TripType");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -168,15 +166,15 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='create' text="isisfish.common.new" onActionPerformed='create()' enabled='{isActif()}'/>
+ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
<JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/>
@@ -184,7 +182,7 @@
</row>
<row>
<cell columns ='2' fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.input.continueVesselTypes" onActionPerformed='goToVesselTypes()' enabled='{isActif()}'/>
+ <JButton text="isisfish.input.continueVesselTypes" onActionPerformed='goToVesselTypes()'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -94,17 +94,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$vesselTypes/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("VesselType");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -117,32 +115,40 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
+ changed = b;
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
protected void goToSetOfVessels(){
getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels");
}
protected void nameChanged(){
getContextValue(InputAction.class).getVesselType().setName(fieldVesselTypeName.getText());
+ valueChanged(true);
}
protected void lenghtChanged(){
getContextValue(InputAction.class).getVesselType().setLength(Integer.parseInt(fieldVesselTypeLength.getText()));
+ valueChanged(true);
}
protected void speedChanged(){
getContextValue(InputAction.class).getVesselType().setSpeed(Double.parseDouble(fieldVesselTypeSpeed.getText()));
+ valueChanged(true);
}
protected void tripDurationChanged(){
getContextValue(InputAction.class).getVesselType().setMaxTripDuration(new TimeUnit(Double.parseDouble(fieldVesselTypeMaxTripDuration.getText())));
+ valueChanged(true);
}
protected void activityRangeChanged(){
getContextValue(InputAction.class).getVesselType().setActivityRange(Double.parseDouble(fieldVesselTypeActivityRange.getText()));
+ valueChanged(true);
}
protected void minCrewChanged(){
getContextValue(InputAction.class).getVesselType().setMinCrewSize(Integer.parseInt(fieldVesselTypeMinCrewSize.getText()));
+ valueChanged(true);
}
protected void unitFuelCostChanged(){
getContextValue(InputAction.class).getVesselType().setUnitFuelCostOfTravel(Double.parseDouble(fieldVesselTypeUnitFuelCostOfTravel.getText()));
+ valueChanged(true);
}
protected void tripTypeChanged(){
Object[] values = vesselTypeTripType.getSelectedValues();
@@ -151,9 +157,11 @@
tripTypes.add((TripType)((GenericCell)o).getValue());
}
getContextValue(InputAction.class).getVesselType().setTripType(tripTypes);
+ valueChanged(true);
}
protected void commentChanged(){
getContextValue(InputAction.class).getVesselType().setComment(fieldVesselTypeComment.getText());
+ valueChanged(true);
}
]]></script>
<Table constraints='BorderLayout.CENTER'>
@@ -244,10 +252,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -70,8 +70,7 @@
}
@Override
- public void focusLost(FocusEvent e) {
- System.out.println(changed);
+ public void focusLost(FocusEvent e) {;
if (changed){
if (!askAndSave()){
getParentContainer(InputUI.class).setTreeSelection("$root/$zones"+getContextValue(InputAction.class).getZone().getTopiaId());
@@ -103,8 +102,8 @@
return result;
}
public void refresh() {
- Zone z = getContextValue(InputAction.class).getZone();
- if (z != null){
+ if (! getContextValue(InputAction.class).isNull()){
+ Zone z = getContextValue(InputAction.class).getZone();
DefaultListModel zoneCellsModel = new DefaultListModel();
java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
for (Cell c : cells){
@@ -160,17 +159,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$zones/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$zones/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Zone");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$zones/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -192,7 +189,6 @@
protected void zoneCellsChange(){
java.util.List<Cell> cells = new ArrayList<Cell>();
for (Object o : zoneCells.getSelectedValues()){
- System.out.println("zoneCellChanged " + o);
cells.add((Cell) o);
}
getContextValue(InputAction.class).getZone().setCell(cells);
@@ -200,14 +196,13 @@
refreshMap();
}
protected void nameChange(){
- System.out.println("InputAction " + getContextValue(InputAction.class) + " getZone "+getContextValue(InputAction.class).getZone()+" fieldZoneName.getText() "+ fieldZoneName.getText());
getContextValue(InputAction.class).getZone().setName(fieldZoneName.getText());
valueChanged(true);
}
protected void valueChanged(boolean b){
changed = b;
- cancel.setEnabled(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
]]>
</script>
@@ -219,12 +214,11 @@
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
<JLabel enabled='{isActif()}' text="isisfish.zone.name"/>
-
</cell>
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JTextField id="fieldZoneName" enabled='{isActif()}' onKeyTyped='valueChanged(true)'/>
+ <JTextField id="fieldZoneName" enabled='{isActif()}' onKeyTyped='nameChange()'/>
<!-- onFocusLost='nameChange()' -->
</cell>
</row>
@@ -254,10 +248,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" enabled='{isActif()}' onActionPerformed='save()'/>
+ <JButton id='save' text="isisfish.common.save" enabled='{isChanged()}' onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" enabled='{isActif()}' onActionPerformed='cancel()'/>
+ <JButton id='cancel' text="isisfish.common.cancel" enabled='{isChanged()}' onActionPerformed='cancel()'/>
</cell>
</row>
<row>
1
0
r1663 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 12 Dec '08
by chatellier@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: chatellier
Date: 2008-12-12 15:31:49 +0000 (Fri, 12 Dec 2008)
New Revision: 1663
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Fix la creation d'un repertoire vide ne contenant aucune simulation
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-12 15:27:58 UTC (rev 1662)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-12 15:31:49 UTC (rev 1663)
@@ -851,6 +851,9 @@
isisfish.simulator.launcher.remote=on remote server
isisfish.simulator.launcher.subprocess=in subprocess
isisfish.simulator.simulaction.init=Error during simulation init \: %s
+isisfish.simulator.simulaction.loadOldSimulation=Can't load old simulation \: %s
+isisfish.simulator.simulaction.regionChange=Can't change region \: %s
+isisfish.simulator.simulaction.viewlogerror=Can't view log \: %s
isisfish.simulator.subprocess.readoutput.error=
isisfish.species.age=age
isisfish.species.cee=CEE
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-12 15:27:58 UTC (rev 1662)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-12 15:31:49 UTC (rev 1663)
@@ -851,6 +851,9 @@
isisfish.simulator.launcher.remote=sur un serveur distant
isisfish.simulator.launcher.subprocess=dans un sous processus
isisfish.simulator.simulaction.init=Erreur d'initialisation de la simulation \: %s
+isisfish.simulator.simulaction.loadOldSimulation=Erreur lors du chargement d'une ancienne simulation \: %s
+isisfish.simulator.simulaction.regionChange=Erreur lors du changement de region \: %s
+isisfish.simulator.simulaction.viewlogerror=Erreur de visualisation des logs \: %s
isisfish.simulator.subprocess.readoutput.error=
isisfish.species.age=age
isisfish.species.cee=CEE
1
0
r1662 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: . simulator
by chatellier@users.labs.libre-entreprise.org 12 Dec '08
by chatellier@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: chatellier
Date: 2008-12-12 15:27:58 +0000 (Fri, 12 Dec 2008)
New Revision: 1662
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
Log:
Fix la creation d'un repertoire vide ne contenant aucune simulation
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java 2008-12-12 14:19:06 UTC (rev 1661)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java 2008-12-12 15:27:58 UTC (rev 1662)
@@ -70,11 +70,7 @@
try {
List<String> oldSimul = new ArrayList<String>();
-
- // FIXME chatellier : Ajout d'une entrée vide pour forcer la sélection
- // et que le changement lance un evenement sur la liste
- oldSimul.add(" ");
-
+
FilterModel<SimulationProperties, String> filterModel;
// keep in context list of old simulation names (for filter process)
oldSimul.addAll(SimulationStorage.getSimulationNames());
@@ -84,6 +80,11 @@
// we must fill filterModel result with original items
filterModel.selectAll();
Object[] result = oldSimul.toArray();
+
+ // FIXME chatellier : Ajout d'une entrée vide pour forcer la sélection
+ // et que le changement lance un evenement sur la liste
+ oldSimul.add(0," ");
+
return result;
} catch (ParseException ex) {
Logger.getLogger(Common.class.getName()).log(Level.SEVERE, null, ex);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-12 14:19:06 UTC (rev 1661)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-12 15:27:58 UTC (rev 1662)
@@ -60,6 +60,7 @@
import fr.ifremer.isisfish.simulator.launcher.SimulationJob;
import fr.ifremer.isisfish.simulator.launcher.SimulationService;
import fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher;
+import fr.ifremer.isisfish.ui.Common;
import fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil;
import fr.ifremer.isisfish.ui.widget.filter.FilterModel;
import java.io.BufferedReader;
@@ -211,7 +212,7 @@
SimulationLoggerUtil.showSimulationLogConsole(id);
} catch (Exception eee) {
UserLog.error(_("Can't open log for %s", id), eee);
- return ("Error.xml" + "error" + eee.getMessage());
+ return (_("isisfish.simulator.simulaction.viewlogerror",eee.getMessage()));
}
return null;
}
@@ -235,7 +236,7 @@
}
}
catch (Exception eee){
- return ("Error.xml" + "error" + eee.getMessage());
+ return (_("isisfish.simulator.simulaction.regionChange",eee.getMessage()));
}
return null;
}
@@ -257,7 +258,7 @@
regionStorage = param.getRegion();
} catch (Exception eee) {
log.error("Can't load old Simulation: " + simulName, eee);
- return ("Error.xml" + "error" + eee.getMessage());
+ return (_("isisfish.simulator.simulaction.loadOldSimulation",eee.getMessage()));
}
return null;
}
@@ -401,22 +402,19 @@
return SimulatorStorage.getSimulatorNames();
}
-
/*
* Return old simulations
*
* @param
* @return old simulations
+ *
+ * @deprecated use fr.ifremer.isisfish.ui.Common.getOldSimulationItem()
*/
public List<String> getOldSimulationItem() {
try {
oldSimulNames = new ArrayList<String>();
-
- // FIXME chatellier : Ajout d'une entrée vide pour forcer la sélection
- // et que le changement lance un evenement sur la liste
- oldSimulNames.add(" ");
-
+
FilterModel<SimulationProperties, String> filterModel;
// keep in context list of old simulation names (for filter process)
oldSimulNames.addAll(SimulationStorage.getSimulationNames());
@@ -425,6 +423,13 @@
// to used directly model.getFilteredResult() in xml
// we must fill filterModel result with original items
filterModel.selectAll();
+
+ // chatellier : Ajout d'une entrée vide pour forcer la sélection
+ // et que le changement lance un evenement sur la liste
+ // Add empty item after, otherwise, un " " directory
+ // will be created
+ oldSimulNames.add(0, " ");
+
return oldSimulNames;
} catch (ParseException ex) {
Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
1
0
r1661 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/ui java/fr/ifremer/isisfish/ui/simulator resources/i18n
by chatellier@users.labs.libre-entreprise.org 12 Dec '08
by chatellier@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: chatellier
Date: 2008-12-12 14:19:06 +0000 (Fri, 12 Dec 2008)
New Revision: 1661
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Correction de la selection des premier item vides des listes
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java 2008-12-11 17:26:48 UTC (rev 1660)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java 2008-12-12 14:19:06 UTC (rev 1661)
@@ -44,31 +44,37 @@
public class Common {
- /*
+ /**
* Return regions
*
- * @param
* @return regions
*/
static public Object[] getRegionItem() {
List<String> regionNames = new ArrayList<String>();
+
+ // FIXME chatellier : Ajout d'une entrée vide pour forcer la sélection
+ // et que le changement lance un evenement sur la liste
regionNames.add(" ");
+
regionNames.addAll(RegionStorage.getRegionNames());
Object[] result = regionNames.toArray();
return result;
}
- /*
+ /**
* Return old simulations
*
- * @param
* @return old simulations
*/
static public Object[] getOldSimulationItem() {
-
+
try {
List<String> oldSimul = new ArrayList<String>();
+
+ // FIXME chatellier : Ajout d'une entrée vide pour forcer la sélection
+ // et que le changement lance un evenement sur la liste
oldSimul.add(" ");
+
FilterModel<SimulationProperties, String> filterModel;
// keep in context list of old simulation names (for filter process)
oldSimul.addAll(SimulationStorage.getSimulationNames());
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-12-11 17:26:48 UTC (rev 1660)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-12-12 14:19:06 UTC (rev 1661)
@@ -84,25 +84,29 @@
// fieldSimulParamsName.setText(name);
// }
protected void regionChange(){
- WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
- root.setInfoText(_("isisfish.message.loading.region"));
- showMsgBox(getContextValue(SimulAction.class).regionChange(fieldSimulParamsRegion.getSelectedItem().toString()));
- refresh();
- root.setInfoText(_("isisfish.message.region.loaded"));
+ // le premier item est " " pour ne pas avoir de selection par defaut
+ String selected = fieldSimulParamsRegion.getSelectedItem().toString();
+ if(selected != null && !selected.trim().isEmpty()) {
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText(_("isisfish.message.loading.region"));
+ showMsgBox(getContextValue(SimulAction.class).regionChange(fieldSimulParamsRegion.getSelectedItem().toString()));
+ refresh();
+ root.setInfoText(_("isisfish.message.region.loaded"));
+ }
}
public void setSimulationParameter(SimulAction simulAction){
getContextValue(SimulAction.class).setSimulationParameter(simulAction.getSimulationParameter());
}
protected void loadOldSimulation(){
-
- WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
- root.setInfoText(_("isisfish.message.loading.old.simulation"));
String selected = fieldSimulParamsSelect.getSelectedItem().toString();
- if (selected.equals(" ")){
+ // le premier item est " " pour ne pas avoir de selection par defaut
+ if (selected != null && !selected.equals(" ")){
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText(_("isisfish.message.loading.old.simulation"));
showMsgBox(getContextValue(SimulAction.class).loadOldSimulation(selected));
refresh();
+ root.setInfoText(_("isisfish.message.old.simulation.loaded"));
}
- root.setInfoText(_("isisfish.message.old.simulation.loaded"));
}
protected void addRules(){
getContextValue(SimulAction.class).addRules(fieldSimulParamsMesuresSelect.getSelectedItem().toString());
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-11 17:26:48 UTC (rev 1660)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-12 14:19:06 UTC (rev 1661)
@@ -126,7 +126,7 @@
}
catch (Exception eee) {
log.error("Can't init SimulationParameter", eee);
- return ("Error.xml" + "error" + eee.getMessage());
+ return (_("isisfish.simulator.simulaction.init",eee.getMessage()));
}
return null;
}
@@ -412,7 +412,11 @@
try {
oldSimulNames = new ArrayList<String>();
+
+ // FIXME chatellier : Ajout d'une entrée vide pour forcer la sélection
+ // et que le changement lance un evenement sur la liste
oldSimulNames.add(" ");
+
FilterModel<SimulationProperties, String> filterModel;
// keep in context list of old simulation names (for filter process)
oldSimulNames.addAll(SimulationStorage.getSimulationNames());
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-11 17:26:48 UTC (rev 1660)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-12 14:19:06 UTC (rev 1661)
@@ -850,6 +850,7 @@
isisfish.simulator.launcher.inprocess=in current process
isisfish.simulator.launcher.remote=on remote server
isisfish.simulator.launcher.subprocess=in subprocess
+isisfish.simulator.simulaction.init=Error during simulation init \: %s
isisfish.simulator.subprocess.readoutput.error=
isisfish.species.age=age
isisfish.species.cee=CEE
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-11 17:26:48 UTC (rev 1660)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-12 14:19:06 UTC (rev 1661)
@@ -298,7 +298,7 @@
isisfish.error.prepare.data=Can't prepare data
isisfish.error.prepare.information.simulation=Can't prepare information for simulation
isisfish.error.read.simulation=Can't read simulation information %1$s
-isisfish.error.read.simulation.parameters=Can't read simulation parameters from file %1$s
+isisfish.error.read.simulation.parameters=Impossible de lire les param\u00EAtres du fichier \: %1$s
isisfish.error.region.already.exists=Cette r\u00E9gion existe d\u00E9j\u00E0
isisfish.error.region.name.empty=Le nom de la R\u00E9gion est vide
isisfish.error.remove.directory=Can't remove directory %1$s
@@ -850,6 +850,7 @@
isisfish.simulator.launcher.inprocess=dans le m\u00EAme processus
isisfish.simulator.launcher.remote=sur un serveur distant
isisfish.simulator.launcher.subprocess=dans un sous processus
+isisfish.simulator.simulaction.init=Erreur d'initialisation de la simulation \: %s
isisfish.simulator.subprocess.readoutput.error=
isisfish.species.age=age
isisfish.species.cee=CEE
1
0
r1660 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish src/main/java/fr/ifremer/isisfish/ui/result src/main/java/fr/ifremer/isisfish/vcs src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 11 Dec '08
by chatellier@users.labs.libre-entreprise.org 11 Dec '08
11 Dec '08
Author: chatellier
Date: 2008-12-11 17:26:48 +0000 (Thu, 11 Dec 2008)
New Revision: 1660
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/AbstractVCS.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCS.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSActionEvent.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSNone.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Correct checkProtocol code (VCS)
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/pom.xml 2008-12-11 17:26:48 UTC (rev 1660)
@@ -26,7 +26,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinutil</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>1.0</version>
<scope>compile</scope>
</dependency>
@@ -40,7 +40,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>topia-service</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0</version>
<scope>compile</scope>
</dependency>
@@ -306,16 +306,16 @@
<!--labs.project>isis-fish</labs.project-->
<!-- jaxx version -->
- <jaxx.version>0.7-SNAPSHOT</jaxx.version>
+ <jaxx.version>0.7</jaxx.version>
<!-- generator version -->
- <generator.version>0.62-SNAPSHOT</generator.version>
+ <generator.version>0.62</generator.version>
<!-- topia version -->
- <topia.version>2.1.0-SNAPSHOT</topia.version>
+ <topia.version>2.1.0</topia.version>
<!-- lutinwidget version -->
- <lutinwidget.version>0.11-SNAPSHOT</lutinwidget.version>
+ <lutinwidget.version>0.11</lutinwidget.version>
<!--Main class in JAR -->
<maven.jar.main.class>fr.ifremer.isisfish.IsisFish</maven.jar.main.class>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2008-12-11 17:26:48 UTC (rev 1660)
@@ -614,7 +614,7 @@
/** prevu pour l'architecture de lancement en plugin: local, isis-server, caparmor, ... */
SIMULATOR_LAUNCHER(SimulationService.SIMULATION_LAUNCHER + ".localDefault", _("isisfish.config.main.localSimulator.description"), InProcessSimulatorLauncher.class.getName()),
SIMULATOR_LAUNCHER_SUB(SimulationService.SIMULATION_LAUNCHER + ".subDefault", _("isisfish.config.main.subSimulator.description"), SubProcessSimulationLauncher.class.getName()),
- SIMULATOR_LAUNCHER_REMOTE(SimulationService.SIMULATION_LAUNCHER + ".remoteDefault", _("isisfish.config.main.remoteSimulator.description"), SshSimulatorLauncher.class.getName()),
+ // SIMULATOR_LAUNCHER_REMOTE(SimulationService.SIMULATION_LAUNCHER + ".remoteDefault", _("isisfish.config.main.remoteSimulator.description"), SshSimulatorLauncher.class.getName()),
SIMULATOR_SERVER("simulation.server", _("isisfish.config.main.simulationServer.description"), "http://simulateur.ifremer.fr:9090"),
/** le login a utiliser pour les launcher distant, le type du launcher est ajouter a la cle (car 1 login par launcher) */
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java 2008-12-11 17:26:48 UTC (rev 1660)
@@ -56,7 +56,6 @@
import fr.ifremer.isisfish.vcs.VetoableActionListener;
import java.io.File;
import java.text.SimpleDateFormat;
-import java.util.Arrays;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.logging.LogFactory;
import static org.codelutin.i18n.I18n._;
@@ -76,12 +75,11 @@
import fr.ifremer.isisfish.ui.WelcomeUI;
/**
- * This is the main class of <code>IsisFish<code> application.
+ * This is the main class of <code>IsisFish</code> application.
*
* @author poussin
* @author chemit
*/
-
public class IsisFish { // IsisFish
/** to use log facility, just put in your code: log.info(\"...\"); */
@@ -155,9 +153,10 @@
}
/**
- * All main in other class must call this method, parse arguement,
+ * All main in other class must call this method, parse arguments,
* load configuration file, init language and load converter.
- *
+ *
+ * @param args main args
* @throws Exception if any exception while build configuration
*/
static public void init(String ... args) throws Exception {
@@ -248,9 +247,11 @@
config.saveForUser();
vcs = VCSFactory.createVCS(config);
}
+
/**
* Initialise le VCS et check s'il y a des mises a jour pour prevenir
* l'utilisateur
+ * @throws VCSException
*/
static public void initVCS() throws VCSException {
if (config.isLaunchUI()) {
@@ -353,7 +354,6 @@
}
}
-
// check file status
vcs.checkFileStatus();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java 2008-12-11 17:26:48 UTC (rev 1660)
@@ -157,7 +157,7 @@
// on affecte le nom
if (group.getDimensionName(i).equals("")){
- item.getLabel().setText(_("isisfish.result.dimension ")+i);
+ item.getLabel().setText(_("isisfish.result.dimension") + " " + i);
}else{
item.getLabel().setText(_(group.getDimensionName(i)));
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/AbstractVCS.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/AbstractVCS.java 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/AbstractVCS.java 2008-12-11 17:26:48 UTC (rev 1660)
@@ -136,6 +136,10 @@
*/
public void setPath(String path) throws VCSException {
this.path = path;
+
+ // in case of set path, don't do checkProtocol
+ // don't work with svn
+ // FIXME won't work on SVN
checkProtocol();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCS.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCS.java 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCS.java 2008-12-11 17:26:48 UTC (rev 1660)
@@ -76,7 +76,7 @@
public static final String VCS_USER_NAME = "vcs.username";
/**
- * user passwd or passphrase (protocole dependent) to access vcs ex: xxxxxxxx
+ * user passwd or passphrase (protocol dependent) to access vcs ex: xxxxxxxx
*/
public static final String VCS_USER_PASSWORD = "vcs.password";
@@ -109,7 +109,7 @@
boolean isValidLocalRepository();
/**
- * Return true, if local repository is writeable.
+ * Return true, if local repository is writable.
* (use trunk and is not anonymous)
*
* @return writable
@@ -126,11 +126,11 @@
void setWriteable(boolean value);
/**
- * Commit specified files, if files is null, all files are commited.
+ * Commit specified files, if files is null, all files are committed.
*
* @param files files to commit
* @param msg message used to commit
- * @throws org.codelutin.gesi.vcs.VCSException
+ * @throws VCSException
*/
void commit(List<File> files, String msg) throws VCSException;
@@ -139,7 +139,7 @@
*
* @param files list of file to add
* @param msg message for commit
- * @throws org.codelutin.gesi.vcs.VCSException
+ * @throws VCSException
*/
void add(List<File> files, String msg) throws VCSException;
@@ -148,10 +148,9 @@
*
* @param tag tag to used, null = /trunk other is tags/[tag]
* @param recurse if file is directory checkout sub file
- * @throws org.codelutin.gesi.vcs.VCSException
+ * @throws VCSException
*/
- void checkout(VersionNumber tag, boolean recurse)
- throws VCSException;
+ void checkout(VersionNumber tag, boolean recurse) throws VCSException;
/**
* Delete and commit files in server repository.
@@ -209,7 +208,7 @@
/**
* Get connection state.
*
- * @return true if server is connectable
+ * @return true if server is connected
*/
boolean isConnected();
@@ -232,7 +231,7 @@
boolean isTag(VersionNumber version) throws VCSException;
/**
- * Check if file is uptodate.
+ * Check if file is up-to-date.
*
* @param file file to check
* @return true if file is in last version
@@ -259,7 +258,7 @@
* @param file files to update
* @param recurse
* @return true if there are some merging conflict, false otherwise
- * @throws org.codelutin.gesi.vcs.VCSException
+ * @throws VCSException
*/
List<File> update(File file, boolean recurse) throws VCSException;
@@ -284,47 +283,53 @@
void checkFileStatus() throws VCSException;
/**
- * TODO comment me
+ * Get host.
+ *
* @return host
*/
String getHost();
/**
- * TODO comment me
+ * Get login.
+ *
* @return login
*/
String getLogin();
/**
- * TODO comment me
+ * Get password.
+ *
* @return password
*/
String getPassword();
/**
- * TODO comment me
+ * Get repository path.
+ *
* @return path
*/
String getPath();
/**
- * TODO comment me
- * @return protocole
+ * Get protocol.
+ *
+ * @return protocol
*/
String getProtocol();
/**
- * TODO comment me
+ * Get ssh key file.
+ *
* @return ssh key file
*/
File getSshKeyFile();
/**
- * retourne le tag reellement utilise, par exemple si on a fait un
+ * Retourne le tag reellement utilise, par exemple si on a fait un
* setTag(3.2.0) cette methode retourne "/tags/3.2.0", pour setTag(null)
* on retourne "/trunk"
* @return tag
- * @throws org.codelutin.gesi.vcs.VCSException
+ * @throws VCSException
*/
String getTag() throws VCSException;
@@ -333,49 +338,62 @@
* trunk.
* @param version version to go, if null trunk is used, otherwize
* tags/version is used
- * @throws org.codelutin.gesi.vcs.VCSException
+ * @throws VCSException
*/
void setTag(VersionNumber version) throws VCSException;
/**
+ * Change host.
+ *
* checkProtocol is automaticaly done
*
- * @param host
+ * @param host new host.
+ *
* @throws VCSException
*/
void setHost(String host) throws VCSException;
/**
+ * Change login.
+ *
* checkProtocol is automaticaly done
*
- * @param login
+ * @param login new login
* @throws VCSException
*/
void setLogin(String login) throws VCSException;
/**
- * TODO comment me
+ * Change password.
+ *
* @param password password
*/
void setPassword(String password);
/**
- * checkProtocol is automaticaly done
- * @param path
+ * Change path.
+ *
+ * checkPath is automaticaly done
+ *
+ * @param path new path
* @throws VCSException
*/
void setPath(String path) throws VCSException;
/**
+ * Change protocol.
+ *
* checkProtocol is automaticaly done
+ *
* @param protocol
* @throws VCSException
*/
void setProtocol(String protocol) throws VCSException;
/**
- * TODO comment me
- * @param sshKeyFile
+ * Change ssk key file to use.
+ *
+ * @param sshKeyFile new ssh kay file
*/
void setSshKeyFile(File sshKeyFile);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSActionEvent.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSActionEvent.java 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSActionEvent.java 2008-12-11 17:26:48 UTC (rev 1660)
@@ -1,26 +1,24 @@
-/* *##%
- * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- * USA.
- *##%*/
+/* *##% GeSi
+ * Copyright (C) 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
package fr.ifremer.isisfish.vcs;
/**
- * Represente une action VCS que l'on souhaite faire
+ * Représente une action VCS que l'on souhaite faire
*
* @author poussin
* @version $Revision$
@@ -36,7 +34,8 @@
UPDATE_REPOSITORY, // when checkFileStatus
SWITCH, // when setTag
SWITCH_PROTOCOL, // when checkProtocol
+ SWITCH_PATH, // when checkPath
DELETE, // when delete
ADD // when add
-
+
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSNone.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSNone.java 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSNone.java 2008-12-11 17:26:48 UTC (rev 1660)
@@ -1,21 +1,19 @@
-/* *##%
- * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- * USA.
- *##%*/
+/* *##% GeSi
+ * Copyright (C) 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
package fr.ifremer.isisfish.vcs;
@@ -25,8 +23,6 @@
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.codelutin.util.VersionNumber;
/**
@@ -40,21 +36,20 @@
* by : $Author$
*/
public class VCSNone extends AbstractVCS {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(VCSNone.class);
-
- public VCSNone(File localRepository,
- String protocol, String host, String path,
- File sshKeyFile, String login, String password) {
- super(localRepository, protocol, host, path, sshKeyFile, login, password);
+
+ /* Class logger */
+ //private static Log log = LogFactory.getLog(VCSNone.class);
+
+ public VCSNone(File localRepository, String protocol, String host,
+ String path, File sshKeyFile, String login, String password) {
+ super(localRepository, protocol, host, path, sshKeyFile, login,
+ password);
}
public boolean isValidLocalRepository() {
return true;
}
-
/**
* look on server if version is tag repository
* @param version version number like 3.2
@@ -63,7 +58,7 @@
public boolean isTag(VersionNumber version) throws VCSException {
return false;
}
-
+
/**
* Ask if there are some new or modified files on server
* @return true if new file available
@@ -71,7 +66,7 @@
public boolean haveUpdate() throws VCSException {
return false;
}
-
+
/**
* get list of new or modified files on server
* @return list of modified or new files
@@ -79,7 +74,7 @@
public List<File> getUpdatedFile() throws VCSException {
return new ArrayList<File>();
}
-
+
/**
* Return all changelog between local file version and remote repository
* file version
@@ -93,23 +88,23 @@
public void commit(List<File> files, String msg) throws VCSException {
throw new VCSException("Can't commit file with dummy VCS");
}
-
+
/**
* Add and commit file in server repository
* @param files list of file to add
* @param msg message for commit
- * @throws fr.ifremer.isisfish.vcs.VCSException
+ * @throws VCSException
*/
public void add(List<File> files, String msg) throws VCSException {
throw new VCSException("Can't add file with dummy VCS");
}
/**
- * get repository module on server and put it in destDir
- * @param destDir destination directory
- * @param module module name
- * @param b // FIXME
- * @throws fr.ifremer.isisfish.vcs.VCSException
+ * Get repository module on server and put it in destDir.
+ *
+ * @param tag destination directory
+ * @param b
+ * @throws VCSException
*/
public void checkout(VersionNumber tag, boolean b) throws VCSException {
throw new VCSException("Can't checkout with dummy VCS");
@@ -119,26 +114,28 @@
* Delete and commit files in server repository
* @param files file to delete
* @param msg message for commit
- * @throws fr.ifremer.isisfish.vcs.VCSException
+ * @throws VCSException
*/
public void delete(List<File> files, String msg) throws VCSException {
- // do nothing
+ // do nothing
}
/**
- * show diff between local file and repository file
+ * Show diff between local file and repository file.
+ *
* @param file
- * @return
- * @throws fr.ifremer.isisfish.vcs.VCSException
+ * @return diff
+ * @throws VCSException
*/
public String getDiff(File file) throws VCSException {
throw new VCSException("Can't diff with dummy VCS");
}
/**
- * Return list of all file on directory on remote server
+ * Return list of all file on directory on remote server.
+ *
* @param directory
- * @return
+ * @return files list
*/
public List<String> getFileList(File directory) throws VCSException {
List<String> result = new ArrayList<String>();
@@ -147,17 +144,17 @@
/**
* Get connection state.
- * @return true if server is connectable
+ * @return true if server is connected
*/
public boolean isConnected() {
- return false;
+ return false;
}
-
+
/**
* Check if file is available on server
* @param file file to check
* @return true if file available
- * @throws fr.ifremer.isisfish.vcs.VCSException
+ * @throws VCSException
*/
public boolean isOnRemote(File file) throws VCSException {
return false;
@@ -167,7 +164,7 @@
* Check if file is uptodate
* @param file file to check
* @return true if file is in last version
- * @throws fr.ifremer.isisfish.vcs.VCSException
+ * @throws VCSException
*/
public boolean isUpToDate(File file) throws VCSException {
return true;
@@ -175,9 +172,9 @@
/**
* Update file
- * @param files file to update
- * @return true if there are some merging conflict, false otherwize
- * @throws fr.ifremer.isisfish.vcs.VCSException
+ * @param file file to update
+ * @return true if there are some merging conflict, false otherwise
+ * @throws VCSException
*/
public List<File> update(File file, boolean recurse) throws VCSException {
throw new VCSException("Can't update file with dummy VCS");
@@ -186,6 +183,10 @@
public void checkProtocol() throws VCSException {
// nothing to do
}
+
+ public void checkPath() throws VCSException {
+ // nothing to do
+ }
public void checkFileStatus() throws VCSException {
// nothing to do
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2008-12-11 17:26:48 UTC (rev 1660)
@@ -1,4 +1,4 @@
-/* *##% GeSi
+/* *##% IsisFish
* Copyright (C) 2008 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -81,6 +81,17 @@
protected SVNClientManager svnManager = null;
protected ConnectionState connectionState = ConnectionState.NOT_TESTED;
+ /**
+ * Constructor.
+ *
+ * @param localRepository
+ * @param protocol
+ * @param host
+ * @param path
+ * @param sshKeyFile
+ * @param login
+ * @param password
+ */
public VCSSVN(File localRepository, String protocol, String host,
String path, File sshKeyFile, String login, String password) {
super(localRepository, protocol, host, path, sshKeyFile, login,
@@ -95,6 +106,12 @@
}
}
+ /**
+ * Return svnkit SVNManager.
+ *
+ * @see SVNClientManager
+ * @return SVNManager instance
+ */
protected SVNClientManager getSVNManager() {
if (svnManager == null) {
String login = getLogin();
@@ -102,11 +119,11 @@
if (getProtocol().contains("ssh")) {
ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
- // options.setPropertyValue("svnkit.ssh2.key", getSshKeyFile().getAbsolutePath());
- // options.setPropertyValue("svnkit.ssh2.username", login);
- // if (passwd != null && !"".equals(passwd)) {
- // options.setPropertyValue("svnkit.ssh2.passphrase", passwd);
- // }
+ // options.setPropertyValue("svnkit.ssh2.key", getSshKeyFile().getAbsolutePath());
+ // options.setPropertyValue("svnkit.ssh2.username", login);
+ // if (passwd != null && !"".equals(passwd)) {
+ // options.setPropertyValue("svnkit.ssh2.passphrase", passwd);
+ // }
ISVNAuthenticationManager auth = SVNWCUtil
.createDefaultAuthenticationManager(SVNWCUtil
.getDefaultConfigurationDirectory(), login,
@@ -122,8 +139,10 @@
return svnManager;
}
- /*
- * @see org.codelutin.gesi.vcs.VCS#isValidLocalRepository()
+ /**
+ * Return true, if local repository is valid repository for actual vcs.
+ *
+ * @return validity
*/
@Override
public boolean isValidLocalRepository() {
@@ -133,8 +152,10 @@
return result;
}
- /*
- * @see org.codelutin.gesi.vcs.VCS#isConnected()
+ /**
+ * Get connection state.
+ *
+ * @return true if server is connected
*/
@Override
public boolean isConnected() {
@@ -144,12 +165,16 @@
getSVNManager().getWCClient().doGetProperty(url, "",
SVNRevision.HEAD, SVNRevision.HEAD);
connectionState = ConnectionState.ON_LINE;
- log.info(_(
- "Connection to serveur available, switch on line: %s",
- getRemoteRepository()));
+
+ if (log.isInfoEnabled()) {
+ log.info(_("isisfish.vcs.vcssvn.isconnected.switchto",
+ getRemoteRepository()));
+ }
} catch (SVNException eee) {
- log.info(_("Can't connect to serveur, switch to off line: %s",
- getRemoteRepository()));
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.vcs.vcssvn.isconnected.switchoff",
+ getRemoteRepository()));
+ }
connectionState = ConnectionState.OFF_LINE;
}
}
@@ -157,71 +182,72 @@
return result;
}
- /*
- * @see org.codelutin.gesi.vcs.VCS#checkProtocol()
+ /**
+ * Verifie la connexion et si le protocole a change, switch le repository
+ * pour utiliser le nouveau protocole. Si on est en mode interface (mode
+ * graphique) et que le switch se passe mal, demande a l'utilisateur
+ * de nouvelle valeur pour le protocole (+ identifiant, ...)
+ * @throws VCSException
*/
@Override
public void checkProtocol() throws VCSException {
+
+ // on doit verifier ici que seul le protocole a change
+ // le doRelocate de svn, ne permet de ne change que
+ // le protocol ou host par exemple
+ // dans le cas d'un changement de path, le do relocate
+ // echoue (operation non permise)
+
try {
+ // test que les protocoles, userInfo, host, port sont egaux.
+
+ // copies locales
File localRoot = getLocalRepository();
SVNInfo info = getSVNManager().getWCClient().doInfo(localRoot,
SVNRevision.WORKING);
SVNURL url = info.getURL();
- // FIXME path seems to appear twice
- //SVNURL rootUrl = info.getRepositoryRootURL();
- //String path = url.toDecodedString().substring(
- // rootUrl.toDecodedString().length());
- String path = url.getPath().substring(
- getPath().length());
-
- // // si un des constituants de l'url a change on fait un switch relocate
- // boolean mustSwitch = false;
- // if (!url.getProtocol().equals(getProtocol())) {
- // log.info(_("repository protocol change from %s to %s",
- // url.getProtocol(), getProtocol()));
- // mustSwitch = true;
- // }
- // if (!url.getUserInfo() != null !url.getUserInfo().equals(getLogin())) {
- // log.info(_("repository user change from %s to %s",
- // url.getUserInfo(), getLogin()));
- // mustSwitch = true;
- // }
- // if (!url.getHost().equals(getHost())) {
- // log.info(_("repository host change from %s to %s",
- // url.getHost(), getHost()));
- // mustSwitch = true;
- // }
- //
- // if (mustSwitch) {
+ // url distante (suposée)
SVNURL newUrl = getRemoteURL();
- newUrl = newUrl.appendPath(path, false);
- if (!url.equals(newUrl)) {
+
+ // hack just for doRelocate to work
+ newUrl = newUrl.setPath(url.getPath(), false);
+
+ if (!url.getProtocol().equals(newUrl.getProtocol()) // http, svn ...
+ || (url.getUserInfo() == null && newUrl.getUserInfo() != url
+ .getUserInfo()) // username
+ || (url.getUserInfo() != null && !url.getUserInfo().equals(
+ newUrl.getUserInfo())) // username
+ || url.getPort() != newUrl.getPort() // 80
+ || !url.getHost().equals(newUrl.getHost())) {
if (fireAction(VCSActionEvent.SWITCH_PROTOCOL)) {
- // String path = url.getPath();
- // int port = url.getPort();
- // SVNURL newUrl = SVNURL.create(getProtocol(), getLogin(),
- // getHost(), port, path, true);
- log.info(_("Switch repository %s from %s to %s", localRoot,
- url, newUrl));
+ if (log.isInfoEnabled()) {
+ log.info(_("isisfish.vcs.vcssvn.checkProtocol.relocate",
+ localRoot, url, newUrl));
+ }
+
+ // le relocate de SVNKit
+ // ne supporte que le changement de protocole/host/port
+ // pas le path
getSVNManager().getUpdateClient().doRelocate(localRoot,
url, newUrl, true);
}
}
- } catch (SVNException eee) {
- throw new VCSException(
- _("Can't get address on serveur of local repository"), eee);
+ } catch (SVNException e) {
+ throw new VCSException(_("isisfish.vcs.vcssvn.checkProtocol.error"), e);
}
-
}
/**
- * Verifie si tous les fichiers du repository local sont les dernieres
+ * Vérifie si tous les fichiers du repository local sont les dernieres
* version par rapport au serveur. Si ce n'est pas le cas et que l'on est
* en mode interactif (mode graphique), on lui propose de mettre a jour
* les fichiers, avec la possibilite de voir les changements sur les
* fichiers
+ *
+ * @throws VCSException
*/
+ @Override
public void checkFileStatus() throws VCSException {
Map<File, SVNStatus> status = getRemoteStatus(null, true);
// si des fichiers ont ete mis a jour sur le serveur on se synchronise
@@ -313,15 +339,14 @@
}
/*
- * @see org.codelutin.gesi.vcs.VCS#commit(java.util.List, java.lang.String)
+ * @see org.codelutin.isisfish.vcs.VCS#commit(java.util.List, java.lang.String)
*/
@Override
public void commit(List<File> files, String msg) throws VCSException {
// if can't commit
if (!isWriteable()) {
- throw new VCSException(
- "You can't commit file, this repository is readonly");
+ throw new VCSException(_("isisfish.vcs.vcssvn.commit.errorreadonly"));
}
// list to array
@@ -364,18 +389,18 @@
false, // force
SVNDepth.INFINITY); // depth
- if (log.isDebugEnabled()) {
- log.debug(_("to revision %d", commitInfo.getNewRevision()));
+ if (log.isInfoEnabled()) {
+ log.info(_("isisfish.vcs.vcssvn.global.torevision", commitInfo
+ .getNewRevision()));
}
- } catch (SVNException eee) {
- throw new VCSException("Can't commit files", eee);
+ } catch (SVNException e) {
+ throw new VCSException(_("isisfish.vcs.vcssvn.commit.error"), e);
}
}
public void add(List<File> files, String msg) throws VCSException {
if (!isWriteable()) {
- throw new VCSException(
- "You can't add file, this repository is readonly");
+ throw new VCSException(_("isisfish.vcs.vcssvn.add.errorreadonly"));
}
try {
if (fireAction(VCSActionEvent.ADD, files.toArray(new File[files
@@ -402,12 +427,12 @@
commitWithoutCheck(files, msg);
}
} catch (SVNException eee) {
- throw new VCSException("Can't add file", eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.add.error"), eee);
}
}
/*
- * @see org.codelutin.gesi.vcs.VCS#checkout(org.codelutin.util.VersionNumber, boolean)
+ * @see org.codelutin.isisfish.vcs.VCS#checkout(org.codelutin.util.VersionNumber, boolean)
*/
@Override
public void checkout(VersionNumber tag, boolean recurse)
@@ -437,19 +462,20 @@
SVNDepth.INFINITY, // SVNDepth depth
true); // boolean allowUnversionedObstructions
- if (log.isDebugEnabled()) {
- log.debug(_("to revision %d", newRevision));
+ if (log.isInfoEnabled()) {
+ log
+ .info(_("isisfish.vcs.vcssvn.global.torevision",
+ newRevision));
}
}
} catch (SVNException eee) {
- throw new VCSException(_("Can't checkout"), eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.checkout.error"), eee);
}
}
public void delete(List<File> files, String msg) throws VCSException {
if (!isWriteable()) {
- throw new VCSException(
- "You can't delete file, this repository is readonly");
+ throw new VCSException(_("isisfish.vcs.vcssvn.delete.errorreadonly"));
}
try {
if (fireAction(VCSActionEvent.DELETE, files.toArray(new File[files
@@ -462,7 +488,7 @@
commitWithoutCheck(files, msg);
}
} catch (SVNException eee) {
- throw new VCSException("Can't add file", eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.delete.error"), eee);
}
}
@@ -532,7 +558,7 @@
return result;
} catch (SVNException eee) {
- throw new VCSException("Can't status file", eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.localstatus.error"), eee);
}
}
@@ -598,7 +624,7 @@
return result;
} catch (SVNException eee) {
- throw new VCSException("Can't status file", eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.remotestatus.error"), eee);
}
}
@@ -613,7 +639,7 @@
public Map<File, String> getChanglog(List<File> files) throws VCSException {
throw new UnsupportedOperationException("Not supported yet.");
-
+
/*final Map<File, String> changLog = new HashMap<File, String>();
try {
@@ -623,7 +649,7 @@
// Handler
ISVNLogEntryHandler handler = new ISVNLogEntryHandler() {
-
+
@Override
public void handleLogEntry(SVNLogEntry logEntry)
throws SVNException {
@@ -700,16 +726,16 @@
byte1.close();
} catch (SVNException e) {
- throw new VCSException(_("Can't get diff"), e);
+ throw new VCSException(_("isisfish.vcs.vcssvn.diff.error"), e);
} catch (IOException e) {
- throw new VCSException(_("Can't get diff"), e);
+ throw new VCSException(_("isisfish.vcs.vcssvn.diff.error"), e);
}
return diff;
}
/*
- * @see org.codelutin.gesi.vcs.VCS#getFileList(java.io.File)
+ * @see org.codelutin.isisfish.vcs.VCS#getFileList(java.io.File)
*/
@Override
public List<String> getFileList(File directory) throws VCSException {
@@ -746,7 +772,7 @@
SVNDirEntry.DIRENT_ALL, // int entryFields,
handler);
} catch (SVNException e) {
- throw new VCSException(_("Can't list files"), e);
+ throw new VCSException(_("isisfish.vcs.vcssvn.list.error"), e);
}
return files;
@@ -769,8 +795,8 @@
// log
if (log.isDebugEnabled()) {
- log.debug(_("status for %s is %s", status.getFile()
- .getAbsolutePath(), status
+ log.debug(_("isisfish.vcs.vcssvn.global.filestatus", status
+ .getFile().getAbsolutePath(), status
.getRemoteContentsStatus().toString()));
}
@@ -779,8 +805,9 @@
// log
if (log.isDebugEnabled()) {
- log.debug(_("add %s as updated file", status
- .getFile().getAbsolutePath()));
+ log.debug(_(
+ "isisfish.vcs.vcssvn.global.foundUpdatedFile",
+ status.getFile().getAbsolutePath()));
}
result.add(status.getFile());
@@ -801,7 +828,7 @@
return result;
} catch (SVNException eee) {
- throw new VCSException("Can't status file", eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.getupdate.error"), eee);
}
}
@@ -812,13 +839,13 @@
* @throws VCSException
*/
public boolean haveUpdate() throws VCSException {
-
+
// c'est juste si la liste renvoyé par getUpdatedFile() n'est pas vide ?
List<File> updatedFiles = getUpdatedFile();
-
+
boolean result = false;
-
- if(updatedFiles != null && !updatedFiles.isEmpty()) {
+
+ if (updatedFiles != null && !updatedFiles.isEmpty()) {
result = true;
}
return result;
@@ -832,29 +859,35 @@
* @throws VCSException
*/
public boolean isOnRemote(File file) throws VCSException {
-
+
File localFile = file;
if (localFile == null) {
localFile = getLocalRepository();
}
-
+
boolean result = false;
try {
SVNStatusClient statusClient = getSVNManager().getStatusClient();
- SVNStatus status = statusClient.doStatus(localFile, true /*remote*/);
-
+ SVNStatus status = statusClient
+ .doStatus(localFile, true /*remote*/);
+
SVNStatusType localStatus = status.getContentsStatus();
SVNStatusType remoteStatus = status.getRemoteContentsStatus();
-
- if(log.isDebugEnabled()) {
- log.debug(_("file %s status is (l:%s/r:%s)",localFile.getAbsolutePath(),localStatus, remoteStatus));
+
+ if (log.isDebugEnabled()) {
+ log
+ .debug(_(
+ "isisfish.vcs.vcssvn.global.filelocalandremotestatus",
+ localFile.getAbsolutePath(), localStatus,
+ remoteStatus));
}
-
+
// don't return true if:
// - file is locally added
// - file is remotely deleted
- if(!localStatus.equals(SVNStatusType.STATUS_ADDED) && !remoteStatus.equals(SVNStatusType.STATUS_DELETED)) {
+ if (!localStatus.equals(SVNStatusType.STATUS_ADDED)
+ && !remoteStatus.equals(SVNStatusType.STATUS_DELETED)) {
result = true;
}
@@ -862,11 +895,12 @@
// catch exception
// if exception, file doesn't exists on server
// result is still 'false'
- if(log.isDebugEnabled()) {
- log.debug(_("file %s is not on server",localFile.getAbsolutePath()),e);
+ if (log.isDebugEnabled()) {
+ log.debug(_("isisfish.vcs.vcssvn.isonremote.error", localFile
+ .getAbsolutePath()), e);
}
}
-
+
return result;
}
@@ -879,36 +913,38 @@
*/
@Override
public boolean isUpToDate(File file) throws VCSException {
-
+
File localFile = file;
if (localFile == null) {
localFile = getLocalRepository();
}
-
+
boolean result = false;
-
+
try {
SVNStatusClient statusClient = getSVNManager().getStatusClient();
- SVNStatus status = statusClient.doStatus(localFile, true /*remote*/);
+ SVNStatus status = statusClient
+ .doStatus(localFile, true /*remote*/);
SVNStatusType localStatus = status.getContentsStatus();
SVNStatusType remoteStatus = status.getRemoteContentsStatus();
-
+
// TODO peut on dire que le fichier est à jour
// si le status local est normal et le distant est none
- if (localStatus == SVNStatusType.STATUS_NORMAL && remoteStatus == SVNStatusType.STATUS_NONE) {
+ if (localStatus == SVNStatusType.STATUS_NORMAL
+ && remoteStatus == SVNStatusType.STATUS_NONE) {
result = true;
}
} catch (SVNException eee) {
- throw new VCSException(_("Can't get file status"), eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.isuptodate.error"), eee);
}
-
+
return result;
}
/*
- * @see org.codelutin.gesi.vcs.VCS#update(java.io.File, boolean)
+ * @see org.codelutin.isisfish.vcs.VCS#update(java.io.File, boolean)
*/
@Override
public List<File> update(File file, boolean recurse) throws VCSException {
@@ -920,8 +956,7 @@
localFile = getLocalRepository();
}
if (!accept(localFile)) {
- throw new VCSException(
- _("Can't update file that not in local repository"));
+ throw new VCSException(_("isisfish.vcs.vcssvn.update.notinlocal"));
}
if (fireAction(VCSActionEvent.UPDATE, localFile)) {
// si le repertoire pere, n'est pas encore dans le repo local
@@ -941,7 +976,8 @@
false); // boolean depthIsSticky
if (log.isInfoEnabled()) {
- log.info(_("to revision %d", newRevision));
+ log.info(_("isisfish.vcs.vcssvn.global.torevision",
+ newRevision));
}
// recherche de tous les fichiers locaux en conflit
@@ -961,14 +997,14 @@
}
}
- } catch (SVNException eee) {
- throw new VCSException("Can't update files", eee);
+ } catch (SVNException e) {
+ throw new VCSException(_("isisfish.vcs.vcssvn.update.error"), e);
}
return result;
}
/*
- * @see org.codelutin.gesi.vcs.VCS#isWriteable()
+ * @see org.codelutin.isisfish.vcs.VCS#isWriteable()
*/
@Override
public boolean isWriteable() throws VCSException {
@@ -993,7 +1029,7 @@
}
/*
- * @see org.codelutin.gesi.vcs.VCS#isTag(org.codelutin.util.VersionNumber)
+ * @see org.codelutin.isisfish.vcs.VCS#isTag(org.codelutin.util.VersionNumber)
*/
@Override
public boolean isTag(VersionNumber version) throws VCSException {
@@ -1008,14 +1044,14 @@
// est leve, et donc result reste a faux
result = info != null;
} catch (SVNException eee) {
- log.debug(_("Tag %s don't exist", version));
+ log.debug(_("isisfish.vcs.vcssvn.istag.notexist", version));
}
}
return result;
}
/*
- * @see org.codelutin.gesi.vcs.VCS#getTag()
+ * @see org.codelutin.isisfish.vcs.VCS#getTag()
*/
@Override
public String getTag() throws VCSException {
@@ -1034,13 +1070,12 @@
}
return result;
} catch (SVNException eee) {
- throw new VCSException(
- _("Can't get address on serveur of local repository"), eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.gettag.error"), eee);
}
}
/*
- * @see org.codelutin.gesi.vcs.VCS#setTag(org.codelutin.util.VersionNumber)
+ * @see org.codelutin.isisfish.vcs.VCS#setTag(org.codelutin.util.VersionNumber)
*/
@Override
public void setTag(VersionNumber version) throws VCSException {
@@ -1050,8 +1085,8 @@
tag = "/tags/" + version;
}
- String currantTag = getTag();
- if (!tag.equals(currantTag)) {
+ String currentTag = getTag();
+ if (!tag.equals(currentTag)) {
// on ne fait le switch que si le tag change rellement, sinon
// c equivalent a faire un update, ce que l'on ne souhaite pas
// forcement
@@ -1062,8 +1097,8 @@
newUrl = newUrl.appendPath(tag, true);
if (log.isInfoEnabled()) {
- log.info(_("Switch repository tag from %s to %s",
- currantTag, tag));
+ log.info(_("isisfish.vcs.vcssvn.settag.switchfromto",
+ currentTag, tag));
}
//getSVNManager().getUpdateClient().doSwitch(
// localRoot, newUrl, SVNRevision.HEAD, true);
@@ -1080,13 +1115,13 @@
true);// boolean depthIsSticky
if (log.isInfoEnabled()) {
- log.info(_("to revision %d", newRevision));
+ log.info(_("isisfish.vcs.vcssvn.global.torevision",
+ newRevision));
}
}
}
} catch (SVNException eee) {
- throw new VCSException(
- _("Can't get address on serveur of local repository"), eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.setTag.error"), eee);
}
}
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-11 17:26:48 UTC (rev 1660)
@@ -4,30 +4,22 @@
Can''t\ evaluate\ simulation\ prescript=
Can't\ add\ result\ '%1$s'\ at\ date\ %2$s=Can't add result '%1$s' at date %2$s
Can't\ add\ simulation\:\ =
-Can't\ checkout=
-Can't\ connect\ to\ serveur,\ switch\ to\ off\ line\:\ %s=
Can't\ create\ simulation\ logger=Can't create simulation logger
Can't\ delete\ simulation\ %s\ =
Can't\ do\ post\ action\ %s=
Can't\ do\ simulation\ %s=
Can't\ export\ simulation\ %s=
-Can't\ get\ address\ on\ serveur\ of\ local\ repository=
Can't\ get\ changlog=
-Can't\ get\ diff=
-Can't\ get\ file\ status=
Can't\ get\ result\:\ %1$s=Can't get result\: %1$s
Can't\ instanciate\ export\ %1$s=Can't instanciate export %1$s
Can't\ instanciate\ wanted\ VCS\ (%s),\ use\ default=
Can't\ instantiate\ %s=
-Can't\ list\ files=
Can't\ open\ log\ for\ %s=
Can't\ simulate\ %s=
Can't\ start\ simulation,\ bad\ id\:\ %s=
-Can't\ update\ file\ that\ not\ in\ local\ repository=
Check\ state\ of\ local\ repository\:\ %s=
Checkout\ pom.xml\ to\ %s=
Clear\ done\ jobs=
-Connection\ to\ serveur\ available,\ switch\ on\ line\:\ %s=
Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s=
Error\ during\ vcs\ initialisation=
Generate\ next\ simulation=
@@ -54,15 +46,11 @@
Stop\ simulation\ plan,\ because\ can't\ call\ afterSimulation\ correctly\ on\ plan\ %s=
Stop\ the\ process=
SubProcess\ start\:\ %s\ %s=
-Switch\ repository\ %s\ from\ %s\ to\ %s=
-Switch\ repository\ tag\ from\ %s\ to\ %s=
Switch\ repository\ type\ to\ none=
-Tag\ %s\ don't\ exist=
The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.=
Use\ branches,\ switch\ not\ needed=
User\ stop\ simulation\ %s=
Your\ database\ repository\:\ %s\\n\ don't\ use\ correct=
-add\ %s\ as\ updated\ file=
could\ not\ close\ reader\ %1$s=could not close reader %1$s
could\ not\ create\ simulation\ filter\ model\ for\ reason\ %1$s=could not create simulation filter model for reason %1$s
could\ not\ filter\ on\ simulations=could not filter on simulations
@@ -74,8 +62,6 @@
destination\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
destination\ already\ exists\ %s\ use\ \\'force\\'\ argument\ to\ force\ overwrite=
directory\ %s\ must\ be\ a\ directory=
-file\ %s\ is\ not\ on\ server=
-file\ %s\ status\ is\ (l\:%s/r\:%s)=
filter\ loaded\ in\ %1$s\ ms\ \:\ found\ %2$s\ lines.=filter loaded in %1$s ms \: found %2$s lines.
isisfish.about.site=http\://isisfish.labs.libre-entreprise.org - by B.Poussin
isisfish.about.text=Isis-Fish Simulator
@@ -259,7 +245,6 @@
isisfish.error.init.remove.button=could not init remove button (button or list is null) button \: %1$s, list \: %2$s
isisfish.error.instanciate=Can't instanciate %1$s
isisfish.error.instanciate.export=Can't instanciate export %1$s
-isisfish.error.integer.positif=Your input must be a positif integer (>1)
isisfish.error.invalid.costs.fix=les co\u00FBts fixes sont invalides
isisfish.error.invalid.distribution.recruitment=distribution de recrutement invalide
isisfish.error.invalid.equation=Equation invalid
@@ -281,13 +266,12 @@
isisfish.error.log.console.dispose=Une erreur est survenue pendant la fermeture de la console %1$s de log, raison %2$s
isisfish.error.log.createAppender=could not create appender [%1$s] \: %2$s for reason %3$s
isisfish.error.log.foundAppender=\=could not found log appender %1$s for category %2$s
-isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\\nSelectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
+isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\nS\u00E9lectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
isisfish.error.migration.negative=Migration negative
isisfish.error.no.matrix=No matrix for\:
isisfish.error.no.null.time.step=Error, the time step should not be null
isisfish.error.no.sector=No sector defined
isisfish.error.no.select.simulation=could not select simulation
-isisfish.error.no.selected.simulation=No Simulation selected
isisfish.error.no.target.species=no target species in %1$s for %2$s
isisfish.error.not.found.class=this class does not
isisfish.error.not.found.code=could not found codeclass for %1$s
@@ -325,7 +309,6 @@
isisfish.error.save.simulation.parameters=Can't save simulation parameters in file %1$s
isisfish.error.script.create=isisfish.error.script.create
isisfish.error.script.delete=Can't delete file %1$s for reason %2$s
-isisfish.error.script.diff=Can't diff file %1$s for reason %2$s
isisfish.error.script.import=Can't import file for reason %1$s
isisfish.error.script.load=Can't load file %1$s for reason %2$s
isisfish.error.script.save=Can't save file %1$s for reason %2$s
@@ -533,7 +516,6 @@
isisfish.message.confirm.remove.script=Do you want to remove script ? '%1$s'
isisfish.message.copy.finished=Copy finished
isisfish.message.copy.region=Copy region to %1$s
-isisfish.message.create.region.canceled=Create region canceled
isisfish.message.creating.region=Creating region %1$s
isisfish.message.creation.done=creation done %1$s
isisfish.message.creation.finished=Creation finished
@@ -541,8 +523,7 @@
isisfish.message.delete.entities=Delete entities
isisfish.message.delete.entity=Delete entity
isisfish.message.delete.finished=delete finished
-isisfish.message.delete.object=To delete object %1$s, all next object will be deleted\\n\\n
-isisfish.message.diff.finished=file in state %1$s
+isisfish.message.delete.object=To delete object %1$s, all next object will be deleted\n\n
isisfish.message.evaluation.finished=evaluation finished
isisfish.message.export.done=export done
isisfish.message.export.zip=Export to zip file %1$s
@@ -555,17 +536,14 @@
isisfish.message.import.region.zipped=Zipped Region
isisfish.message.import.scripts.file.cancelled=Import scripts cancelled
isisfish.message.import.xml.v2.file=Import xml v2 file
-isisfish.message.import.xml.v2.file\ =
isisfish.message.import.zip=Import zip file
isisfish.message.load.finished=load finished
isisfish.message.load.map=Try to load map file\: %1$s (%2$s, %3$s)
-isisfish.message.load.region.canceled=load region canceled
isisfish.message.loading.old.simulation=Loading old simulation ...
isisfish.message.loading.region=Loading region ...
isisfish.message.name.imported.region=Enter name for imported region
isisfish.message.new.filename=Enter the name of the new file. (use only chars and _ and start with uppercase)
isisfish.message.new.region.name=Enter new region name
-isisfish.message.no.diff=No diff found for file %1$s, since it is a %2$s
isisfish.message.old.simulation.loaded=Old simulation loaded
isisfish.message.page.modified=This page has been modified, do you want to save it ?
isisfish.message.presimulation.script.execution=Presimulation Script execution
@@ -616,7 +594,6 @@
isisfish.month.november=november
isisfish.month.october=october
isisfish.month.september=september
-isisfish.notitle=/
isisfish.params.changeLogLev=Change from level '%1$s' to level '%2$s'
isisfish.params.clearFilter=Clear filter
isisfish.params.description=Description
@@ -629,11 +606,11 @@
isisfish.params.ruleParameters=Rule's parameters
isisfish.params.simulationName=Simulation name
isisfish.params.title=Parameters
-isisfish.params.toString.fishery=P\u00EAcherie\: %1$s\\n\\n
+isisfish.params.toString.fishery=P\u00EAcherie\: %1$s\n\n
isisfish.params.toString.lib.logger.level=Level of libraries' logger %1$s
-isisfish.params.toString.number.years=Number of years\: %1$s\\n\\n
+isisfish.params.toString.number.years=Number of years\: %1$s\n\n
isisfish.params.toString.plan=Plan\: %1$s
-isisfish.params.toString.plan.number=Analyse plan sequence number\: %1$s\\n\\n
+isisfish.params.toString.plan.number=Analyse plan sequence number\: %1$s\n\n
isisfish.params.toString.populations=Populations\:
isisfish.params.toString.rule=Rule\: %1$s
isisfish.params.toString.script.logger.level=Level of scripts' logger %1$s
@@ -736,7 +713,7 @@
isisfish.result.datas=Datas
isisfish.result.datasRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.donneeRadioButton
isisfish.result.desktopPane=defaultToolTip-fr.ifremer.resultat.ResultatView.desktopPane
-isisfish.result.dimension\ =Dimension
+isisfish.result.dimension=Dimension
isisfish.result.end.simulation=En fin de Simulation\:
isisfish.result.export=Export
isisfish.result.export.file=Export text file
@@ -937,6 +914,34 @@
isisfish.vcs.updateconfirm.ok=ok
isisfish.vcs.updateconfirm.tooltip.checkAll=
isisfish.vcs.updaterepository.confirm=Your repository is not up to date.\nDo you want to update your repository ?\n\nRemote modified file is \:\n%s
+isisfish.vcs.vcssvn.add.error=Can't add file
+isisfish.vcs.vcssvn.add.errorreadonly=You can't add file, this repository is readonly
+isisfish.vcs.vcssvn.checkProtocol.error=Can't get address on serveur of local repository
+isisfish.vcs.vcssvn.checkProtocol.relocate=Relocate repository %s from %s to %s
+isisfish.vcs.vcssvn.checkout.error=Can't checkout
+isisfish.vcs.vcssvn.commit.error=Can't commit files
+isisfish.vcs.vcssvn.commit.errorreadonly=You can't commit file, this repository is readonly
+isisfish.vcs.vcssvn.delete.error=Can't delete file
+isisfish.vcs.vcssvn.delete.errorreadonly=You can't delete file, this repository is readonly
+isisfish.vcs.vcssvn.diff.error=Can't get diff
+isisfish.vcs.vcssvn.gettag.error=Can't get address on serveur of local repository
+isisfish.vcs.vcssvn.getupdate.error=Can't status file
+isisfish.vcs.vcssvn.global.filelocalandremotestatus=file %s status is (l\:%s/r\:%s)
+isisfish.vcs.vcssvn.global.filestatus=status for %s is %s
+isisfish.vcs.vcssvn.global.foundUpdatedFile=add %s as updated file
+isisfish.vcs.vcssvn.global.torevision=At revision \: %d
+isisfish.vcs.vcssvn.isconnected.switchoff=Can't connect to serveur, switch to off line\: %s
+isisfish.vcs.vcssvn.isconnected.switchto=Connection to serveur available, switch on line\: %s
+isisfish.vcs.vcssvn.isonremote.error=file %s is not on server
+isisfish.vcs.vcssvn.istag.notexist=Tag %s don't exist
+isisfish.vcs.vcssvn.isuptodate.error=Can't get file status
+isisfish.vcs.vcssvn.list.error=Can't list files
+isisfish.vcs.vcssvn.localstatus.error=Can't status file
+isisfish.vcs.vcssvn.remotestatus.error=Can't status file
+isisfish.vcs.vcssvn.setTag.error=Can't get address on server of local repository
+isisfish.vcs.vcssvn.settag.switchfromto=Switch repository tag from %s to %s
+isisfish.vcs.vcssvn.update.error=Can't update files
+isisfish.vcs.vcssvn.update.notinlocal=Can't update file that not in local repository
isisfish.versionStorage.removed=Removed
isisfish.vesselType.activityRange=Activity range
isisfish.vesselType.comments=Comments
@@ -987,12 +992,5 @@
isisfish.zone.comments=Comments
isisfish.zone.name=Name
not\ started=
-observe.message.quit.edit=
-observe.message.title=
region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
-repository\ host\ change\ from\ %s\ to\ %s=
-repository\ protocol\ change\ from\ %s\ to\ %s=
-repository\ user\ change\ from\ %s\ to\ %s=
simulate\ %s\ with\ file\ %s=
-status\ for\ %s\ is\ %s=
-to\ revision\ %d=
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-11 15:35:31 UTC (rev 1659)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-11 17:26:48 UTC (rev 1660)
@@ -4,30 +4,22 @@
Can''t\ evaluate\ simulation\ prescript=
Can't\ add\ result\ '%1$s'\ at\ date\ %2$s=Can't add result '%1$s' at date %2$s
Can't\ add\ simulation\:\ =
-Can't\ checkout=
-Can't\ connect\ to\ serveur,\ switch\ to\ off\ line\:\ %s=
Can't\ create\ simulation\ logger=Can't create simulation logger
Can't\ delete\ simulation\ %s\ =
Can't\ do\ post\ action\ %s=
Can't\ do\ simulation\ %s=
Can't\ export\ simulation\ %s=
-Can't\ get\ address\ on\ serveur\ of\ local\ repository=
Can't\ get\ changlog=Impossible d'obtenir de changelog
-Can't\ get\ diff=Impossible d'obtenir de diff de fichiers
-Can't\ get\ file\ status=Impossible d'obtenir le statut
Can't\ get\ result\:\ %1$s=Can't get result\: %1$s
Can't\ instanciate\ export\ %1$s=Can't instanciate export %1$s
Can't\ instanciate\ wanted\ VCS\ (%s),\ use\ default=
Can't\ instantiate\ %s=
-Can't\ list\ files=Impossible de lister les fichiers
Can't\ open\ log\ for\ %s=
Can't\ simulate\ %s=
Can't\ start\ simulation,\ bad\ id\:\ %s=
-Can't\ update\ file\ that\ not\ in\ local\ repository=Impossible de mettre \u00E0 jour un fichier hors du d\u00E9p\u00F4t
Check\ state\ of\ local\ repository\:\ %s=
Checkout\ pom.xml\ to\ %s=
Clear\ done\ jobs=
-Connection\ to\ serveur\ available,\ switch\ on\ line\:\ %s=
Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s=
Error\ during\ vcs\ initialisation=
Generate\ next\ simulation=
@@ -54,15 +46,11 @@
Stop\ simulation\ plan,\ because\ can't\ call\ afterSimulation\ correctly\ on\ plan\ %s=
Stop\ the\ process=
SubProcess\ start\:\ %s\ %s=
-Switch\ repository\ %s\ from\ %s\ to\ %s=
-Switch\ repository\ tag\ from\ %s\ to\ %s=
Switch\ repository\ type\ to\ none=
-Tag\ %s\ don't\ exist=
The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.=
Use\ branches,\ switch\ not\ needed=
User\ stop\ simulation\ %s=
Your\ database\ repository\:\ %s\\n\ don't\ use\ correct=
-add\ %s\ as\ updated\ file=Ajout du fichier %s
could\ not\ close\ reader\ %1$s=could not close reader %1$s
could\ not\ create\ simulation\ filter\ model\ for\ reason\ %1$s=could not create simulation filter model for reason %1$s
could\ not\ filter\ on\ simulations=could not filter on simulations
@@ -74,8 +62,6 @@
destination\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
destination\ already\ exists\ %s\ use\ \\'force\\'\ argument\ to\ force\ overwrite=
directory\ %s\ must\ be\ a\ directory=
-file\ %s\ is\ not\ on\ server=Le fichier %s n'est pas pr\u00E9sent sur le serveur
-file\ %s\ status\ is\ (l\:%s/r\:%s)=Le fichier %s a pour statut (l\:%s/d\:%s)
filter\ loaded\ in\ %1$s\ ms\ \:\ found\ %2$s\ lines.=filter loaded in %1$s ms \: found %2$s lines.
isisfish.about.site=http\://isisfish.labs.libre-entreprise.org - par B.Poussin
isisfish.about.text=Simulateur Isis-Fish
@@ -259,7 +245,6 @@
isisfish.error.init.remove.button=could not init remove button (button or list is null) button \: %1$s, list \: %2$s
isisfish.error.instanciate=Can't instanciate %1$s
isisfish.error.instanciate.export=Can't instanciate export %1$s
-isisfish.error.integer.positif=Your input must be a positif integer (>1)
isisfish.error.invalid.costs.fix=les co\u00FBts fixes sont invalides
isisfish.error.invalid.distribution.recruitment=distribution de recrutement invalide
isisfish.error.invalid.equation=Equation invalide
@@ -281,13 +266,12 @@
isisfish.error.log.console.dispose=Une erreur est survenue pendant la fermeture de la console %1$s de log, raison %2$s
isisfish.error.log.createAppender=n'a pas pu creer l'appender [%1$s] \: %2$s pour la raison %3$s
isisfish.error.log.foundAppender=n'a pas trouve l'appender %1$s pour la categorie %2$s
-isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\\nSelectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
+isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\nS\u00E9lectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
isisfish.error.migration.negative=Migration negative
isisfish.error.no.matrix=No matrix for\:
isisfish.error.no.null.time.step=Error, the time step should not be null
isisfish.error.no.sector=il n'y a pas de secteur de d\u00E9finit
isisfish.error.no.select.simulation=could not select simulation
-isisfish.error.no.selected.simulation=No Simulation selected
isisfish.error.no.target.species=no target species in %1$s for %2$s
isisfish.error.not.found.class=this class does not
isisfish.error.not.found.code=could not found codeclass for %1$s
@@ -325,7 +309,6 @@
isisfish.error.save.simulation.parameters=Can't save simulation parameters in file %1$s
isisfish.error.script.create=isisfish.error.script.create
isisfish.error.script.delete=N'a pas pu supprimer le fichier %1$s pour la raison suivante %2$s
-isisfish.error.script.diff=N'a pas pu calculer le diff du fichier %1$s pour la raison suivante %2$s
isisfish.error.script.import=N'a pas pu importer pour la raison suivante %1$s
isisfish.error.script.load=N'a pas pu charger le fichier %1$s pour la raison suivante %2$s
isisfish.error.script.save=N'a pas pu sauver le fichier %1$s pour la raison suivante %2$s
@@ -494,14 +477,14 @@
isisfish.launch.server.ssh.privateKeyFile=clef priv\u00E9e ssh
isisfish.launch.server.ssh.publicKeyFile=clef publique ssh
isisfish.launch.ssh=lecture-\u00E9criture (ssh)
-isisfish.launch.start=Lancement Isis-fish ... %1$s
+isisfish.launch.start=Lancement Isis-fish... %1$s
isisfish.launch.stop=Stopping simulation...
isisfish.launching=after init done in %1$s.
isisfish.log.addAppender=ajoute un appender [%1$s]
isisfish.log.body=Message \u00E0 joindre
isisfish.log.closeAppender=ferme l'appender [%1$s] pour la categorie %2$s
isisfish.log.mail.failed=Impossible d'envoyer le rapport par courriel. Le serveur smtp fonctionne ? (J'essaye de contacter < %1$s > smtp server)
-isisfish.log.mail.send=A report has been sent to %1$s
+isisfish.log.mail.send=Un rapport a \u00E9t\u00E9 envoy\u00E9 \u00E0 %1$s
isisfish.log.mail.send.title=Send simulation %1$s by email
isisfish.log.mailTo=Adresse du destinataire
isisfish.log.removeAppender=supprime l'appender [%1$s]
@@ -533,7 +516,6 @@
isisfish.message.confirm.remove.script=Voulez-vous vraiment supprimer le script ? '%1$s'
isisfish.message.copy.finished=Copie termin\u00E9e
isisfish.message.copy.region=Copier la r\u00E9gion vers %1$s
-isisfish.message.create.region.canceled=Creation de r\u00E9gion annul\u00E9e
isisfish.message.creating.region=En train de cr\u00E9er la r\u00E9gion %1$s
isisfish.message.creation.done=cr\u00E9ation termin\u00E9e %1$s
isisfish.message.creation.finished=Cr\u00E9ation termin\u00E9e
@@ -542,7 +524,6 @@
isisfish.message.delete.entity=Supprimer l'entit\u00E9
isisfish.message.delete.finished=Suppression termin\u00E9e
isisfish.message.delete.object=Pour supprimer l'objet %1$s, tous les objets suivants seront aussi supprim\u00E9s \n\n
-isisfish.message.diff.finished=fichier dans l'\u00E9tat %1$s
isisfish.message.evaluation.finished=\u00E9valuation termin\u00E9e
isisfish.message.export.done=Export termin\u00E9
isisfish.message.export.zip=Exporter dans le fichier zip %1$s
@@ -555,17 +536,14 @@
isisfish.message.import.region.zipped=Zipped Region
isisfish.message.import.scripts.file.cancelled=Importation des scripts annul\u00E9
isisfish.message.import.xml.v2.file=Import xml v2 file
-isisfish.message.import.xml.v2.file\ =
isisfish.message.import.zip=Import zip file
isisfish.message.load.finished=Chargement termin\u00E9
isisfish.message.load.map=Chargement de la carte \: %1$s (%2$s, %3$s)
-isisfish.message.load.region.canceled=chargement de r\u00E9gion annul\u00E9
isisfish.message.loading.old.simulation=Chargement d'une ancienne simulation ...
isisfish.message.loading.region=Chargement de la r\u00E9gion
isisfish.message.name.imported.region=Entrez le nom de la r\u00E9gion \u00E0 importer
isisfish.message.new.filename=Entrer le nom du nouveau du fichier.\n\t (utiliser uniquemment des caract\u00E8res et _ en commencant avec une majuscule)
isisfish.message.new.region.name=Entrer le nom de la nouvell r\u00E9gion
-isisfish.message.no.diff=Pas de diff\u00E9rences trouv\u00E9s pour le fichier %1$s, \u00E9tant un '%2$s'
isisfish.message.old.simulation.loaded=Ancienne simulation charg\u00E9e
isisfish.message.page.modified=Cette page a \u00E9t\u00E9 modifi\u00E9, voulez-vous la sauvegarder ?
isisfish.message.presimulation.script.execution=Ex\u00E9cution des scripts de Presimulation
@@ -586,7 +564,7 @@
isisfish.message.simulation.ended=Simulation termin\u00E9e
isisfish.message.simulation.execution=Simulation execution
isisfish.message.tray.disabled=Icone de notification d\u00E9sactiv\u00E9e
-isisfish.message.update.finished=update finished
+isisfish.message.update.finished=Mise \u00E0 jour termin\u00E9e
isisfish.metier.comments=Commentaires
isisfish.metier.name=Nom
isisfish.metier.rangeValues=Range of values
@@ -602,7 +580,7 @@
isisfish.metierSeasonInfoZone.comments=Commentaires
isisfish.metierSeasonInfoZone.season=Saison
isisfish.metierSeasonInfoZone.selectSeason=S\u00E9lectionnez une saison
-isisfish.metierSeasonInfoZone.title=Seasons / Zones
+isisfish.metierSeasonInfoZone.title=Saison / Zones
isisfish.monitor.title=Application Monitor
isisfish.month.april=avril
isisfish.month.august=ao\u00FBt
@@ -616,7 +594,6 @@
isisfish.month.november=novembre
isisfish.month.october=octobre
isisfish.month.september=september
-isisfish.notitle=/
isisfish.params.changeLogLev=Passe du niveau '%1$s' au niveau '%2$s'
isisfish.params.clearFilter=Reset filtre
isisfish.params.description=Description
@@ -736,7 +713,7 @@
isisfish.result.datas=Donn\u00E9es
isisfish.result.datasRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.donneeRadioButton
isisfish.result.desktopPane=defaultToolTip-fr.ifremer.resultat.ResultatView.desktopPane
-isisfish.result.dimension\ =Dimension
+isisfish.result.dimension=Dimension
isisfish.result.end.simulation=En fin de Simulation\:
isisfish.result.export=Export
isisfish.result.export.file=Exporter text file
@@ -894,8 +871,8 @@
isisfish.strategyMonthInfo.proportion=Proportion
isisfish.strategyMonthInfo.title=StrategyMonthInfo
isisfish.strategyMonthInfo.toString=%1$s %2$s
-isisfish.timeUnit.day=Day
-isisfish.timeUnit.hours=Hours
+isisfish.timeUnit.day=Jour
+isisfish.timeUnit.hours=Heures
isisfish.tray.simulation=Isis-fish - %1$s \: %2$s/%3$s
isisfish.tray.simulation.no=Isis-fish - Pas de simulation
isisfish.tripType.comments=Commentaires
@@ -937,7 +914,35 @@
isisfish.vcs.updateconfirm.ok=confirmer
isisfish.vcs.updateconfirm.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les scripts que vous voulez traiter
isisfish.vcs.updaterepository.confirm=Votre d\u00E9p\u00F4t des scripts n'est pas \u00E0 jour.\nVoulez-vous mettre \u00E0 jour votre d\u00E9p\u00F4t ?\n\nLes fichiers modifi\u00E9s sont \:\n%s
-isisfish.versionStorage.removed=Surim\u00E9
+isisfish.vcs.vcssvn.add.error=Can't add file
+isisfish.vcs.vcssvn.add.errorreadonly=You can't add file, this repository is readonly
+isisfish.vcs.vcssvn.checkProtocol.error=Can't get address on serveur of local repository
+isisfish.vcs.vcssvn.checkProtocol.relocate=Relocate repository %s from %s to %s
+isisfish.vcs.vcssvn.checkout.error=Checkout impossible
+isisfish.vcs.vcssvn.commit.error=Impossible de commiter
+isisfish.vcs.vcssvn.commit.errorreadonly=Vous ne pouvez pas commiter, le d\u00E9p\u00F4t est en lecture seule
+isisfish.vcs.vcssvn.delete.error=Impossible de supprimer des fichiers
+isisfish.vcs.vcssvn.delete.errorreadonly=Vous ne pouvez pas supprimer ce fichier, le d\u00E9p\u00F4t est en lecture seule
+isisfish.vcs.vcssvn.diff.error=Impossible d'obtenir le diff
+isisfish.vcs.vcssvn.gettag.error=Erreur lors de la r\u00E9cup\u00E9ration de l'adresse du d\u00E9p\u00F4t local
+isisfish.vcs.vcssvn.getupdate.error=Impossible d'obtenir le statut des fichiers
+isisfish.vcs.vcssvn.global.filelocalandremotestatus=Le statut du fichier %s est (l\:%s/d\:%s)
+isisfish.vcs.vcssvn.global.filestatus=Le statut de %s est %s
+isisfish.vcs.vcssvn.global.foundUpdatedFile=Ajout de %s comme fichier mis \u00E0 jour
+isisfish.vcs.vcssvn.global.torevision=\u00C0 la r\u00E9vision \: %d
+isisfish.vcs.vcssvn.isconnected.switchoff=Impossible de se connecter au serveur, passage en mode d\u00E9connect\u00E9 \: %s
+isisfish.vcs.vcssvn.isconnected.switchto=Connexion au serveur disponible, passage en mode connect\u00E9 \: %s
+isisfish.vcs.vcssvn.isonremote.error=Le fichier %s n'est pas sur le serveur
+isisfish.vcs.vcssvn.istag.notexist=Le tag %s n'existe pas
+isisfish.vcs.vcssvn.isuptodate.error=Impossible d'obtenir le statut de fichier
+isisfish.vcs.vcssvn.list.error=Impossible de lister
+isisfish.vcs.vcssvn.localstatus.error=Impossible d'obtenir le statut local de fichier
+isisfish.vcs.vcssvn.remotestatus.error=Impossible d'obtenir le statut distant de fichier
+isisfish.vcs.vcssvn.setTag.error=Erreur lors de la r\u00E9cup\u00E9ration de l'adresse du d\u00E9p\u00F4t local
+isisfish.vcs.vcssvn.settag.switchfromto=Switch du tag du d\u00E9p\u00F4t de %s \u00E0 %s
+isisfish.vcs.vcssvn.update.error=Impossible de mettre \u00E0 jour
+isisfish.vcs.vcssvn.update.notinlocal=Impossible de mettre \u00E0 jour des fichiers qui ne sont pas pas dans le d\u00E9p\u00F4t
+isisfish.versionStorage.removed=Supprim\u00E9
isisfish.vesselType.activityRange=Intervalle d'activit\u00E9
isisfish.vesselType.comments=Commentaires
isisfish.vesselType.fuelCost=Co\u00FBt d'un trajet en fuel
@@ -946,7 +951,7 @@
isisfish.vesselType.miniCrew=Taille minimale d'\u00E9quipage
isisfish.vesselType.name=Nom
isisfish.vesselType.speed=Vitesse
-isisfish.welcome.menu.about=A propos
+isisfish.welcome.menu.about=\u00C0 propos
isisfish.welcome.menu.close=Fermer
isisfish.welcome.menu.configuration=Configuration
isisfish.welcome.menu.file=Fichier
@@ -961,7 +966,7 @@
isisfish.welcome.menu.synchro=Synchronisation Serveur
isisfish.welcome.menu.vcs.configuration=Configuration vcs
isisfish.welcome.title=Simulation Ifremer
-isisfish.wizardGroupCreation.allGroupsSameSize=Tous les groupes ont la meme taille
+isisfish.wizardGroupCreation.allGroupsSameSize=Tous les groupes ont la m\u00EAme taille
isisfish.wizardGroupCreation.allValues=Input all the values
isisfish.wizardGroupCreation.computedGrowthCurve=Calcul\u00E9 par une courbe de croissance
isisfish.wizardGroupCreation.firstAge=Premier age
@@ -987,12 +992,5 @@
isisfish.zone.comments=Commentaires
isisfish.zone.name=Nom
not\ started=
-observe.message.quit.edit=
-observe.message.title=
region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
-repository\ host\ change\ from\ %s\ to\ %s=
-repository\ protocol\ change\ from\ %s\ to\ %s=
-repository\ user\ change\ from\ %s\ to\ %s=
simulate\ %s\ with\ file\ %s=
-status\ for\ %s\ is\ %s=Le statut du fichier %s est %s
-to\ revision\ %d=\u00C0 la r\u00E9vision %d
1
0