This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit a782916087dd83c9ee580981ff5ed02714b73fb3 Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Aug 14 10:59:40 2015 +0200 Ne plus écouter les changements dans les ui (refs #7341) --- .../ird/observe/ui/content/ContentUIHandler.java | 45 ++++++++++------------ .../impl/longline/SetLonglineUIHandler.java | 35 ++++++++--------- .../impl/longline/ActivityLonglineUIHandler.java | 23 ++++++----- .../open/impl/seine/ActivitySeineUIHandler.java | 16 ++++---- 4 files changed, 57 insertions(+), 62 deletions(-) diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIHandler.java index 48207fd..87d4411 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIHandler.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIHandler.java @@ -21,7 +21,6 @@ */ package fr.ird.observe.ui.content; -import com.google.common.collect.ImmutableSet; import fr.ird.observe.BinderService; import fr.ird.observe.DataService; import fr.ird.observe.DecoratorService; @@ -69,8 +68,6 @@ import javax.swing.JOptionPane; import javax.swing.JToolBar; import javax.swing.UIManager; import java.awt.Component; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.List; @@ -859,25 +856,25 @@ public abstract class ContentUIHandler<E extends TopiaEntity> { } - protected static class LogPropertyChanges implements PropertyChangeListener { - - private final ImmutableSet<String> propertyNames; - - public LogPropertyChanges(ImmutableSet<String> propertyNames) { - this.propertyNames = propertyNames; - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - - if (propertyNames.contains(evt.getPropertyName())) { - if (log.isInfoEnabled()) { - log.info(String.format("Property %s changed (%s --> %s)", evt.getPropertyName(), evt.getOldValue(), evt.getNewValue())); - } - - } - - } - - } +// protected static class LogPropertyChanges implements PropertyChangeListener { +// +// private final ImmutableSet<String> propertyNames; +// +// public LogPropertyChanges(ImmutableSet<String> propertyNames) { +// this.propertyNames = propertyNames; +// } +// +// @Override +// public void propertyChange(PropertyChangeEvent evt) { +// +// if (propertyNames.contains(evt.getPropertyName())) { +// if (log.isInfoEnabled()) { +// log.info(String.format("Property %s changed (%s --> %s)", evt.getPropertyName(), evt.getOldValue(), evt.getNewValue())); +// } +// +// } +// +// } +// +// } } diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/SetLonglineUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/SetLonglineUIHandler.java index 4a2a4e8..102ccf2 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/SetLonglineUIHandler.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/SetLonglineUIHandler.java @@ -22,7 +22,6 @@ package fr.ird.observe.ui.content.impl.longline; * #L% */ -import com.google.common.collect.ImmutableSet; import fr.ird.observe.DataService; import fr.ird.observe.ObserveDAOHelper; import fr.ird.observe.db.DataContext; @@ -104,29 +103,29 @@ public class SetLonglineUIHandler extends ContentUIHandler<SetLongline> { } }; - private final LogPropertyChanges logCoordinatesChanges; +// private final LogPropertyChanges logCoordinatesChanges; protected boolean toogleTimeEditorSliderIsChanging; protected boolean coordinateFormatChangedIsChanging; - static ImmutableSet<String> COORDINATES_PROPERTIES = ImmutableSet.of( - SetLongline.PROPERTY_HAULING_START_LONGITUDE, - SetLongline.PROPERTY_HAULING_START_LATITUDE, - SetLongline.PROPERTY_HAULING_START_QUADRANT, - SetLongline.PROPERTY_SETTING_START_LONGITUDE, - SetLongline.PROPERTY_SETTING_START_LATITUDE, - SetLongline.PROPERTY_SETTING_START_QUADRANT, - SetLongline.PROPERTY_HAULING_END_LONGITUDE, - SetLongline.PROPERTY_HAULING_END_LATITUDE, - SetLongline.PROPERTY_HAULING_END_QUADRANT, - SetLongline.PROPERTY_SETTING_END_LONGITUDE, - SetLongline.PROPERTY_SETTING_END_LATITUDE, - SetLongline.PROPERTY_SETTING_END_QUADRANT); +// static ImmutableSet<String> COORDINATES_PROPERTIES = ImmutableSet.of( +// SetLongline.PROPERTY_HAULING_START_LONGITUDE, +// SetLongline.PROPERTY_HAULING_START_LATITUDE, +// SetLongline.PROPERTY_HAULING_START_QUADRANT, +// SetLongline.PROPERTY_SETTING_START_LONGITUDE, +// SetLongline.PROPERTY_SETTING_START_LATITUDE, +// SetLongline.PROPERTY_SETTING_START_QUADRANT, +// SetLongline.PROPERTY_HAULING_END_LONGITUDE, +// SetLongline.PROPERTY_HAULING_END_LATITUDE, +// SetLongline.PROPERTY_HAULING_END_QUADRANT, +// SetLongline.PROPERTY_SETTING_END_LONGITUDE, +// SetLongline.PROPERTY_SETTING_END_LATITUDE, +// SetLongline.PROPERTY_SETTING_END_QUADRANT); public SetLonglineUIHandler(SetLonglineUI ui) { super(ui, DataContextType.ActivityLongline, DataContextType.SetLongline); - this.logCoordinatesChanges = new LogPropertyChanges(COORDINATES_PROPERTIES); +// this.logCoordinatesChanges = new LogPropertyChanges(COORDINATES_PROPERTIES); } @Override @@ -183,8 +182,8 @@ public class SetLonglineUIHandler extends ContentUIHandler<SetLongline> { getUi().getHaulingStartCoordinates().getModel().addPropertyChangeListener(CoordinatesEditorModel.PROPERTY_FORMAT, onCoordinateFormatChangedListener); getUi().getHaulingEndCoordinates().getModel().addPropertyChangeListener(CoordinatesEditorModel.PROPERTY_FORMAT, onCoordinateFormatChangedListener); - getBean().removePropertyChangeListener(logCoordinatesChanges); - getBean().addPropertyChangeListener(logCoordinatesChanges); +// getBean().removePropertyChangeListener(logCoordinatesChanges); +// getBean().addPropertyChangeListener(logCoordinatesChanges); } diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java index 2dea40f..59094f0 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java @@ -22,7 +22,6 @@ package fr.ird.observe.ui.content.open.impl.longline; * #L% */ -import com.google.common.collect.ImmutableSet; import fr.ird.observe.DataService; import fr.ird.observe.ObserveDAOHelper; import fr.ird.observe.ObserveTechnicalException; @@ -71,18 +70,18 @@ public class ActivityLonglineUIHandler extends ContentOpenableUIHandler<Activity } - static ImmutableSet<String> COORDINATES_PROPERTIES = ImmutableSet.of(ActivityLongline.PROPERTY_QUADRANT, - ActivityLongline.PROPERTY_LATITUDE, - ActivityLongline.PROPERTY_LONGITUDE); +// static ImmutableSet<String> COORDINATES_PROPERTIES = ImmutableSet.of(ActivityLongline.PROPERTY_QUADRANT, +// ActivityLongline.PROPERTY_LATITUDE, +// ActivityLongline.PROPERTY_LONGITUDE); - private LogPropertyChanges logCoordinatesChanges; +// private LogPropertyChanges logCoordinatesChanges; public ActivityLonglineUIHandler(ActivityLonglineUI ui) { super(ui, DataContextType.TripLongline, DataContextType.ActivityLongline, n("observe.activityLongline.message.not.open")); - this.logCoordinatesChanges = new LogPropertyChanges(COORDINATES_PROPERTIES); +// this.logCoordinatesChanges = new LogPropertyChanges(COORDINATES_PROPERTIES); } @Override @@ -133,12 +132,12 @@ public class ActivityLonglineUIHandler extends ContentOpenableUIHandler<Activity return ContentMode.READ; } - @Override - public void initUI() throws Exception { - super.initUI(); - getBean().removePropertyChangeListener(logCoordinatesChanges); - getBean().addPropertyChangeListener(logCoordinatesChanges); - } +// @Override +// public void initUI() throws Exception { +// super.initUI(); +// getBean().removePropertyChangeListener(logCoordinatesChanges); +// getBean().addPropertyChangeListener(logCoordinatesChanges); +// } @Override public void openUI() throws Exception { diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java index 187d5d2..4ad839f 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java @@ -21,7 +21,6 @@ */ package fr.ird.observe.ui.content.open.impl.seine; -import com.google.common.collect.ImmutableSet; import fr.ird.observe.DataService; import fr.ird.observe.ObserveDAOHelper; import fr.ird.observe.db.DataContext; @@ -72,6 +71,7 @@ public class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySei // Compute valid state of tab from the error table protected final TableModelListener computeTabValidStateListener = new TableModelListener() { + @Override public void tableChanged(TableModelEvent e) { @@ -81,11 +81,11 @@ public class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySei } }; - static ImmutableSet<String> COORDINATES_PROPERTIES = ImmutableSet.of(ActivitySeine.PROPERTY_QUADRANT, - ActivitySeine.PROPERTY_LATITUDE, - ActivitySeine.PROPERTY_LONGITUDE); +// static ImmutableSet<String> COORDINATES_PROPERTIES = ImmutableSet.of(ActivitySeine.PROPERTY_QUADRANT, +// ActivitySeine.PROPERTY_LATITUDE, +// ActivitySeine.PROPERTY_LONGITUDE); - private LogPropertyChanges logCoordinatesChanges; +// private LogPropertyChanges logCoordinatesChanges; public ActivitySeineUIHandler(ActivitySeineUI ui) { @@ -93,7 +93,7 @@ public class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySei DataContextType.Route, DataContextType.ActivitySeine, n("observe.activitySeine.message.not.open")); - this.logCoordinatesChanges = new LogPropertyChanges(COORDINATES_PROPERTIES); +// this.logCoordinatesChanges = new LogPropertyChanges(COORDINATES_PROPERTIES); } @Override @@ -162,8 +162,8 @@ public class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySei // listen messages to see if required to add getUi().getErrorTableModel().addTableModelListener(computeTabValidStateListener); - getBean().removePropertyChangeListener(logCoordinatesChanges); - getBean().addPropertyChangeListener(logCoordinatesChanges); +// getBean().removePropertyChangeListener(logCoordinatesChanges); +// getBean().addPropertyChangeListener(logCoordinatesChanges); } @Override -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.