Changeset 20711 in osm for applications


Ignore:
Timestamp:
2010-03-28T12:45:43+02:00 (15 years ago)
Author:
guggis
Message:

Minor updates

Location:
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetView.java

    r20556 r20711  
    3535                DatasetEventManager.getInstance().addDatasetListener((DataSetListener)model, FireMode.IN_EDT);
    3636                if (Main.main.getEditLayer() != null) {
    37                         model.setTurnRestrictions(Main.main.getEditLayer().data
    38                                         .getRelations());
     37                        model.setTurnRestrictions(Main.main.getEditLayer().data.getRelations());
    3938                }
    4039        }
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java

    r20556 r20711  
    22
    33import java.awt.BorderLayout;
     4import java.util.Collections;
    45
    56import javax.swing.DefaultListSelectionModel;
     
    1011import org.openstreetmap.josm.Main;
    1112import org.openstreetmap.josm.data.SelectionChangedListener;
     13import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1214import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
    1315import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
     
    3739                MapView.addEditLayerChangeListener((EditLayerChangeListener)model);
    3840                SelectionEventManager.getInstance().addSelectionListener((SelectionChangedListener)model, FireMode.IN_EDT_CONSOLIDATED);
    39                 if (Main.main.getEditLayer() != null) {
    40                         model.setTurnRestrictions(Main.main.getEditLayer().data.getRelations());
     41                TurnRestrictionsInSelectionListModel m = (TurnRestrictionsInSelectionListModel)model;
     42                if (Main.main.getEditLayer() != null){
     43                        m.initFromSelection(Main.main.getEditLayer().data.getSelected());
     44                } else {
     45                        m.initFromSelection(Collections.<OsmPrimitive>emptyList());
    4146                }
    4247        }
     
    4449        protected void unregisterAsListener() {
    4550                MapView.removeEditLayerChangeListener((EditLayerChangeListener)model);
    46                 SelectionEventManager.getInstance().removeSelectionListener((SelectionChangedListener)model);
     51                SelectionEventManager.getInstance().removeSelectionListener((SelectionChangedListener)model);           
    4752        }
    4853
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java

    r20666 r20711  
    191191                        actZoomTo.updateEnabledState();
    192192                        currentListView.revalidate();
    193                         currentListView.repaint();
     193                        currentListView.repaint();                     
    194194                }
    195195
Note: See TracChangeset for help on using the changeset viewer.