Changeset 1801 in josm


Ignore:
Timestamp:
2009-07-17T20:31:25+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #2980: selected objects not in relation editor

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

Legend:

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

    r1798 r1801  
    347347        gc.fill = GridBagConstraints.BOTH;
    348348        gc.anchor = GridBagConstraints.CENTER;
    349         gc.weightx = 0.8;
     349        gc.weightx = 0.6;
    350350        gc.weighty = 1.0;
    351351        pnl.add(scrollPane, gc);
     
    359359        gc.gridx = 3;
    360360        gc.gridy = 1;
    361         gc.weightx = 0.2;
     361        gc.weightx = 0.4;
    362362        gc.weighty = 1.0;
    363363        pnl.add(buildSelectionTablePanel(), gc);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java

    r1790 r1801  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.dialogs.relation;
    3 
     3import static org.openstreetmap.josm.tools.I18n.tr;
    44import java.util.ArrayList;
    55import java.util.Collection;
     
    2222    private ArrayList<OsmPrimitive> cache;
    2323
    24     public SelectionTableModel(OsmDataLayer layer) {
     24    /**
     25     * constructor
     26     *
     27     * @param layer  the data layer. Must not be null.
     28     * @exception IllegalArgumentException thrown if layer is null
     29     */
     30    public SelectionTableModel(OsmDataLayer layer) throws IllegalArgumentException {
     31        if (layer == null)
     32            throw new IllegalArgumentException(tr("parameter ''{0}'' must not be null", "layer"));
    2533        this.layer = layer;
    2634        cache = new ArrayList<OsmPrimitive>();
    2735        DataSet.selListeners.add(this);
    2836        Layer.listeners.add(this);
     37        populateSelectedPrimitives(layer);
    2938    }
    3039
     
    8493        return cache;
    8594    }
     95
     96    /**
     97     * populates the model with the primitives currently selected in
     98     * <code>layer</code>
     99     *
     100     * @param layer  the data layer
     101     */
     102    protected void populateSelectedPrimitives(OsmDataLayer layer) {
     103        selectionChanged(layer.data.getSelected());
     104    }
    86105}
Note: See TracChangeset for help on using the changeset viewer.