Changeset 10279 in josm
- Timestamp:
- 2016-05-25T08:52:14+02:00 (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r10271 r10279 92 92 import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer; 93 93 import org.openstreetmap.josm.gui.layer.Layer; 94 import org.openstreetmap.josm.gui.layer. LayerManagerWithActive;94 import org.openstreetmap.josm.gui.layer.MainLayerManager; 95 95 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 96 96 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener; … … 199 199 * @since 10271 200 200 */ 201 private static final LayerManagerWithActive layerManager = new LayerManagerWithActive();201 private static final MainLayerManager layerManager = new MainLayerManager(); 202 202 203 203 /** … … 740 740 * Returns the main layer manager that is used by the map view. 741 741 * @return The layer manager. The value returned will never change. 742 * @since 1027 1743 */ 744 public static LayerManagerWithActivegetLayerManager() {742 * @since 10279 743 */ 744 public static MainLayerManager getLayerManager() { 745 745 return layerManager; 746 746 } -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r10277 r10279 61 61 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent; 62 62 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent; 63 import org.openstreetmap.josm.gui.layer. LayerManagerWithActive;64 import org.openstreetmap.josm.gui.layer. LayerManagerWithActive.ActiveLayerChangeEvent;65 import org.openstreetmap.josm.gui.layer. LayerManagerWithActive.ActiveLayerChangeListener;63 import org.openstreetmap.josm.gui.layer.MainLayerManager; 64 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 65 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 66 66 import org.openstreetmap.josm.gui.layer.MapViewPaintable; 67 67 import org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationEvent; … … 91 91 public class MapView extends NavigatableComponent 92 92 implements PropertyChangeListener, PreferenceChangedListener, OsmDataLayer.LayerStateChangeListener, 93 LayerManager.LayerChangeListener, LayerManagerWithActive.ActiveLayerChangeListener {93 LayerManager.LayerChangeListener, MainLayerManager.ActiveLayerChangeListener { 94 94 /** 95 95 * Interface to notify listeners of a layer change. … … 265 265 * This class is an adapter for the old layer change interface. 266 266 * <p> 267 * New implementations should use {@link org.openstreetmap.josm.gui.layer. LayerManagerWithActive.ActiveLayerChangeListener}267 * New implementations should use {@link org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener} 268 268 * @author Michael Zangl 269 269 * @since 10271 … … 438 438 * A list of all layers currently loaded. If we support multiple map views, this list may be different for each of them. 439 439 */ 440 private final LayerManagerWithActivelayerManager;440 private final MainLayerManager layerManager; 441 441 442 442 /** … … 479 479 * @param viewportData the initial viewport of the map. Can be null, then 480 480 * the viewport is derived from the layer data. 481 */ 482 public MapView(LayerManagerWithActive layerManager, final JPanel contentPane, final ViewportData viewportData) { 481 * @since 10279 482 */ 483 public MapView(MainLayerManager layerManager, final JPanel contentPane, final ViewportData viewportData) { 483 484 this.layerManager = layerManager; 484 485 initialViewport = viewportData; … … 632 633 * 633 634 * @return the next active data layer 634 * @deprecated now handled by {@link LayerManagerWithActive}635 * @deprecated now handled by {@link MainLayerManager} 635 636 */ 636 637 @Deprecated -
trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java
r10277 r10279 17 17 * The edit layer is an data layer that we currently work with. 18 18 * @author Michael Zangl 19 * @since 1027 119 * @since 10279 20 20 */ 21 public class LayerManagerWithActiveextends LayerManager {21 public class MainLayerManager extends LayerManager { 22 22 /** 23 23 * This listener listens to changes of the active or the edit layer. … … 53 53 * @param previousActiveLayer the previous active layer 54 54 */ 55 ActiveLayerChangeEvent( LayerManagerWithActivesource, OsmDataLayer previousEditLayer,55 ActiveLayerChangeEvent(MainLayerManager source, OsmDataLayer previousEditLayer, 56 56 Layer previousActiveLayer) { 57 57 super(source); … … 77 77 78 78 @Override 79 public LayerManagerWithActivegetSource() {80 return ( LayerManagerWithActive) super.getSource();79 public MainLayerManager getSource() { 80 return (MainLayerManager) super.getSource(); 81 81 } 82 82 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java
r10278 r10279 13 13 import org.openstreetmap.josm.JOSMFixture; 14 14 import org.openstreetmap.josm.data.osm.DataSet; 15 import org.openstreetmap.josm.gui.layer. LayerManagerWithActive.ActiveLayerChangeEvent;16 import org.openstreetmap.josm.gui.layer. LayerManagerWithActive.ActiveLayerChangeListener;15 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 16 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 17 17 import org.openstreetmap.josm.gui.util.GuiHelper; 18 18 import org.openstreetmap.josm.tools.Predicates; 19 19 20 20 /** 21 * Tests {@link LayerManagerWithActive}21 * Tests {@link MainLayerManager}. 22 22 * @author Michael Zangl 23 *24 23 */ 25 public class LayerManagerWithActiveTest extends LayerManagerTest {26 27 private LayerManagerWithActivelayerManagerWithActive;24 public class MainLayerManagerTest extends LayerManagerTest { 25 26 private MainLayerManager layerManagerWithActive; 28 27 29 28 private class CapturingActiveLayerChangeListener implements ActiveLayerChangeListener { … … 64 63 @Before 65 64 public void setUp() { 66 layerManager = layerManagerWithActive = new LayerManagerWithActive();65 layerManager = layerManagerWithActive = new MainLayerManager(); 67 66 } 68 67 … … 137 136 138 137 /** 139 * Test if {@link LayerManagerWithActive#addActiveLayerChangeListener(ActiveLayerChangeListener)} prevents listener from beeing added twice.138 * Test if {@link MainLayerManager#addActiveLayerChangeListener(ActiveLayerChangeListener)} prevents listener from beeing added twice. 140 139 */ 141 140 @Test(expected = IllegalArgumentException.class) … … 147 146 148 147 /** 149 * Test if {@link LayerManagerWithActive#removeActiveLayerChangeListener(ActiveLayerChangeListener)} works.148 * Test if {@link MainLayerManager#removeActiveLayerChangeListener(ActiveLayerChangeListener)} works. 150 149 */ 151 150 @Test … … 165 164 166 165 /** 167 * Test if {@link LayerManagerWithActive#removeActiveLayerChangeListener(ActiveLayerChangeListener)} checks if listener is in list.166 * Test if {@link MainLayerManager#removeActiveLayerChangeListener(ActiveLayerChangeListener)} checks if listener is in list. 168 167 */ 169 168 @Test(expected = IllegalArgumentException.class) … … 173 172 174 173 /** 175 * Tests {@link LayerManagerWithActive#setActiveLayer(Layer)} and {@link LayerManagerWithActive#getActiveLayer()}.174 * Tests {@link MainLayerManager#setActiveLayer(Layer)} and {@link MainLayerManager#getActiveLayer()}. 176 175 * <p> 177 176 * Edit and active layer getters are also tested in {@link #testAddLayerSetsActiveLayer()} … … 192 191 193 192 /** 194 * Tests {@link LayerManagerWithActive#getEditDataSet()}193 * Tests {@link MainLayerManager#getEditDataSet()} 195 194 */ 196 195 @Test … … 214 213 215 214 /** 216 * Tests {@link LayerManagerWithActive#getVisibleLayersInZOrder()}215 * Tests {@link MainLayerManager#getVisibleLayersInZOrder()} 217 216 */ 218 217 @Test
Note:
See TracChangeset
for help on using the changeset viewer.