Ignore:
Timestamp:
2023-11-07T14:21:38+01:00 (11 months ago)
Author:
taylor.smock
Message:

Fix #23057: data layers should be selected next, not non-data layers (patch by gaben, modified)

Modifications are as follows:

  • Fix test pollution uncovered by change in non-obvious determinate order of tests
  • Fix code so that MainLayerManagerTest.testRemoveLayerUnsetsActiveLayer passes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/Layer.java

    r17626 r18895  
    3636/**
    3737 * A layer encapsulates the gui component of one dataset and its representation.
    38  *
     38 * <p>
    3939 * Some layers may display data directly imported from OSM server. Other only
    4040 * display background images. Some can be edited, some not. Some are static and
    4141 * other changes dynamically (auto-updated).
    42  *
     42 * <p>
    4343 * Layers can be visible or not. Most actions the user can do applies only on
    4444 * selected layers. The available actions depend on the selected layers too.
    45  *
     45 * <p>
    4646 * All layers are managed by the MapView. They are displayed in a list to the
    4747 * right of the screen.
     
    175175    /**
    176176     * Initialization code, that depends on Main.map.mapView.
    177      *
     177     * <p>
    178178     * It is always called in the event dispatching thread.
    179179     * Note that Main.map is null as long as no layer has been added, so do
    180180     * not execute code in the constructor, that assumes Main.map.mapView is
    181181     * not null.
    182      *
     182     * <p>
    183183     * If you need to execute code when this layer is added to the map view, use
    184184     * {@link #attachToMapView(org.openstreetmap.josm.gui.layer.MapViewPaintable.MapViewEvent)}
     
    270270     * menu component than JMenuItem or when it supports multiple layers. Actions that support multiple layers should also
    271271     * have correct equals implementation.
    272      *
     272     * <p>
    273273     * Use {@link SeparatorLayerAction#INSTANCE} instead of new JSeparator
    274274     * @return menu actions for this layer
     
    278278    /**
    279279     * Called, when the layer is removed from the mapview and is going to be destroyed.
    280      *
    281      * This is because the Layer constructor can not add itself safely as listener
     280     * <p>
     281     * This is because the Layer constructor cannot add itself safely as a listener
    282282     * to the layerlist dialog, because there may be no such dialog yet (loaded
    283283     * via command line parameter).
     
    303303    /**
    304304     * Sets the associated file for this layer.
    305      *
     305     * <p>
    306306     * The associated file might be the one that the user opened.
    307307     * @param file The file, may be <code>null</code>
     
    354354
    355355    /**
    356      * Replies true if this layer was renamed by user
    357      *
    358      * @return true if this layer was renamed by user
     356     * Replies true if user renamed this layer
     357     *
     358     * @return true if user renamed this layer
    359359     */
    360360    public boolean isRenamed() {
     
    484484
    485485    /**
    486      * fires a property change for the property {@link #FILTER_STATE_PROP}.
     486     * Fires a property change for the property {@link #FILTER_STATE_PROP}.
    487487     */
    488488    protected void fireFilterStateChanged() {
     
    491491
    492492    /**
    493      * allows to check whether a projection is supported or not
     493     * Allows to check whether a projection is supported or not.
    494494     * @param proj projection
    495      *
    496495     * @return True if projection is supported for this layer
    497496     */
     
    610609
    611610    /**
    612      * Replies the savable state of this layer (i.e if it can be saved through a "File-&gt;Save" dialog).
     611     * Replies the savable state of this layer (i.e., if it can be saved through a "File-&gt;Save" dialog).
    613612     * @return true if this layer can be saved to a file
    614613     * @since 5459
     
    628627
    629628    /**
    630      * Creates a new "Save" dialog for this layer and makes it visible.<br>
    631      * When the user has chosen a file, checks the file extension, and confirms overwrite if needed.
     629     * Creates a new "Save" dialog for this layer and makes it visible.
     630     * <p>
     631     * When the user has chosen a file, checks the file extension, and confirms overwriting if needed.
    632632     * @return The output {@code File}
    633633     * @see SaveActionBase#createAndOpenSaveFileChooser
     
    675675    @Override
    676676    public String toString() {
    677         return getClass().getSimpleName() + " [name=" + name + ", associatedFile=" + associatedFile + ']';
     677        return getClass().getSimpleName() + " [name=" + name + ", associatedFile=" + associatedFile + ", visible=" + visible + ']';
    678678    }
    679679}
Note: See TracChangeset for help on using the changeset viewer.