Changeset 5825 in josm


Ignore:
Timestamp:
2013-04-04T18:44:54+02:00 (7 years ago)
Author:
akks
Message:

fix #8574: relation list dialog side buttons din not work
Сontext menu unification (see #7846): relation list and membership table of properties dialog

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs
Files:
3 edited

Legend:

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

    r5821 r5825  
    605605    private final void setupPopupMenuHandler() {
    606606       
    607         // -- download members action
    608         popupMenuHandler.addAction(downloadMembersAction);
    609 
    610         // -- download incomplete members action
    611         popupMenuHandler.addAction(downloadSelectedIncompleteMembersAction);
    612 
    613         popupMenuHandler.addSeparator();
     607        // -- select action
     608        popupMenuHandler.addAction(selectRelationAction);
     609        popupMenuHandler.addAction(addRelationToSelectionAction);
    614610
    615611        // -- select members action
     
    617613        popupMenuHandler.addAction(addMembersToSelectionAction);
    618614
    619         // -- select action
    620         popupMenuHandler.addAction(selectRelationAction);
    621         popupMenuHandler.addAction(addRelationToSelectionAction);
    622 
    623615        popupMenuHandler.addSeparator();
    624 
     616        // -- download members action
     617        popupMenuHandler.addAction(downloadMembersAction);
     618
     619        // -- download incomplete members action
     620        popupMenuHandler.addAction(downloadSelectedIncompleteMembersAction);
     621
     622        popupMenuHandler.addSeparator();
     623        popupMenuHandler.addAction(editAction).setVisible(false);
     624        popupMenuHandler.addAction(duplicateAction).setVisible(false);
     625        popupMenuHandler.addAction(deleteRelationsAction).setVisible(false);
     626       
    625627        popupMenuHandler.addAction(addSelectionToRelations);
    626628    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r5821 r5825  
    8181public class SelectionListDialog extends ToggleDialog  {
    8282    private JList lstPrimitives;
    83     private SelectionListModel model;
    84 
    85     private SelectAction actSelect;
    86     private SearchAction actSearch;
    87     private ZoomToJOSMSelectionAction actZoomToJOSMSelection;
    88     private ZoomToListSelection actZoomToListSelection;
    89     private SelectInRelationListAction actSetRelationSelection;
    90     private EditRelationAction actEditRelationSelection;
    91     private DownloadSelectedIncompleteMembersAction actDownloadSelectedIncompleteMembers;
     83    private DefaultListSelectionModel selectionModel  = new DefaultListSelectionModel();
     84    private SelectionListModel model = new SelectionListModel(selectionModel);
     85
     86    private SelectAction actSelect = new SelectAction();
     87    private SearchAction actSearch = new SearchAction();
     88    private ZoomToJOSMSelectionAction actZoomToJOSMSelection = new ZoomToJOSMSelectionAction();
     89    private ZoomToListSelection actZoomToListSelection = new ZoomToListSelection();
     90    private SelectInRelationListAction actSetRelationSelection = new SelectInRelationListAction();
     91    private EditRelationAction actEditRelationSelection = new EditRelationAction();
     92    private DownloadSelectedIncompleteMembersAction actDownloadSelectedIncompleteMembers = new DownloadSelectedIncompleteMembersAction();
    9293
    9394    /** the popup menu and its handler */
     
    99100     */
    100101    protected void buildContentPanel() {
    101         DefaultListSelectionModel selectionModel  = new DefaultListSelectionModel();
    102         model = new SelectionListModel(selectionModel);
    103102        lstPrimitives = new JList(model);
    104103        lstPrimitives.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
     
    108107
    109108        // the select action
    110         final SideButton selectButton = new SideButton(actSelect = new SelectAction());
     109        final SideButton selectButton = new SideButton(actSelect);
    111110        lstPrimitives.getSelectionModel().addListSelectionListener(actSelect);
    112111        selectButton.createArrow(new ActionListener() {
     
    118117
    119118        // the search button
    120         final SideButton searchButton = new SideButton(actSearch = new SearchAction());
     119        final SideButton searchButton = new SideButton(actSearch);
    121120        searchButton.createArrow(new ActionListener() {
    122121            @Override
     
    141140        buildContentPanel();
    142141        model.addListDataListener(new TitleUpdater());
    143         actZoomToJOSMSelection = new ZoomToJOSMSelectionAction();
    144142        model.addListDataListener(actZoomToJOSMSelection);
    145 
    146         actZoomToListSelection = new ZoomToListSelection();
    147         actSetRelationSelection = new SelectInRelationListAction();
    148         actEditRelationSelection = new EditRelationAction();
    149         actDownloadSelectedIncompleteMembers = new DownloadSelectedIncompleteMembersAction();
    150143
    151144        popupMenu = new ListPopupMenu(lstPrimitives);
     
    219212    }
    220213
    221     private final PopupMenuHandler setupPopupMenuHandler() {
     214    private PopupMenuHandler setupPopupMenuHandler() {
    222215        PopupMenuHandler handler = new PopupMenuHandler(popupMenu);
    223216        handler.addAction(actZoomToJOSMSelection);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r5821 r5825  
    4949import org.openstreetmap.josm.Main;
    5050import org.openstreetmap.josm.actions.JosmAction;
     51import org.openstreetmap.josm.actions.relation.DownloadMembersAction;
    5152import org.openstreetmap.josm.actions.relation.DownloadSelectedIncompleteMembersAction;
     53import org.openstreetmap.josm.actions.relation.SelectInRelationListAction;
    5254import org.openstreetmap.josm.actions.relation.SelectMembersAction;
    5355import org.openstreetmap.josm.actions.relation.SelectRelationAction;
     
    162164
    163165    // relation actions
     166    private final SelectInRelationListAction setRelationSelectionAction = new SelectInRelationListAction();
     167    private final SelectRelationAction selectRelationAction = new SelectRelationAction(false);
     168    private final SelectRelationAction addRelationToSelectionAction = new SelectRelationAction(true);
     169   
     170    private final DownloadMembersAction downloadMembersAction = new DownloadMembersAction();
    164171    private final DownloadSelectedIncompleteMembersAction downloadSelectedIncompleteMembersAction = new DownloadSelectedIncompleteMembersAction();
    165     private final SelectRelationAction addRelationToSelectionAction = new SelectRelationAction(true);
     172   
     173    private final SelectMembersAction selectMembersAction = new SelectMembersAction(false);
    166174    private final SelectMembersAction addMembersToSelectionAction = new SelectMembersAction(true);
    167     private final SelectRelationAction selectRelationAction = new SelectRelationAction(false);
    168175   
    169176    /**
     
    376383    private void setupMembershipMenu() {
    377384        // setting up the membership table
     385        membershipMenuHandler.addAction(setRelationSelectionAction);
     386        membershipMenuHandler.addAction(selectRelationAction);
    378387        membershipMenuHandler.addAction(addRelationToSelectionAction);
    379         membershipMenuHandler.addAction(selectRelationAction);
     388        membershipMenuHandler.addAction(selectMembersAction);
    380389        membershipMenuHandler.addAction(addMembersToSelectionAction);
     390        membershipMenu.addSeparator();
     391        membershipMenuHandler.addAction(downloadMembersAction);
    381392        membershipMenuHandler.addAction(downloadSelectedIncompleteMembersAction);
    382393        membershipMenu.addSeparator();
     
    695706    // </editor-fold>
    696707
    697     // <editor-fold defaultstate="collapsed" desc="Methods that are called by plugins to extend fuctionalty ">
     708    // <editor-fold defaultstate="collapsed" desc="Methods that are called by plugins to extend fuctionality ">
    698709   
    699710    /**
Note: See TracChangeset for help on using the changeset viewer.