Ignore:
Timestamp:
2016-05-14T15:45:35+02:00 (4 years ago)
Author:
Don-vip
Message:

see #11924 - Java 9 - replace calls to deprecated classes java.util.Observable / java.util.Observer by a new class ChangeNotifier + swing's ChangeListener

Location:
trunk/src/org/openstreetmap/josm/gui/util
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/util/AdjustmentSynchronizer.java

    r9231 r10210  
    1212import java.util.HashSet;
    1313import java.util.Map;
    14 import java.util.Observable;
    15 import java.util.Observer;
    1614import java.util.Set;
    1715
    1816import javax.swing.JCheckBox;
     17import javax.swing.event.ChangeEvent;
     18import javax.swing.event.ChangeListener;
    1919
    2020import org.openstreetmap.josm.tools.CheckParameterUtil;
     
    3131    private final Map<Adjustable, Boolean> enabledMap;
    3232
    33     private final Observable observable;
     33    private final ChangeNotifier observable;
    3434
    3535    /**
     
    3939        synchronizedAdjustables = new HashSet<>();
    4040        enabledMap = new HashMap<>();
    41         observable = new Observable();
     41        observable = new ChangeNotifier();
    4242    }
    4343
     
    8484
    8585        enabledMap.put(adjustable, isParticipating);
    86         observable.notifyObservers();
     86        observable.fireStateChanged();
    8787    }
    8888
     
    143143        });
    144144
    145         observable.addObserver(
    146                 new Observer() {
     145        observable.addChangeListener(
     146                new ChangeListener() {
    147147                    @Override
    148                     public void update(Observable o, Object arg) {
     148                    public void stateChanged(ChangeEvent e) {
    149149                        boolean sync = isParticipatingInSynchronizedScrolling(adjustable);
    150150                        if (view.isSelected() != sync) {
Note: See TracChangeset for help on using the changeset viewer.