Changeset 586 in josm for trunk


Ignore:
Timestamp:
2008-03-20T23:56:02+01:00 (16 years ago)
Author:
framm
Message:
  • add a "select" button at the bottom of the relation list to transfer a relation into JOSM's selection, from where it can then be added to a relation in the relation editor. Fixes #510. Note that JOSM still has difficulties when uploading newly-created nested relations; it may do so in the wrong order and be rejected by the API which refuses to create a reference to a not-yet-uploaded relation. Workaround is: create your simple relations, upload them, and then create your combined relations.
File:
1 edited

Legend:

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

    r582 r586  
    55
    66import java.awt.BorderLayout;
     7import java.awt.FlowLayout;
     8import java.awt.GridBagLayout;
    79import java.awt.GridLayout;
    810import java.awt.event.ActionEvent;
     
    2830import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2931import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
     32import org.openstreetmap.josm.tools.GBC;
    3033import org.openstreetmap.josm.tools.ImageProvider;
    3134
     
    6770                add(new JScrollPane(displaylist), BorderLayout.CENTER);
    6871
    69                 JPanel buttonPanel = new JPanel(new GridLayout(1,3));
    70 
    71                 buttonPanel.add(createButton(marktr("Add Relation"), "addrelation", tr("Create a new relation"), -1, new ActionListener() {
     72                JPanel buttonPanel = new JPanel(new GridBagLayout());
     73               
     74                buttonPanel.add(createButton(marktr("New"), "addrelation", tr("Create a new relation"), -1, new ActionListener() {
    7275                        public void actionPerformed(ActionEvent e) {
    7376                                // call relation editor with null argument to create new relation
    7477                                new RelationEditor(null).setVisible(true);
    7578                        }
    76                 }));
     79                }), GBC.std());
     80               
     81                buttonPanel.add(createButton(marktr("Select"), "select", tr("Select this relation"), -1, new ActionListener() {
     82                        public void actionPerformed(ActionEvent e) {
     83                                // replace selection with the relation from the list
     84                                Main.ds.setSelected((Relation)displaylist.getSelectedValue());
     85                        }
     86                }), GBC.std());
    7787               
    7888                buttonPanel.add(createButton(marktr("Edit"), "edit", tr( "Open an editor for the selected relation"), -1, new ActionListener() {
     
    8292                                        new RelationEditor(toEdit).setVisible(true);                           
    8393                        }
    84                 }));
     94                }), GBC.std());
    8595               
    86                 buttonPanel.add(createButton(marktr("Delete"), "delete", tr("Delete the selected relation"), -1, new ActionListener() {
     96                buttonPanel.add(createButton("", "delete", tr("Delete the selected relation"), -1, new ActionListener() {
    8797                        public void actionPerformed(ActionEvent e) {
    8898                                Relation toDelete = (Relation) displaylist.getSelectedValue();
     
    92102                                }
    93103                        }
    94                 }));
     104                }), GBC.eol());
    95105                Layer.listeners.add(this);
    96106                add(buttonPanel, BorderLayout.SOUTH);
Note: See TracChangeset for help on using the changeset viewer.