Ignore:
Timestamp:
2013-06-26T10:14:24+02:00 (11 years ago)
Author:
akks
Message:

Highlight relation or object when user clicks the list in Relation List, Selection List or Properties dialog
[ idea by Felis Pimeja ] + added HighlighHelper class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r5958 r6025  
    6666import org.openstreetmap.josm.gui.layer.Layer;
    6767import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     68import org.openstreetmap.josm.gui.util.HighlightHelper;
    6869import org.openstreetmap.josm.gui.widgets.DisableShortcutsOnFocusGainedTextField;
    6970import org.openstreetmap.josm.gui.widgets.JosmTextField;
     
    112113    private final AddSelectionToRelations addSelectionToRelations = new AddSelectionToRelations();
    113114   
     115    HighlightHelper highlightHelper = new HighlightHelper();
     116   
    114117    /**
    115118     * Constructs <code>RelationListDialog</code>
     
    183186    // inform all actions about list of relations they need
    184187    private void updateActionsRelationLists() {
    185         popupMenuHandler.setPrimitives(model.getSelectedRelations());
     188        List<Relation> sel = model.getSelectedRelations();
     189        popupMenuHandler.setPrimitives(sel);
     190       
     191        //update highlights
     192        if (Main.isDisplayingMapView()) {
     193            highlightHelper.highlightOnly(sel);
     194            Main.map.mapView.repaint();
     195        }
    186196    }
    187197   
     
    298308            super(popupMenu);
    299309        }
     310
     311        @Override
     312        public void mouseExited(MouseEvent me) {
     313            highlightHelper.clear();
     314        }
    300315       
    301316        protected void setCurrentRelationAsSelection() {
     
    306321            EditRelationAction.launchEditor(getSelected());
    307322        }
    308 
     323       
    309324        @Override public void mouseClicked(MouseEvent e) {
    310325            if (Main.main.getEditLayer() == null) return;
Note: See TracChangeset for help on using the changeset viewer.