r1249 - trunk/isis-fish/src/resources/i18n
Author: tchemit Date: 2008-07-28 12:44:58 +0000 (Mon, 28 Jul 2008) New Revision: 1249 Modified: trunk/isis-fish/src/resources/i18n/isis-fish-en_GB.properties trunk/isis-fish/src/resources/i18n/isis-fish-fr_FR.properties Log: i18n ? use key (a very big one this time...) Modified: trunk/isis-fish/src/resources/i18n/isis-fish-en_GB.properties =================================================================== --- trunk/isis-fish/src/resources/i18n/isis-fish-en_GB.properties 2008-07-21 14:12:37 UTC (rev 1248) +++ trunk/isis-fish/src/resources/i18n/isis-fish-en_GB.properties 2008-07-28 12:44:58 UTC (rev 1249) @@ -1,74 +1,3 @@ -= -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ new\ JInternalFrame(simulation.getName(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //resizable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //closable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //maximizable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true);//iconifiable\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setContentPane(resEdit.getRootPane());\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setVisible(true);\ \ \ \ \ \ \ \ \ \ \ \ //\t\ \ \ \ intFrame.pack();\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setSize(new\ Dimension(800,700));\ \ \ \ \ \ \ \ \ \ \ \ getDesktopPane().add(intFrame);\ \ \ \ \ \ \ \ \ \ \ \ try{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ intFrame.setSelected(true);\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (PropertyVetoException\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn("Error\ dans\ l\ internalFrame\ ",\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_voirSimulationLogButton_clicked()\ {\ \ \ \ \ \ \ \ String\ name\ = -\ (String)getSimulation().getSelectedItem();\ \ \ \ \ \ \ \ if\ (name\ \!= -\ (String)getSimulation().getSelectedItem();\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ SimulationLoggerUtil.showSimulationLogConsole(name);\ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ ignore\ ?\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_filterSimulationLogButton_clicked()\ {\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ List<String>\ result\ = -\ -5643196187139951889L;\ \ \ \ public\ SimulationException(String\ msg)\ {\ \ \ \ \ \ \ \ super(msg);\ \ \ \ }\ \ \ \ public\ SimulationException(String\ msg,\ Throwable\ e)\ {\ \ \ \ \ \ \ \ super(msg,\ e);\ \ \ \ }}\ //\ SimulationException/*\ *\#\#%\ *\ Copyright\ (C)\ 2007\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ SimulationResultListener.java\ *\ *\ Created\:\ 13\ nov.\ 07\ 11\:59\:53\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 739\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-20\ 18\:46\:38\ +0100\ (mar,\ 20\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ org.codelutin.math.matrix.MatrixND;import\ fr.ifremer.isisfish.IsisFishException;import\ fr.ifremer.isisfish.types.Date;/**\ *\ @author\ poussin\ *\ */public\ interface\ SimulationResultListener\ extends\ SimulationListener\ {\ \ \ \ \ \ \ \ public\ void\ addResult(SimulationContext\ context,\ \ \ \ \ \ \ \ \ \ \ \ Date\ date,\ String\ name,\ MatrixND\ mat)\ throws\ IsisFishException;\ \ \ \ }/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ SimulationQueueEvent.java\ *\ *\ Created\:\ 17\ ao\uFFFDt\ 2006\ 22\:00\:41\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 217\ $\ *\ *\ Last\ update\:\ $Date\:\ 2006-08-21\ 17\:43\:41\ +0200\ (lun,\ 21\ ao\u00FB\ 2006)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.util.EventObject;/**\ *\ @author\ poussin\ *\ */public\ class\ SimulationQueueEvent\ extends\ EventObject\ {\ \ \ \ /**\ simulation\ id\ */\ \ \ \ protected\ String\ id;\ \ \ \ \ \ \ \ /**\ \ \ \ \ *\ @param\ source\ \ \ \ \ */\ \ \ \ public\ SimulationQueueEvent(Object\ source,\ String\ id)\ {\ \ \ \ \ \ \ \ super(source);\ \ \ \ \ \ \ \ this.id\ = -\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ this\ is\ the\ all\ levels\ reader\ to\ create,\ depends\ on\ no\ others\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ = -\ 0;\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //log.debug("\ offset\:"\ +\ offset\ +\ "\ width\:"\ +\ model.nbLinesInEditor);\ \ \ \ \ \ \ \ String[]\ result;\ \ \ \ \ \ \ \ //\ obtain\ lines\ from\ reader\ \ \ \ \ \ \ \ result\ = -\ 4449196856169240128L;\ \ \ \ public\ SimulatorServerBadIdException(String\ msg)\ {\ \ \ \ \ \ \ \ super(msg);\ \ \ \ }\ \ \ \ public\ SimulatorServerBadIdException(String\ msg,\ Throwable\ e)\ {\ \ \ \ \ \ \ \ super(msg,\ e);\ \ \ \ }}\ //\ SimulatorServerBadIdException/*\ *\#\#%\ *\ Copyright\ (C)\ 2002-2005\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ \ \ \ \ 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.\ *\#\#%*//*\ *\ *\ SimulationException.java\ *\ *\ Created\:\ Wed\ Aug\ 14\ 2002\ *\ *\ @author\ \ <poussin at codelutin.com>\ *\ @version\ $Revision\:\ 167\ $\ *\ *\ Mise\ a\ jour\:\ $Date\:\ 2006-01-23\ 15\:00\:17\ +0100\ (lun,\ 23\ jan\ 2006)\ $\ *\ par\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;public\ class\ SimulationException\ extends\ RuntimeException\ {\ //\ SimulationException\ \ \ \ /**\ \ */\ \ \ \ private\ static\ final\ long\ serialVersionUID\ = -\ IsisConfig.Module.REGION;\ \ \ \ \ \ \ \ if\ (create)\ {\ \ \ \ \ \ \ \ \ \ \ \ doCheckoutModule(handler,module,category);\ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ f\ = -\ IsisConfig.getResultExportDirectory(rootDirectory);\ \ \ \ \ \ \ \ \ \ \ \ exportDir.mkdirs();\ \ \ \ \ \ \ \ \ \ \ \ ExportHelper.doExport(simulation,\ exportDir,\ parameters.getExportNames(),\ rootDirectory);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ fr.ifremer.isisfish.simulator.SimulationListener\#beforeSimulation(fr.ifremer.isisfish.simulator.SimulationContext)\ \ \ \ \ */\ \ \ \ public\ void\ beforeSimulation(SimulationContext\ context)\ {\ \ \ \ }}/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ MetierMonitor.java\ *\ *\ Created\:\ 21\ ao\uFFFDt\ 2006\ 15\:43\:19\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 652\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-08\ 15\:04\:16\ +0100\ (jeu,\ 08\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ ruchaud\ $\ */package\ fr.ifremer.isisfish.simulator;import\ static\ org.codelutin.i18n.I18n.n_;import\ java.util.ArrayList;import\ java.util.Collection;import\ java.util.HashMap;import\ java.util.HashSet;import\ java.util.List;import\ java.util.Map;import\ java.util.Set;import\ org.apache.commons.collections.MapIterator;import\ org.apache.commons.collections.keyvalue.MultiKey;import\ org.apache.commons.collections.map.MultiKeyMap;import\ org.apache.commons.logging.Log;import\ org.apache.commons.logging.LogFactory;import\ org.codelutin.math.matrix.MatrixFactory;import\ org.codelutin.math.matrix.MatrixND;import\ org.codelutin.topia.TopiaContext;import\ org.codelutin.topia.TopiaException;import\ fr.ifremer.isisfish.IsisFishRuntimeException;import\ fr.ifremer.isisfish.entities.Metier;import\ fr.ifremer.isisfish.entities.SetOfVessels;import\ fr.ifremer.isisfish.entities.Strategy;import\ fr.ifremer.isisfish.entities.StrategyMonthInfo;import\ fr.ifremer.isisfish.types.Date;import\ fr.ifremer.isisfish.types.Month;/**\ *\ ATTENTION\:\ l'implantation\ de\ cette\ classe\ n'est\ peut-etre\ pas\ correct.\ Il\ faut\ *\ absolument\ verifier\ le\ FIXME,\ mais\ il\ est\ difficile\ de\ le\ faire\ car\ *\ la\ plupart\ des\ methodes\ de\ cette\ objets\ ne\ semble\ plus\ utilis\uFFFD\ dans\ la\ *\ version\ 2.3.x\ de\ isis\ *\ \ *\ @author\ poussin\ */public\ class\ MetierMonitor\ {\ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\= -\ IsisContext.get().getMainConfig().getDefaultMapFile();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ shp\ = -\ LogLevelUtil.getLogLevels(levels);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ create\ the\ levels\ reader\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ = -\ Session.getDefaultInstance(props,\ null);\ \ \ \ \ \ \ \ //\ --\ Create\ a\ new\ message\ --\ \ \ \ \ \ \ \ Message\ msg\ = -\ SimulationFilterUtil.createFilterModel(value);\ \ \ \ \ \ \ \ //\ to\ used\ directly\ model.getFilteredResult()\ in\ xml\ \ \ \ \ \ \ \ //\ we\ must\ fill\ filterModel\ result\ with\ original\ items\ \ \ \ \ \ \ \ filterModel.selectAll();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ getSimulation().setEditable(false);\ \ \ \ \ \ \ \ model\ = -\ SimulationFilterUtil.filterSimulation(filterModel);\ \ \ \ \ \ \ \ \ \ \ \ model.removeAllElements();\ \ \ \ \ \ \ \ \ \ \ \ for\ (String\ s\ \:\ result)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.addElement(s);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ filter\ on\ simulations= -\ SimulationStorage.getSimulation(name);\ \ \ \ \ \ \ \ \ \ \ \ ResultEdit\ resEdit\ = -\ SimulationStorage.getSimulation(name);\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ storage.delete(false);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ initSimulation();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn("Can't\ delete\ simulation",\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_openWindowButton_clicked(){\ \ \ \ \ \ \ \ String\ name\ = -\ System.getProperties();\ \ \ \ \ \ \ \ //\ --\ Attaching\ to\ default\ Session,\ or\ we\ could\ start\ a\ new\ one\ --\ \ \ \ \ \ \ \ props.put("mail.smtp.host",\ smtpServer);\ \ \ \ \ \ \ \ Session\ session\ = -\ context.getSimulationStorage();\ \ \ \ \ \ \ \ SimulationParameter\ parameters\ = -\ e.getId();\ \ \ \ \ \ \ \ SimulationControl\ control\ = -\ e.getUnitsToScroll();\ \ \ \ \ \ \ \ long\ newOffset;\ \ \ \ \ \ \ \ newOffset\ = -\ evt.getPropertyName();\ \ \ \ \ \ \ \ if\ (properyName.equals(LogConsole.DISPOSE_CHANGED_PROPERTY))\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ ui\ required\ a\ dispose\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ close();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(_("isisfish.error.log.console.dispose"\ ,this,e.getMessage()));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //log.info(properyName\ +\ "\ \:\ "\ +\ evt.getNewValue());\ \ \ \ \ \ \ \ if\ (properyName.equals(RESET_CHANGED_PROPERTY))\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ reset\ filter\ model\ \ \ \ \ \ \ \ \ \ \ \ model.setLevels(0);\ \ \ \ \ \ \ \ \ \ \ \ model.setSearchText("= -\ false;\ \ \ \ }\ \ \ \ public\ void\ propertyChange(PropertyChangeEvent\ evt)\ {\ \ \ \ \ \ \ \ String\ properyName\ = -\ filename\ +\ ".shp";\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ ssx\ = -\ filename\ +\ ".ssx";\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ addShapeLayer(filename,\ shp,\ ssx,\ "ff000000",\ "ffbdde83= -\ from;\ \ \ \ \ \ \ \ this.logFile\ = -\ getRowCount();\ \ \ \ \ \ \ \ fireTableRowsInserted(row,\ row);\ \ \ \ \ \ \ \ SimulationControl\ control\ = -\ getSimulationControl(e.getId());\ \ \ \ \ \ \ \ control.addPropertyChangeListener(this);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationRemoved(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationWillBeRemoved(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ String\ id\ = -\ getSimulationControl(e.getId());\ \ \ \ \ \ \ \ if\ (control\ \!= -\ getSimulationIndex(id);\ \ \ \ \ \ \ \ if\ (isRowIndexValid(row))\ {\ \ \ \ \ \ \ \ \ \ \ \ fireTableRowsDeleted(row,\ row);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ progress.remove(id);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationStart(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationStart(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ *\ @see\ SimulationQueueListener\#simulationStop(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ */\ \ \ \ public\ void\ simulationStop(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }}\ //\ SimulationQueueModel/*\ *\#\#%\ *\ Copyright\ (C)\ 2007\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ SimulationExportResultWrapper.java\ *\ *\ Created\:\ 14\ nov.\ 07\ 00\:22\:51\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 1128\ $\ *\ *\ Last\ update\:\ $Date\:\ 2008-01-08\ 20\:21\:28\ +0100\ (mar,\ 08\ jan\ 2008)\ $\ *\ by\ \:\ $Author\:\ tchemit\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.io.File;import\ fr.ifremer.isisfish.IsisConfig;import\ fr.ifremer.isisfish.datastore.SimulationStorage;import\ fr.ifremer.isisfish.export.ExportHelper;/**\ *\ @author\ poussin\ *\ */public\ class\ SimulationExportResultWrapper\ implements\ SimulationListener\ {\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ fr.ifremer.isisfish.simulator.SimulationListener\#afterSimulation(fr.ifremer.isisfish.simulator.SimulationContext)\ \ \ \ \ */\ \ \ \ public\ void\ afterSimulation(SimulationContext\ context)\ {\ \ \ \ \ \ \ \ SimulationStorage\ simulation\ = -\ getSimulationNames();\ \ \ \ \ \ \ \ //\ create\ filter\ model\ \ \ \ \ \ \ \ filterModel\ = -\ id;\ \ \ \ }\ \ \ \ \ \ \ \ /**\ \ \ \ \ *\ @return\ Returns\ the\ id.\ \ \ \ \ */\ \ \ \ public\ String\ getId()\ {\ \ \ \ \ \ \ \ return\ this.id;\ \ \ \ }\ \ \ \ }/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ PopulationMonitor.java\ *\ *\ Created\:\ 21\ ao\uFFFDt\ 2006\ 15\:41\:18\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 428\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-10-15\ 14\:56\:13\ +0200\ (lun,\ 15\ oct\ 2007)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.util.ArrayList;import\ java.util.HashMap;import\ java.util.List;import\ java.util.Map;import\ org.apache.commons.collections.MapIterator;import\ org.apache.commons.collections.keyvalue.MultiKey;import\ org.apache.commons.collections.map.MultiKeyMap;import\ org.apache.commons.logging.Log;import\ org.apache.commons.logging.LogFactory;import\ org.codelutin.math.matrix.MatrixFactory;import\ org.codelutin.math.matrix.MatrixIterator;import\ org.codelutin.math.matrix.MatrixND;import\ fr.ifremer.isisfish.entities.Population;import\ fr.ifremer.isisfish.entities.PopulationGroup;import\ fr.ifremer.isisfish.entities.PopulationSeasonInfo;import\ fr.ifremer.isisfish.entities.Species;import\ fr.ifremer.isisfish.entities.Zone;import\ fr.ifremer.isisfish.types.Date;import\ fr.ifremer.isisfish.types.Month;/**\ *\ \ *\ @author\ poussin\ */public\ class\ PopulationMonitor\ {\ \ \ \ \ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\= -\ levels\ +\ "";\ \ \ \ \ \ \ \ LevelsLineReader\ reader\ = -\ levelsReader;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (reader\ = -\ logFile;\ \ \ \ \ \ \ \ this.simulationFile\ = -\ model.getFirstLinePosition()\ +\ unitsToScroll;\ \ \ \ \ \ \ \ if\ (unitsToScroll\ >\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (model.isEOF())\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ nothing\ to\ do\ we\ are\ already\ at\ the\ tail\ of\ the\ stream\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (model.isBOF())\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ nothing\ to\ do\ we\ are\ already\ at\ the\ head\ of\ the\ stream\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ dontAdjust\ = -\ module.getClazz().getMethod("checkout",String.class);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ method.invoke(module.getClazz(),category);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(org.codelutin.i18n.I18n._("isisfish.error.checkout.module",\ f.getAbsolutePath()),\ eee);\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ static\ void\ doCheckoutRegion(VCSHandler\ handler,\ \ String\ category,boolean\ create)\ {\ \ \ \ \ \ \ \ IsisConfig.Module\ module\ = -\ new\ DefaultComboBoxModel(value.toArray());\ \ \ \ \ \ \ \ getSimulation().setModel(model);\ \ \ \ \ \ \ \ getSimulation().setSelectedItem(null);\ \ \ \ }\ \ \ \ public\ void\ on_Resultat_destroy_event(){\ \ \ \ \ \ \ \ dispose();\ \ \ \ }\ \ \ \ public\ void\ on_simulation_selection_notify_event(ItemEvent\ e){\ \ \ \ \ \ \ \ //\tsetSelectedSimulation((Simulation)getSimulation().getSelectedItem());\ \ \ \ }\ \ \ \ /**\ \ \ \ *\ Get\ the\ value\ of\ selectedSimulation.\ \ \ \ *\ @return\ value\ of\ selectedSimulation.\ \ \ \ */\ \ \ \ //\ \ \ \ public\ Simulation\ getSelectedSimulation()\ {\ \ \ \ \ \ \ \ //return\ selectedSimulation;\ \ \ \ //}\ \ \ \ /**\ \ \ \ *\ Set\ the\ value\ of\ selectedSimulation.\ \ \ \ *\ @param\ v\ \ Value\ to\ assign\ to\ selectedSimulation.\ \ \ \ */\ \ \ \ //public\ void\ setSelectedSimulation(Simulation\ v)\ {\ \ \ \ \ \ \ \ //this.selectedSimulation\ = -\ new\ File(module.getDirectory(),category);\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ (\!f.exists()||\ \!VCSHelper.isFileInWorkingCopy(f,\ handler,true))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fr.ifremer.isisfish.datastore.RegionStorage.checkout(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ handler.getLocalDatabasePath(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ module.value()\ +\ "/"\ +category\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ );\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(org.codelutin.i18n.I18n._("isisfish.error.checkout.module",\ f.getAbsolutePath()),\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }}/*\ *\#\#%*\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ Tony\ Chemit***\ 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.*\#\#%*/package\ fr.ifremer.isisfish.versionning.vcsSvn;import\ fr.ifremer.isisfish.versionning.IsisVcsConfig;import\ static\ org.codelutin.i18n.I18n._;import\ org.codelutin.vcs.AbstractVCSHandler;import\ org.codelutin.vcs.VCSConfig;import\ org.codelutin.vcs.VCSException;import\ org.codelutin.vcs.VCSHelper;import\ static\ org.codelutin.vcs.VCSHelper.isFileInCheckedDir;import\ org.codelutin.vcs.VCSRuntimeException;import\ org.codelutin.vcs.VCSState;import\ static\ org.codelutin.vcs.VCSState.OUT_OF_DATE;import\ static\ org.codelutin.vcs.VCSState.OUT_OF_DATE_AND_MODIFIED;import\ static\ org.codelutin.vcs.VCSState.UP_TO_DATE;import\ org.codelutin.vcs.VCSStatus;import\ org.tmatesoft.svn.core.ISVNDirEntryHandler;import\ org.tmatesoft.svn.core.ISVNLogEntryHandler;import\ org.tmatesoft.svn.core.SVNCommitInfo;import\ org.tmatesoft.svn.core.SVNDirEntry;import\ org.tmatesoft.svn.core.SVNException;import\ org.tmatesoft.svn.core.SVNLogEntry;import\ org.tmatesoft.svn.core.SVNNodeKind;import\ org.tmatesoft.svn.core.SVNURL;import\ org.tmatesoft.svn.core.io.SVNRepository;import\ org.tmatesoft.svn.core.wc.ISVNOptions;import\ org.tmatesoft.svn.core.wc.SVNClientManager;import\ org.tmatesoft.svn.core.wc.SVNRevision;import\ org.tmatesoft.svn.core.wc.SVNStatus;import\ org.tmatesoft.svn.core.wc.SVNStatusType;import\ static\ org.tmatesoft.svn.core.wc.SVNStatusType.*;import\ org.tmatesoft.svn.core.wc.SVNWCClient;import\ org.tmatesoft.svn.core.wc.SVNWCUtil;import\ java.io.ByteArrayOutputStream;import\ java.io.File;import\ java.io.IOException;import\ java.util.ArrayList;import\ java.util.Arrays;import\ java.util.Collection;import\ java.util.Collections;import\ java.util.Iterator;import\ java.util.List;/**\ *\ VCSHandler\ implementation\ for\ svn\ *\ *\ @author\ chemit\ */public\ final\ class\ SVNHandler\ extends\ AbstractVCSHandler\ {\ \ \ \ protected\ SVNURL\ repositoryURL;\ \ \ \ protected\ SVNRepository\ repository;\ \ \ \ protected\ SVNClientManager\ ourClientManager;\ \ \ \ protected\ SVNWCClient\ ourWcClient;\ \ \ \ public\ SVNHandler(VCSConfig\ config)\ {\ \ \ \ \ \ \ \ super(config,\ ".svn",\ "entries= -\ new\ File(module.getDirectory(),category);\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (\!f.exists()||\ \!VCSHelper.isFileInWorkingCopy(f,\ handler,true))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Method\ method\ = -\ new\ File(readerDirectory,\ "offsets_"\ +\ levels);\ \ \ \ \ \ \ \ \ \ \ \ FileOffsetReader\ offsetReader\ = -\ new\ FileOffsetReader(offsetFile);\ \ \ \ \ \ \ \ \ \ \ \ if\ (levels\ = -\ new\ LevelsLineReader(getLevelReader(0),\ offsetReader,\ logLevels);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ reader.setId(levelsStr);\ \ \ \ \ \ \ \ \ \ \ \ levelsReaders.add(reader);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (\!reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ open\ reader\ \ \ \ \ \ \ \ \ \ \ \ reader.open();\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ log.info(reader);\ \ \ \ \ \ \ \ return\ reader;\ \ \ \ }\ \ \ \ protected\ void\ openReader(LineReader\ reader)\ throws\ IOException\ {\ \ \ \ \ \ \ \ this.reader\ = -\ new\ LevelsLineReader(model.getLogFile(),\ offsetReader);\ \ \ \ \ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ other\ level\ readers\ depens\ on\ all\ levels\ reader\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LogLevel[]\ logLevels\ = -\ new\ LogMail(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getFrom(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getLogFile(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getLogFile().getParentFile(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getSmtpServer());\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ logMail.setVisible(true);\ \ \ \ }}/**\ \#\#%\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ Tony\ Chemit***\ 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.*\ \#\#%\ */package\ fr.ifremer.isisfish.logging.console;import\ javax.swing.event.ChangeEvent;import\ javax.swing.event.ChangeListener;import\ javax.swing.event.EventListenerList;import\ java.io.File;import\ java.util.ArrayList;import\ java.util.List;/**\ *\ This\ class\ is\ the\ model\ used\ in\ LogConsole.\ *\ <p/>\ *\ The\ model\ deals\ with\ ChangeEvent\ to\ notify\ ui,\ model\ has\ changed.\ *\ *\ @author\ chemit\ */public\ class\ LogConsoleModel\ {\ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\= -\ new\ MimeMessage(session);\ \ \ \ \ \ \ \ //\ --\ Set\ the\ FROM\ and\ TO\ fields\ --\ \ \ \ \ \ \ \ msg.setFrom(new\ InternetAddress(from));\ \ \ \ \ \ \ \ msg.setRecipients(Message.RecipientType.TO,\ InternetAddress.parse(to,\ false));\ \ \ \ \ \ \ \ MimeMultipart\ bodyMime\ = -\ new\ MimeMultipart("mixed= -\ new\ PatternLineReader(parent,\ new\ MemoryOffsetReader(5000),\ searchText,\ 0);\ \ \ \ \ \ \ \ reader.setId(parent.getId()\ +\ "\:"\ +\ searchText);\ \ \ \ \ \ \ \ log.info(reader);\ \ \ \ \ \ \ \ return\ reader;\ \ \ \ }\ \ \ \ //TODO\ Improve\ algorithm\ \:\ always\ try\ to\ find\ the\ closest\ reader\ to\ use\ \ \ \ protected\ LineReader\ getLevelReader(int\ levels)\ throws\ IOException\ {\ \ \ \ \ \ \ \ String\ levelsStr\ = -\ new\ ResultEdit(simulation);\ \ \ \ \ \ \ \ \ \ \ \ JInternalFrame\ intFrame\ = -\ null\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ &&\ parameters.getExportNames().size()\ >\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ exportDir\ = -\ null\ &&\ reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader.close();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ close\ reader\ {0}",\ reader));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ @Override\ \ \ \ protected\ void\ finalize()\ throws\ Throwable\ {\ \ \ \ \ \ \ \ super.finalize();\ \ \ \ \ \ \ \ close();\ \ \ \ }\ \ \ \ /**\ \ \ \ \ *\ read\ the\ required\ frame\ from\ current\ reader\ \ \ \ \ *\ \ \ \ \ *\ @param\ offset\ the\ offset\ to\ use\ \ \ \ \ *\ @throws\ IOException\ if\ any\ problem\ while\ reading\ \ \ \ \ */\ \ \ \ public\ void\ read(long\ offset)\ throws\ IOException\ {\ \ \ \ \ \ \ \ if\ (offset\ <\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ offset\ = -\ null)\ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader.close();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ Properties\ getData()\ {\ \ \ \ \ \ \ \ return\ data;\ \ \ \ }\ \ \ \ public\ String\ getName()\ {\ \ \ \ \ \ \ \ return\ name;\ \ \ \ }}/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ SimulationQueueModel.java\ *\ *\ Created\:\ 18\ ao\uFFFDt\ 2006\ 00\:05\:41\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 602\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-01\ 21\:39\:12\ +0100\ (jeu,\ 01\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ tchemit\ $\ */package\ fr.ifremer.isisfish.simulator;/**\ @author\ poussin\ */public\ class\ SimulationQueueModel\ extends\ AbstractSimulationQueueModel\ {\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel()\ \ \ \ \ */\ \ \ \ public\ SimulationQueueModel()\ {\ \ \ \ \ \ \ \ super();\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel(SimulationManager)\ \ \ \ \ */\ \ \ \ public\ SimulationQueueModel(SimulationManager\ queue)\ {\ \ \ \ \ \ \ \ super(queue);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel at getSimulationIds()\ \ \ \ \ */\ \ \ \ protected\ java.util.List<String>\ getSimulationIds()\ {\ \ \ \ \ \ \ \ return\ getQueue().ids;\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel at getQueueItemsAsMap()\ \ \ \ \ */\ \ \ \ protected\ java.util.Map<String,\ SimulationManager.QueueItem>\ getQueueItemsAsMap()\ {\ \ \ \ \ \ \ \ return\ getQueue().map;\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationAdded(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationAdded(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ int\ row\ = -\ null)\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ offsetFile\ = -\ null)\ {\ \ \ \ \ \ \ \ \ \ \ \ control.removePropertyChangeListener(this);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ int\ row\ = -\ null){\ \ \ \ \ \ \ \ \ \ \ \ SimulationStorage\ simulation\ = -\ null){\ \ \ \ \ \ \ \ \ \ \ \ SimulationStorage\ storage\ = -\ null;\ \ \ \ \ \ \ \ for\ (LineReaderUtil.LevelsLineReader\ levelsReader\ \:\ levelsReaders)\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (levelsReader.getId().equals(levelsStr))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ = -\ reader.readLine(offset,\ model.nbLinesInEditor);\ \ \ \ \ \ \ \ //\ mark\ the\ new\ first\ position\ \ \ \ \ \ \ \ model.setFirstLinePosition(offset);\ \ \ \ \ \ \ \ //\ add\ lines\ in\ model\ \ \ \ \ \ \ \ model.allItems.clear();\ \ \ \ \ \ \ \ model.allItems.addAll(Arrays.asList(result));\ \ \ \ \ \ \ \ //\ notify\ ui\ that\ model\ changed\ \ \ \ \ \ \ \ model.fireStateChanged();\ \ \ \ }\ \ \ \ public\ void\ mouseWheelMoved(MouseWheelEvent\ e)\ {\ \ \ \ \ \ \ \ int\ unitsToScroll\ = -\ reader;\ \ \ \ \ \ \ \ if\ (\!this.reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ open\ reader\ \ \ \ \ \ \ \ \ \ \ \ this.reader.open();\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //\ save\ the\ number\ of\ lines\ of\ reader\ in\ model\ \ \ \ \ \ \ \ model.nbLines\ = -\ simulation.getDirectory();\ \ \ \ \ \ \ \ //\ \ \ \ \ \ \ \ //\ Export\ des\ r\uFFFDsultats\ \ \ \ \ \ \ \ //\ \ \ \ \ \ \ \ if\ (parameters.getExportNames()\ \!= -\ simulation.getParameter();\ \ \ \ \ \ \ \ File\ rootDirectory\ = -\ simulationFile;\ \ \ \ \ \ \ \ this.smtpServer\ = -\ smtpServer;\ \ \ \ \ \ \ \ this.statusBar\ = -\ statusBar;\ \ \ \ \ \ \ \ sendMail.addActionListener(new\ ActionListener()\ {\ \ \ \ \ \ \ \ \ \ \ \ public\ void\ actionPerformed(ActionEvent\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sendMail(mailTo.getText(),\ content.getText(),\ sendAll.isSelected());\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar.setStatus(_("isisfish.log.mail.send"\ ,\ to));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar.setStatus(_("isisfish.log.mail.failed",\ smtpServer));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ finally\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dispose();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ });\ \ \ \ }\ \ \ \ public\ void\ setTo(String\ to)\ {\ \ \ \ \ \ \ \ this.to\ = -\ statusBar;\ \ \ \ }\ \ \ \ public\ void\ openLogMail()\ {\ \ \ \ \ \ \ \ if\ (logMail= -\ this.reader.getNbLines();\ \ \ \ }\ \ \ \ public\ void\ addPropertyChangeListener(PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.addPropertyChangeListener(listener);\ \ \ \ }\ \ \ \ public\ void\ addPropertyChangeListener(String\ propertyName,\ PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.addPropertyChangeListener(propertyName,\ listener);\ \ \ \ }\ \ \ \ public\ void\ removePropertyChangeListener(PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.removePropertyChangeListener(listener);\ \ \ \ }\ \ \ \ public\ void\ removePropertyChangeListener(String\ propertyName,\ PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.removePropertyChangeListener(propertyName,\ listener);\ \ \ \ }\ \ \ \ public\ StatusBar\ getStatusBar()\ {\ \ \ \ \ \ \ \ return\ statusBar;\ \ \ \ }\ \ \ \ public\ void\ setStatusBar(StatusBar\ statusBar)\ {\ \ \ \ \ \ \ \ this.statusBar\ = -\ to;\ \ \ \ }\ \ \ \ /**\ \ \ \ \ *\ Send\ an\ email\ using\ the\ given\ informations\ (stmpServer,\ toAddress,\ \ \ \ \ *\ fromAddress,\ subject\ and\ body).\ \ \ \ \ *\ \ \ \ \ *\ @param\ to\ \ \ \ \ \ \ adr\ to\ send\ the\ mail\ \ \ \ \ *\ @param\ text\ \ \ \ \ message\ text\ \ \ \ \ *\ @param\ selected\ if\ <code>true</code>\ send\ all\ simulation\ zip,\ \ \ \ \ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ or\ just\ the\ file\ \ \ \ \ *\ @throws\ java.io.IOException\ \ \ \ \ \ \ \ \ \ \ if\ any\ problem\ while\ creatingthe\ zip\ \ \ \ \ *\ @throws\ javax.mail.MessagingException\ if\ any\ problem\ while\ creating\ \ \ \ \ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ message\ or\ while\ the\ send\ \ \ \ \ */\ \ \ \ public\ void\ sendMail(String\ to,\ String\ text,\ boolean\ selected)\ throws\ IOException,\ MessagingException\ {\ \ \ \ \ \ \ \ Properties\ props\ = -\ true;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ read(e.getValue());\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e1)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ read\ at\ offset\ {0}\ for\ reason\ {1}",\ e.getValue(),\ e1.getMessage()));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ dontAdjust\ = -\ true;\ \ \ \ \ \ \ \ \ \ \ \ read(newOffset);\ \ \ \ \ \ \ \ }\ catch\ (IOException\ e1)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ read\ at\ offset\ {0}\ for\ reason\ {1}",\ newOffset,\ e1.getMessage()));\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ adjustmentValueChanged(AdjustmentEvent\ e)\ {\ \ \ \ \ \ \ \ if\ (\!e.getValueIsAdjusting()\ &&\ \!dontAdjust)\ {\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ Fix\ bug\ \:sometimes\ when\ going\ at\ tail,\ it\ goes\ head\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ (the\ offset\ must\ not\ be\ good...)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //log.info("value\:"+e.getValue());\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dontAdjust\ = -\ v;\ \ \ \ //}\ \ \ \ public\ void\ on_supprimerSimulationButton_clicked(){\ \ \ \ \ \ \ \ String\ name\ = -Checkout\ pom.xml\ to\ {0}",\ file.getPath()));\ \ \ \ \ \ \ \ vcsHandler.update(file);\ \ \ \ \ \ \ \ getContext().setQuit(true);\ \ \ \ }}\ /*\ *\ \#\#%\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ Tony\ Chemit***\ 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.*\ \#\#%\ */package\ fr.ifremer.isisfish.commandline.actions;import\ fr.ifremer.isisfish.IsisConfig;import\ fr.ifremer.isisfish.datastore.AnalysePlanStorage;import\ fr.ifremer.isisfish.datastore.ExportStorage;import\ fr.ifremer.isisfish.datastore.FormuleStorage;import\ fr.ifremer.isisfish.datastore.RuleStorage;import\ fr.ifremer.isisfish.datastore.ScriptStorage;import\ fr.ifremer.isisfish.datastore.SimulatorStorage;import\ java.io.File;import\ java.util.ArrayList;import\ java.util.List;import\ java.util.regex.Pattern;/**\ *\ The\ class\ to\ define\ all\ actions\ on\ scripts\ or\ data\ (region,\ simulations)\ \ that\ *\ IsisFish\ can\ launch\ at\ init\ time.\ *\ *\ @author\ chemit\ */public\ class\ ScriptUtil\ {\ \ \ \ /**\ \ \ \ \ *\ Pour\ v\uFFFDrifier\ q'un\ fichier\ existe.\ \ \ \ \ *\ \ \ \ \ *\ @param\ file\ \ the\ file\ dont\ on\ doit\ v\uFFFDrifier\ l'existence\ \ \ \ \ *\ @param\ force\ flag\ pour\ d\uFFFDclancher\ une\ exception,\ si\ fichier\ non\ trouv\uFFFD.\ \ \ \ \ */\ \ \ \ public\ static\ void\ checkNotFileExist(File\ file,\ boolean\ force)\ {\ \ \ \ \ \ \ \ if\ (file.exists()\ &&\ \!force)\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ fatal\ error\ \ \ \ \ \ \ \ \ \ \ \ throw\ new\ IllegalArgumentException("destination\ already\ exists\ "\ +\ file\ +\ "\ use\ \\'force\\'\ argument\ to\ force\ overwrite= Info=Info could\ not\ close\ reader\ {0}",\ levelsReader));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (reader\ \!= could\ not\ create\ simulation\ filter\ model\ for\ reason\ {0}",e.getMessage()),e);\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ private\ void\ initSimulation()\ throws\ IOException,\ ParseException\ {\ \ \ \ \ \ \ \ //\ keep\ in\ context\ list\ of\ old\ simulation\ names\ (for\ filter\ process)\ \ \ \ \ \ \ \ java.util.List<String>\ value\ = Modified: trunk/isis-fish/src/resources/i18n/isis-fish-fr_FR.properties =================================================================== --- trunk/isis-fish/src/resources/i18n/isis-fish-fr_FR.properties 2008-07-21 14:12:37 UTC (rev 1248) +++ trunk/isis-fish/src/resources/i18n/isis-fish-fr_FR.properties 2008-07-28 12:44:58 UTC (rev 1249) @@ -1,74 +1,3 @@ -= -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ new\ JInternalFrame(simulation.getName(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //resizable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //closable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //maximizable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true);//iconifiable\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setContentPane(resEdit.getRootPane());\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setVisible(true);\ \ \ \ \ \ \ \ \ \ \ \ //\t\ \ \ \ intFrame.pack();\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setSize(new\ Dimension(800,700));\ \ \ \ \ \ \ \ \ \ \ \ getDesktopPane().add(intFrame);\ \ \ \ \ \ \ \ \ \ \ \ try{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ intFrame.setSelected(true);\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (PropertyVetoException\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn("Error\ dans\ l\ internalFrame\ ",\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_voirSimulationLogButton_clicked()\ {\ \ \ \ \ \ \ \ String\ name\ = -\ (String)getSimulation().getSelectedItem();\ \ \ \ \ \ \ \ if\ (name\ \!= -\ (String)getSimulation().getSelectedItem();\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ SimulationLoggerUtil.showSimulationLogConsole(name);\ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ ignore\ ?\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_filterSimulationLogButton_clicked()\ {\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ List<String>\ result\ = -\ -5643196187139951889L;\ \ \ \ public\ SimulationException(String\ msg)\ {\ \ \ \ \ \ \ \ super(msg);\ \ \ \ }\ \ \ \ public\ SimulationException(String\ msg,\ Throwable\ e)\ {\ \ \ \ \ \ \ \ super(msg,\ e);\ \ \ \ }}\ //\ SimulationException/*\ *\#\#%\ *\ Copyright\ (C)\ 2007\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ SimulationResultListener.java\ *\ *\ Created\:\ 13\ nov.\ 07\ 11\:59\:53\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 739\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-20\ 18\:46\:38\ +0100\ (mar,\ 20\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ org.codelutin.math.matrix.MatrixND;import\ fr.ifremer.isisfish.IsisFishException;import\ fr.ifremer.isisfish.types.Date;/**\ *\ @author\ poussin\ *\ */public\ interface\ SimulationResultListener\ extends\ SimulationListener\ {\ \ \ \ \ \ \ \ public\ void\ addResult(SimulationContext\ context,\ \ \ \ \ \ \ \ \ \ \ \ Date\ date,\ String\ name,\ MatrixND\ mat)\ throws\ IsisFishException;\ \ \ \ }/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ SimulationQueueEvent.java\ *\ *\ Created\:\ 17\ ao\uFFFDt\ 2006\ 22\:00\:41\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 217\ $\ *\ *\ Last\ update\:\ $Date\:\ 2006-08-21\ 17\:43\:41\ +0200\ (lun,\ 21\ ao\u00FB\ 2006)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.util.EventObject;/**\ *\ @author\ poussin\ *\ */public\ class\ SimulationQueueEvent\ extends\ EventObject\ {\ \ \ \ /**\ simulation\ id\ */\ \ \ \ protected\ String\ id;\ \ \ \ \ \ \ \ /**\ \ \ \ \ *\ @param\ source\ \ \ \ \ */\ \ \ \ public\ SimulationQueueEvent(Object\ source,\ String\ id)\ {\ \ \ \ \ \ \ \ super(source);\ \ \ \ \ \ \ \ this.id\ = -\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ this\ is\ the\ all\ levels\ reader\ to\ create,\ depends\ on\ no\ others\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ = -\ 0;\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //log.debug("\ offset\:"\ +\ offset\ +\ "\ width\:"\ +\ model.nbLinesInEditor);\ \ \ \ \ \ \ \ String[]\ result;\ \ \ \ \ \ \ \ //\ obtain\ lines\ from\ reader\ \ \ \ \ \ \ \ result\ = -\ 4449196856169240128L;\ \ \ \ public\ SimulatorServerBadIdException(String\ msg)\ {\ \ \ \ \ \ \ \ super(msg);\ \ \ \ }\ \ \ \ public\ SimulatorServerBadIdException(String\ msg,\ Throwable\ e)\ {\ \ \ \ \ \ \ \ super(msg,\ e);\ \ \ \ }}\ //\ SimulatorServerBadIdException/*\ *\#\#%\ *\ Copyright\ (C)\ 2002-2005\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ \ \ \ \ 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.\ *\#\#%*//*\ *\ *\ SimulationException.java\ *\ *\ Created\:\ Wed\ Aug\ 14\ 2002\ *\ *\ @author\ \ <poussin at codelutin.com>\ *\ @version\ $Revision\:\ 167\ $\ *\ *\ Mise\ a\ jour\:\ $Date\:\ 2006-01-23\ 15\:00\:17\ +0100\ (lun,\ 23\ jan\ 2006)\ $\ *\ par\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;public\ class\ SimulationException\ extends\ RuntimeException\ {\ //\ SimulationException\ \ \ \ /**\ \ */\ \ \ \ private\ static\ final\ long\ serialVersionUID\ = -\ IsisConfig.Module.REGION;\ \ \ \ \ \ \ \ if\ (create)\ {\ \ \ \ \ \ \ \ \ \ \ \ doCheckoutModule(handler,module,category);\ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ f\ = -\ IsisConfig.getResultExportDirectory(rootDirectory);\ \ \ \ \ \ \ \ \ \ \ \ exportDir.mkdirs();\ \ \ \ \ \ \ \ \ \ \ \ ExportHelper.doExport(simulation,\ exportDir,\ parameters.getExportNames(),\ rootDirectory);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ fr.ifremer.isisfish.simulator.SimulationListener\#beforeSimulation(fr.ifremer.isisfish.simulator.SimulationContext)\ \ \ \ \ */\ \ \ \ public\ void\ beforeSimulation(SimulationContext\ context)\ {\ \ \ \ }}/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ MetierMonitor.java\ *\ *\ Created\:\ 21\ ao\uFFFDt\ 2006\ 15\:43\:19\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 652\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-08\ 15\:04\:16\ +0100\ (jeu,\ 08\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ ruchaud\ $\ */package\ fr.ifremer.isisfish.simulator;import\ static\ org.codelutin.i18n.I18n.n_;import\ java.util.ArrayList;import\ java.util.Collection;import\ java.util.HashMap;import\ java.util.HashSet;import\ java.util.List;import\ java.util.Map;import\ java.util.Set;import\ org.apache.commons.collections.MapIterator;import\ org.apache.commons.collections.keyvalue.MultiKey;import\ org.apache.commons.collections.map.MultiKeyMap;import\ org.apache.commons.logging.Log;import\ org.apache.commons.logging.LogFactory;import\ org.codelutin.math.matrix.MatrixFactory;import\ org.codelutin.math.matrix.MatrixND;import\ org.codelutin.topia.TopiaContext;import\ org.codelutin.topia.TopiaException;import\ fr.ifremer.isisfish.IsisFishRuntimeException;import\ fr.ifremer.isisfish.entities.Metier;import\ fr.ifremer.isisfish.entities.SetOfVessels;import\ fr.ifremer.isisfish.entities.Strategy;import\ fr.ifremer.isisfish.entities.StrategyMonthInfo;import\ fr.ifremer.isisfish.types.Date;import\ fr.ifremer.isisfish.types.Month;/**\ *\ ATTENTION\:\ l'implantation\ de\ cette\ classe\ n'est\ peut-etre\ pas\ correct.\ Il\ faut\ *\ absolument\ verifier\ le\ FIXME,\ mais\ il\ est\ difficile\ de\ le\ faire\ car\ *\ la\ plupart\ des\ methodes\ de\ cette\ objets\ ne\ semble\ plus\ utilis\uFFFD\ dans\ la\ *\ version\ 2.3.x\ de\ isis\ *\ \ *\ @author\ poussin\ */public\ class\ MetierMonitor\ {\ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\= -\ IsisContext.get().getMainConfig().getDefaultMapFile();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ shp\ = -\ LogLevelUtil.getLogLevels(levels);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ create\ the\ levels\ reader\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ = -\ Session.getDefaultInstance(props,\ null);\ \ \ \ \ \ \ \ //\ --\ Create\ a\ new\ message\ --\ \ \ \ \ \ \ \ Message\ msg\ = -\ SimulationFilterUtil.createFilterModel(value);\ \ \ \ \ \ \ \ //\ to\ used\ directly\ model.getFilteredResult()\ in\ xml\ \ \ \ \ \ \ \ //\ we\ must\ fill\ filterModel\ result\ with\ original\ items\ \ \ \ \ \ \ \ filterModel.selectAll();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ getSimulation().setEditable(false);\ \ \ \ \ \ \ \ model\ = -\ SimulationFilterUtil.filterSimulation(filterModel);\ \ \ \ \ \ \ \ \ \ \ \ model.removeAllElements();\ \ \ \ \ \ \ \ \ \ \ \ for\ (String\ s\ \:\ result)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.addElement(s);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ filter\ on\ simulations= -\ SimulationStorage.getSimulation(name);\ \ \ \ \ \ \ \ \ \ \ \ ResultEdit\ resEdit\ = -\ SimulationStorage.getSimulation(name);\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ storage.delete(false);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ initSimulation();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn("Can't\ delete\ simulation",\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_openWindowButton_clicked(){\ \ \ \ \ \ \ \ String\ name\ = -\ System.getProperties();\ \ \ \ \ \ \ \ //\ --\ Attaching\ to\ default\ Session,\ or\ we\ could\ start\ a\ new\ one\ --\ \ \ \ \ \ \ \ props.put("mail.smtp.host",\ smtpServer);\ \ \ \ \ \ \ \ Session\ session\ = -\ context.getSimulationStorage();\ \ \ \ \ \ \ \ SimulationParameter\ parameters\ = -\ e.getId();\ \ \ \ \ \ \ \ SimulationControl\ control\ = -\ e.getUnitsToScroll();\ \ \ \ \ \ \ \ long\ newOffset;\ \ \ \ \ \ \ \ newOffset\ = -\ evt.getPropertyName();\ \ \ \ \ \ \ \ if\ (properyName.equals(LogConsole.DISPOSE_CHANGED_PROPERTY))\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ ui\ required\ a\ dispose\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ close();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(_("isisfish.error.log.console.dispose"\ ,this,e.getMessage()));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //log.info(properyName\ +\ "\ \:\ "\ +\ evt.getNewValue());\ \ \ \ \ \ \ \ if\ (properyName.equals(RESET_CHANGED_PROPERTY))\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ reset\ filter\ model\ \ \ \ \ \ \ \ \ \ \ \ model.setLevels(0);\ \ \ \ \ \ \ \ \ \ \ \ model.setSearchText("= -\ false;\ \ \ \ }\ \ \ \ public\ void\ propertyChange(PropertyChangeEvent\ evt)\ {\ \ \ \ \ \ \ \ String\ properyName\ = -\ filename\ +\ ".shp";\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ ssx\ = -\ filename\ +\ ".ssx";\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ addShapeLayer(filename,\ shp,\ ssx,\ "ff000000",\ "ffbdde83= -\ from;\ \ \ \ \ \ \ \ this.logFile\ = -\ getRowCount();\ \ \ \ \ \ \ \ fireTableRowsInserted(row,\ row);\ \ \ \ \ \ \ \ SimulationControl\ control\ = -\ getSimulationControl(e.getId());\ \ \ \ \ \ \ \ control.addPropertyChangeListener(this);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationRemoved(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationWillBeRemoved(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ String\ id\ = -\ getSimulationControl(e.getId());\ \ \ \ \ \ \ \ if\ (control\ \!= -\ getSimulationIndex(id);\ \ \ \ \ \ \ \ if\ (isRowIndexValid(row))\ {\ \ \ \ \ \ \ \ \ \ \ \ fireTableRowsDeleted(row,\ row);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ progress.remove(id);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationStart(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationStart(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ *\ @see\ SimulationQueueListener\#simulationStop(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ */\ \ \ \ public\ void\ simulationStop(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }}\ //\ SimulationQueueModel/*\ *\#\#%\ *\ Copyright\ (C)\ 2007\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ SimulationExportResultWrapper.java\ *\ *\ Created\:\ 14\ nov.\ 07\ 00\:22\:51\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 1128\ $\ *\ *\ Last\ update\:\ $Date\:\ 2008-01-08\ 20\:21\:28\ +0100\ (mar,\ 08\ jan\ 2008)\ $\ *\ by\ \:\ $Author\:\ tchemit\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.io.File;import\ fr.ifremer.isisfish.IsisConfig;import\ fr.ifremer.isisfish.datastore.SimulationStorage;import\ fr.ifremer.isisfish.export.ExportHelper;/**\ *\ @author\ poussin\ *\ */public\ class\ SimulationExportResultWrapper\ implements\ SimulationListener\ {\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ fr.ifremer.isisfish.simulator.SimulationListener\#afterSimulation(fr.ifremer.isisfish.simulator.SimulationContext)\ \ \ \ \ */\ \ \ \ public\ void\ afterSimulation(SimulationContext\ context)\ {\ \ \ \ \ \ \ \ SimulationStorage\ simulation\ = -\ getSimulationNames();\ \ \ \ \ \ \ \ //\ create\ filter\ model\ \ \ \ \ \ \ \ filterModel\ = -\ id;\ \ \ \ }\ \ \ \ \ \ \ \ /**\ \ \ \ \ *\ @return\ Returns\ the\ id.\ \ \ \ \ */\ \ \ \ public\ String\ getId()\ {\ \ \ \ \ \ \ \ return\ this.id;\ \ \ \ }\ \ \ \ }/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ PopulationMonitor.java\ *\ *\ Created\:\ 21\ ao\uFFFDt\ 2006\ 15\:41\:18\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 428\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-10-15\ 14\:56\:13\ +0200\ (lun,\ 15\ oct\ 2007)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.util.ArrayList;import\ java.util.HashMap;import\ java.util.List;import\ java.util.Map;import\ org.apache.commons.collections.MapIterator;import\ org.apache.commons.collections.keyvalue.MultiKey;import\ org.apache.commons.collections.map.MultiKeyMap;import\ org.apache.commons.logging.Log;import\ org.apache.commons.logging.LogFactory;import\ org.codelutin.math.matrix.MatrixFactory;import\ org.codelutin.math.matrix.MatrixIterator;import\ org.codelutin.math.matrix.MatrixND;import\ fr.ifremer.isisfish.entities.Population;import\ fr.ifremer.isisfish.entities.PopulationGroup;import\ fr.ifremer.isisfish.entities.PopulationSeasonInfo;import\ fr.ifremer.isisfish.entities.Species;import\ fr.ifremer.isisfish.entities.Zone;import\ fr.ifremer.isisfish.types.Date;import\ fr.ifremer.isisfish.types.Month;/**\ *\ \ *\ @author\ poussin\ */public\ class\ PopulationMonitor\ {\ \ \ \ \ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\= -\ levels\ +\ "";\ \ \ \ \ \ \ \ LevelsLineReader\ reader\ = -\ levelsReader;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (reader\ = -\ logFile;\ \ \ \ \ \ \ \ this.simulationFile\ = -\ model.getFirstLinePosition()\ +\ unitsToScroll;\ \ \ \ \ \ \ \ if\ (unitsToScroll\ >\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (model.isEOF())\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ nothing\ to\ do\ we\ are\ already\ at\ the\ tail\ of\ the\ stream\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (model.isBOF())\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ nothing\ to\ do\ we\ are\ already\ at\ the\ head\ of\ the\ stream\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ dontAdjust\ = -\ module.getClazz().getMethod("checkout",String.class);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ method.invoke(module.getClazz(),category);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(org.codelutin.i18n.I18n._("isisfish.error.checkout.module",\ f.getAbsolutePath()),\ eee);\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ static\ void\ doCheckoutRegion(VCSHandler\ handler,\ \ String\ category,boolean\ create)\ {\ \ \ \ \ \ \ \ IsisConfig.Module\ module\ = -\ new\ DefaultComboBoxModel(value.toArray());\ \ \ \ \ \ \ \ getSimulation().setModel(model);\ \ \ \ \ \ \ \ getSimulation().setSelectedItem(null);\ \ \ \ }\ \ \ \ public\ void\ on_Resultat_destroy_event(){\ \ \ \ \ \ \ \ dispose();\ \ \ \ }\ \ \ \ public\ void\ on_simulation_selection_notify_event(ItemEvent\ e){\ \ \ \ \ \ \ \ //\tsetSelectedSimulation((Simulation)getSimulation().getSelectedItem());\ \ \ \ }\ \ \ \ /**\ \ \ \ *\ Get\ the\ value\ of\ selectedSimulation.\ \ \ \ *\ @return\ value\ of\ selectedSimulation.\ \ \ \ */\ \ \ \ //\ \ \ \ public\ Simulation\ getSelectedSimulation()\ {\ \ \ \ \ \ \ \ //return\ selectedSimulation;\ \ \ \ //}\ \ \ \ /**\ \ \ \ *\ Set\ the\ value\ of\ selectedSimulation.\ \ \ \ *\ @param\ v\ \ Value\ to\ assign\ to\ selectedSimulation.\ \ \ \ */\ \ \ \ //public\ void\ setSelectedSimulation(Simulation\ v)\ {\ \ \ \ \ \ \ \ //this.selectedSimulation\ = -\ new\ File(module.getDirectory(),category);\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ (\!f.exists()||\ \!VCSHelper.isFileInWorkingCopy(f,\ handler,true))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fr.ifremer.isisfish.datastore.RegionStorage.checkout(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ handler.getLocalDatabasePath(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ module.value()\ +\ "/"\ +category\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ );\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(org.codelutin.i18n.I18n._("isisfish.error.checkout.module",\ f.getAbsolutePath()),\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }}/*\ *\#\#%*\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ Tony\ Chemit***\ 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.*\#\#%*/package\ fr.ifremer.isisfish.versionning.vcsSvn;import\ fr.ifremer.isisfish.versionning.IsisVcsConfig;import\ static\ org.codelutin.i18n.I18n._;import\ org.codelutin.vcs.AbstractVCSHandler;import\ org.codelutin.vcs.VCSConfig;import\ org.codelutin.vcs.VCSException;import\ org.codelutin.vcs.VCSHelper;import\ static\ org.codelutin.vcs.VCSHelper.isFileInCheckedDir;import\ org.codelutin.vcs.VCSRuntimeException;import\ org.codelutin.vcs.VCSState;import\ static\ org.codelutin.vcs.VCSState.OUT_OF_DATE;import\ static\ org.codelutin.vcs.VCSState.OUT_OF_DATE_AND_MODIFIED;import\ static\ org.codelutin.vcs.VCSState.UP_TO_DATE;import\ org.codelutin.vcs.VCSStatus;import\ org.tmatesoft.svn.core.ISVNDirEntryHandler;import\ org.tmatesoft.svn.core.ISVNLogEntryHandler;import\ org.tmatesoft.svn.core.SVNCommitInfo;import\ org.tmatesoft.svn.core.SVNDirEntry;import\ org.tmatesoft.svn.core.SVNException;import\ org.tmatesoft.svn.core.SVNLogEntry;import\ org.tmatesoft.svn.core.SVNNodeKind;import\ org.tmatesoft.svn.core.SVNURL;import\ org.tmatesoft.svn.core.io.SVNRepository;import\ org.tmatesoft.svn.core.wc.ISVNOptions;import\ org.tmatesoft.svn.core.wc.SVNClientManager;import\ org.tmatesoft.svn.core.wc.SVNRevision;import\ org.tmatesoft.svn.core.wc.SVNStatus;import\ org.tmatesoft.svn.core.wc.SVNStatusType;import\ static\ org.tmatesoft.svn.core.wc.SVNStatusType.*;import\ org.tmatesoft.svn.core.wc.SVNWCClient;import\ org.tmatesoft.svn.core.wc.SVNWCUtil;import\ java.io.ByteArrayOutputStream;import\ java.io.File;import\ java.io.IOException;import\ java.util.ArrayList;import\ java.util.Arrays;import\ java.util.Collection;import\ java.util.Collections;import\ java.util.Iterator;import\ java.util.List;/**\ *\ VCSHandler\ implementation\ for\ svn\ *\ *\ @author\ chemit\ */public\ final\ class\ SVNHandler\ extends\ AbstractVCSHandler\ {\ \ \ \ protected\ SVNURL\ repositoryURL;\ \ \ \ protected\ SVNRepository\ repository;\ \ \ \ protected\ SVNClientManager\ ourClientManager;\ \ \ \ protected\ SVNWCClient\ ourWcClient;\ \ \ \ public\ SVNHandler(VCSConfig\ config)\ {\ \ \ \ \ \ \ \ super(config,\ ".svn",\ "entries= -\ new\ File(module.getDirectory(),category);\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (\!f.exists()||\ \!VCSHelper.isFileInWorkingCopy(f,\ handler,true))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Method\ method\ = -\ new\ File(readerDirectory,\ "offsets_"\ +\ levels);\ \ \ \ \ \ \ \ \ \ \ \ FileOffsetReader\ offsetReader\ = -\ new\ FileOffsetReader(offsetFile);\ \ \ \ \ \ \ \ \ \ \ \ if\ (levels\ = -\ new\ LevelsLineReader(getLevelReader(0),\ offsetReader,\ logLevels);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ reader.setId(levelsStr);\ \ \ \ \ \ \ \ \ \ \ \ levelsReaders.add(reader);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (\!reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ open\ reader\ \ \ \ \ \ \ \ \ \ \ \ reader.open();\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ log.info(reader);\ \ \ \ \ \ \ \ return\ reader;\ \ \ \ }\ \ \ \ protected\ void\ openReader(LineReader\ reader)\ throws\ IOException\ {\ \ \ \ \ \ \ \ this.reader\ = -\ new\ LevelsLineReader(model.getLogFile(),\ offsetReader);\ \ \ \ \ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ other\ level\ readers\ depens\ on\ all\ levels\ reader\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LogLevel[]\ logLevels\ = -\ new\ LogMail(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getFrom(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getLogFile(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getLogFile().getParentFile(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getSmtpServer());\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ logMail.setVisible(true);\ \ \ \ }}/**\ \#\#%\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ Tony\ Chemit***\ 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.*\ \#\#%\ */package\ fr.ifremer.isisfish.logging.console;import\ javax.swing.event.ChangeEvent;import\ javax.swing.event.ChangeListener;import\ javax.swing.event.EventListenerList;import\ java.io.File;import\ java.util.ArrayList;import\ java.util.List;/**\ *\ This\ class\ is\ the\ model\ used\ in\ LogConsole.\ *\ <p/>\ *\ The\ model\ deals\ with\ ChangeEvent\ to\ notify\ ui,\ model\ has\ changed.\ *\ *\ @author\ chemit\ */public\ class\ LogConsoleModel\ {\ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\= -\ new\ MimeMessage(session);\ \ \ \ \ \ \ \ //\ --\ Set\ the\ FROM\ and\ TO\ fields\ --\ \ \ \ \ \ \ \ msg.setFrom(new\ InternetAddress(from));\ \ \ \ \ \ \ \ msg.setRecipients(Message.RecipientType.TO,\ InternetAddress.parse(to,\ false));\ \ \ \ \ \ \ \ MimeMultipart\ bodyMime\ = -\ new\ MimeMultipart("mixed= -\ new\ PatternLineReader(parent,\ new\ MemoryOffsetReader(5000),\ searchText,\ 0);\ \ \ \ \ \ \ \ reader.setId(parent.getId()\ +\ "\:"\ +\ searchText);\ \ \ \ \ \ \ \ log.info(reader);\ \ \ \ \ \ \ \ return\ reader;\ \ \ \ }\ \ \ \ //TODO\ Improve\ algorithm\ \:\ always\ try\ to\ find\ the\ closest\ reader\ to\ use\ \ \ \ protected\ LineReader\ getLevelReader(int\ levels)\ throws\ IOException\ {\ \ \ \ \ \ \ \ String\ levelsStr\ = -\ new\ ResultEdit(simulation);\ \ \ \ \ \ \ \ \ \ \ \ JInternalFrame\ intFrame\ = -\ null\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ &&\ parameters.getExportNames().size()\ >\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ exportDir\ = -\ null\ &&\ reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader.close();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ close\ reader\ {0}",\ reader));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ @Override\ \ \ \ protected\ void\ finalize()\ throws\ Throwable\ {\ \ \ \ \ \ \ \ super.finalize();\ \ \ \ \ \ \ \ close();\ \ \ \ }\ \ \ \ /**\ \ \ \ \ *\ read\ the\ required\ frame\ from\ current\ reader\ \ \ \ \ *\ \ \ \ \ *\ @param\ offset\ the\ offset\ to\ use\ \ \ \ \ *\ @throws\ IOException\ if\ any\ problem\ while\ reading\ \ \ \ \ */\ \ \ \ public\ void\ read(long\ offset)\ throws\ IOException\ {\ \ \ \ \ \ \ \ if\ (offset\ <\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ offset\ = -\ null)\ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader.close();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ Properties\ getData()\ {\ \ \ \ \ \ \ \ return\ data;\ \ \ \ }\ \ \ \ public\ String\ getName()\ {\ \ \ \ \ \ \ \ return\ name;\ \ \ \ }}/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ 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.\ *\#\#%*//*\ *\ *\ SimulationQueueModel.java\ *\ *\ Created\:\ 18\ ao\uFFFDt\ 2006\ 00\:05\:41\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 602\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-01\ 21\:39\:12\ +0100\ (jeu,\ 01\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ tchemit\ $\ */package\ fr.ifremer.isisfish.simulator;/**\ @author\ poussin\ */public\ class\ SimulationQueueModel\ extends\ AbstractSimulationQueueModel\ {\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel()\ \ \ \ \ */\ \ \ \ public\ SimulationQueueModel()\ {\ \ \ \ \ \ \ \ super();\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel(SimulationManager)\ \ \ \ \ */\ \ \ \ public\ SimulationQueueModel(SimulationManager\ queue)\ {\ \ \ \ \ \ \ \ super(queue);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel at getSimulationIds()\ \ \ \ \ */\ \ \ \ protected\ java.util.List<String>\ getSimulationIds()\ {\ \ \ \ \ \ \ \ return\ getQueue().ids;\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel at getQueueItemsAsMap()\ \ \ \ \ */\ \ \ \ protected\ java.util.Map<String,\ SimulationManager.QueueItem>\ getQueueItemsAsMap()\ {\ \ \ \ \ \ \ \ return\ getQueue().map;\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationAdded(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationAdded(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ int\ row\ = -\ null)\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ offsetFile\ = -\ null)\ {\ \ \ \ \ \ \ \ \ \ \ \ control.removePropertyChangeListener(this);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ int\ row\ = -\ null){\ \ \ \ \ \ \ \ \ \ \ \ SimulationStorage\ simulation\ = -\ null){\ \ \ \ \ \ \ \ \ \ \ \ SimulationStorage\ storage\ = -\ null;\ \ \ \ \ \ \ \ for\ (LineReaderUtil.LevelsLineReader\ levelsReader\ \:\ levelsReaders)\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (levelsReader.getId().equals(levelsStr))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ = -\ reader.readLine(offset,\ model.nbLinesInEditor);\ \ \ \ \ \ \ \ //\ mark\ the\ new\ first\ position\ \ \ \ \ \ \ \ model.setFirstLinePosition(offset);\ \ \ \ \ \ \ \ //\ add\ lines\ in\ model\ \ \ \ \ \ \ \ model.allItems.clear();\ \ \ \ \ \ \ \ model.allItems.addAll(Arrays.asList(result));\ \ \ \ \ \ \ \ //\ notify\ ui\ that\ model\ changed\ \ \ \ \ \ \ \ model.fireStateChanged();\ \ \ \ }\ \ \ \ public\ void\ mouseWheelMoved(MouseWheelEvent\ e)\ {\ \ \ \ \ \ \ \ int\ unitsToScroll\ = -\ reader;\ \ \ \ \ \ \ \ if\ (\!this.reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ open\ reader\ \ \ \ \ \ \ \ \ \ \ \ this.reader.open();\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //\ save\ the\ number\ of\ lines\ of\ reader\ in\ model\ \ \ \ \ \ \ \ model.nbLines\ = -\ simulation.getDirectory();\ \ \ \ \ \ \ \ //\ \ \ \ \ \ \ \ //\ Export\ des\ r\uFFFDsultats\ \ \ \ \ \ \ \ //\ \ \ \ \ \ \ \ if\ (parameters.getExportNames()\ \!= -\ simulation.getParameter();\ \ \ \ \ \ \ \ File\ rootDirectory\ = -\ simulationFile;\ \ \ \ \ \ \ \ this.smtpServer\ = -\ smtpServer;\ \ \ \ \ \ \ \ this.statusBar\ = -\ statusBar;\ \ \ \ \ \ \ \ sendMail.addActionListener(new\ ActionListener()\ {\ \ \ \ \ \ \ \ \ \ \ \ public\ void\ actionPerformed(ActionEvent\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sendMail(mailTo.getText(),\ content.getText(),\ sendAll.isSelected());\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar.setStatus(_("isisfish.log.mail.send"\ ,\ to));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar.setStatus(_("isisfish.log.mail.failed",\ smtpServer));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ finally\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dispose();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ });\ \ \ \ }\ \ \ \ public\ void\ setTo(String\ to)\ {\ \ \ \ \ \ \ \ this.to\ = -\ statusBar;\ \ \ \ }\ \ \ \ public\ void\ openLogMail()\ {\ \ \ \ \ \ \ \ if\ (logMail= -\ this.reader.getNbLines();\ \ \ \ }\ \ \ \ public\ void\ addPropertyChangeListener(PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.addPropertyChangeListener(listener);\ \ \ \ }\ \ \ \ public\ void\ addPropertyChangeListener(String\ propertyName,\ PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.addPropertyChangeListener(propertyName,\ listener);\ \ \ \ }\ \ \ \ public\ void\ removePropertyChangeListener(PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.removePropertyChangeListener(listener);\ \ \ \ }\ \ \ \ public\ void\ removePropertyChangeListener(String\ propertyName,\ PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.removePropertyChangeListener(propertyName,\ listener);\ \ \ \ }\ \ \ \ public\ StatusBar\ getStatusBar()\ {\ \ \ \ \ \ \ \ return\ statusBar;\ \ \ \ }\ \ \ \ public\ void\ setStatusBar(StatusBar\ statusBar)\ {\ \ \ \ \ \ \ \ this.statusBar\ = -\ to;\ \ \ \ }\ \ \ \ /**\ \ \ \ \ *\ Send\ an\ email\ using\ the\ given\ informations\ (stmpServer,\ toAddress,\ \ \ \ \ *\ fromAddress,\ subject\ and\ body).\ \ \ \ \ *\ \ \ \ \ *\ @param\ to\ \ \ \ \ \ \ adr\ to\ send\ the\ mail\ \ \ \ \ *\ @param\ text\ \ \ \ \ message\ text\ \ \ \ \ *\ @param\ selected\ if\ <code>true</code>\ send\ all\ simulation\ zip,\ \ \ \ \ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ or\ just\ the\ file\ \ \ \ \ *\ @throws\ java.io.IOException\ \ \ \ \ \ \ \ \ \ \ if\ any\ problem\ while\ creatingthe\ zip\ \ \ \ \ *\ @throws\ javax.mail.MessagingException\ if\ any\ problem\ while\ creating\ \ \ \ \ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ message\ or\ while\ the\ send\ \ \ \ \ */\ \ \ \ public\ void\ sendMail(String\ to,\ String\ text,\ boolean\ selected)\ throws\ IOException,\ MessagingException\ {\ \ \ \ \ \ \ \ Properties\ props\ = -\ true;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ read(e.getValue());\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e1)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ read\ at\ offset\ {0}\ for\ reason\ {1}",\ e.getValue(),\ e1.getMessage()));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ dontAdjust\ = -\ true;\ \ \ \ \ \ \ \ \ \ \ \ read(newOffset);\ \ \ \ \ \ \ \ }\ catch\ (IOException\ e1)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ read\ at\ offset\ {0}\ for\ reason\ {1}",\ newOffset,\ e1.getMessage()));\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ adjustmentValueChanged(AdjustmentEvent\ e)\ {\ \ \ \ \ \ \ \ if\ (\!e.getValueIsAdjusting()\ &&\ \!dontAdjust)\ {\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ Fix\ bug\ \:sometimes\ when\ going\ at\ tail,\ it\ goes\ head\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ (the\ offset\ must\ not\ be\ good...)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //log.info("value\:"+e.getValue());\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dontAdjust\ = -\ v;\ \ \ \ //}\ \ \ \ public\ void\ on_supprimerSimulationButton_clicked(){\ \ \ \ \ \ \ \ String\ name\ = -Checkout\ pom.xml\ to\ {0}",\ file.getPath()));\ \ \ \ \ \ \ \ vcsHandler.update(file);\ \ \ \ \ \ \ \ getContext().setQuit(true);\ \ \ \ }}\ /*\ *\ \#\#%\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ Tony\ Chemit***\ 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.*\ \#\#%\ */package\ fr.ifremer.isisfish.commandline.actions;import\ fr.ifremer.isisfish.IsisConfig;import\ fr.ifremer.isisfish.datastore.AnalysePlanStorage;import\ fr.ifremer.isisfish.datastore.ExportStorage;import\ fr.ifremer.isisfish.datastore.FormuleStorage;import\ fr.ifremer.isisfish.datastore.RuleStorage;import\ fr.ifremer.isisfish.datastore.ScriptStorage;import\ fr.ifremer.isisfish.datastore.SimulatorStorage;import\ java.io.File;import\ java.util.ArrayList;import\ java.util.List;import\ java.util.regex.Pattern;/**\ *\ The\ class\ to\ define\ all\ actions\ on\ scripts\ or\ data\ (region,\ simulations)\ \ that\ *\ IsisFish\ can\ launch\ at\ init\ time.\ *\ *\ @author\ chemit\ */public\ class\ ScriptUtil\ {\ \ \ \ /**\ \ \ \ \ *\ Pour\ v\uFFFDrifier\ q'un\ fichier\ existe.\ \ \ \ \ *\ \ \ \ \ *\ @param\ file\ \ the\ file\ dont\ on\ doit\ v\uFFFDrifier\ l'existence\ \ \ \ \ *\ @param\ force\ flag\ pour\ d\uFFFDclancher\ une\ exception,\ si\ fichier\ non\ trouv\uFFFD.\ \ \ \ \ */\ \ \ \ public\ static\ void\ checkNotFileExist(File\ file,\ boolean\ force)\ {\ \ \ \ \ \ \ \ if\ (file.exists()\ &&\ \!force)\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ fatal\ error\ \ \ \ \ \ \ \ \ \ \ \ throw\ new\ IllegalArgumentException("destination\ already\ exists\ "\ +\ file\ +\ "\ use\ \\'force\\'\ argument\ to\ force\ overwrite= Info=Info could\ not\ close\ reader\ {0}",\ levelsReader));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (reader\ \!= could\ not\ create\ simulation\ filter\ model\ for\ reason\ {0}",e.getMessage()),e);\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ private\ void\ initSimulation()\ throws\ IOException,\ ParseException\ {\ \ \ \ \ \ \ \ //\ keep\ in\ context\ list\ of\ old\ simulation\ names\ (for\ filter\ process)\ \ \ \ \ \ \ \ java.util.List<String>\ value\ =
participants (1)
-
tchemit@users.labs.libre-entreprise.org