Changeset 31989 in osm for applications/editors
- Timestamp:
- 2016-01-16T17:47:43+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
r31987 r31989 76 76 * @param image The image to be added. 77 77 * @param update Whether the map must be updated or not. 78 * @throws NullPointerException if parameter <code>image</code> is <code>null</code> 78 79 */ 79 80 public synchronized void add(MapillaryAbstractImage image, boolean update) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r31985 r31989 246 246 img.setVisible(visible); 247 247 } 248 MapillaryFilterDialog.getInstance().refresh(); 248 if (Main.map != null) { 249 MapillaryFilterDialog.getInstance().refresh(); 250 } 249 251 } 250 252 -
applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/MapillaryLayerTest.java
r31797 r31989 3 3 import static org.junit.Assert.assertEquals; 4 4 import static org.junit.Assert.assertFalse; 5 import static org.junit.Assert.assertTrue; 6 7 import java.io.File; 5 8 6 9 import org.junit.Test; … … 26 29 MapillaryLayer.getInstance().mergeFrom(dummyLayer); 27 30 } 31 32 @Test 33 public void testSetVisible() { 34 MapillaryLayer.getInstance().getData().add(new MapillaryImportedImage(0.0, 0.0, 0.0, new File(""))); 35 MapillaryLayer.getInstance().getData().add(new MapillaryImportedImage(0.0, 0.0, 0.0, new File(""))); 36 MapillaryImportedImage invisibleImage = new MapillaryImportedImage(0.0, 0.0, 0.0, new File("")); 37 invisibleImage.setVisible(false); 38 MapillaryLayer.getInstance().getData().add(invisibleImage); 39 40 MapillaryLayer.getInstance().setVisible(false); 41 for (MapillaryAbstractImage img : MapillaryLayer.getInstance().getData().getImages()) { 42 assertEquals(false, img.isVisible()); 43 } 44 45 46 MapillaryLayer.getInstance().setVisible(true); 47 for (MapillaryAbstractImage img : MapillaryLayer.getInstance().getData().getImages()) { 48 assertEquals(true, img.isVisible()); 49 } 50 } 51 52 @Test 53 public void testGetInfoComponent() { 54 Object comp = MapillaryLayer.getInstance().getInfoComponent(); 55 assertTrue(comp instanceof String); 56 assertTrue(((String)comp).length() >= 9); 57 } 58 59 @Test 60 public void testClearInstance() { 61 MapillaryLayer.getInstance(); 62 assertTrue(MapillaryLayer.hasInstance()); 63 MapillaryLayer.clearInstance(); 64 assertFalse(MapillaryLayer.hasInstance()); 65 MapillaryLayer.getInstance(); 66 assertTrue(MapillaryLayer.hasInstance()); 67 } 28 68 }
Note:
See TracChangeset
for help on using the changeset viewer.