Changeset 29921 in osm for applications/editors/josm/plugins/ElevationProfile/test
- Timestamp:
- 2013-09-08T19:49:30+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ElevationProfile/test/org/openstreetmap/josm/plugins/elevation/tests/EleVertexTest.java
r29907 r29921 1 1 package org.openstreetmap.josm.plugins.elevation.tests; 2 2 3 import java.awt.Color; 3 4 import java.util.List; 4 5 … … 9 10 import org.openstreetmap.josm.data.Preferences; 10 11 import org.openstreetmap.josm.data.coor.LatLon; 12 import org.openstreetmap.josm.plugins.elevation.ColorMap; 11 13 import org.openstreetmap.josm.plugins.elevation.EleCoordinate; 12 14 import org.openstreetmap.josm.plugins.elevation.EleVertex; 13 import org.openstreetmap.josm.plugins.elevation. ElevationRenderer;15 import org.openstreetmap.josm.plugins.elevation.GridRenderer; 14 16 15 17 public class EleVertexTest extends TestCase { … … 80 82 // Staufenberg, Hessen 81 83 // Ulrichstein, Hessen 82 ElevationRenderer er = new ElevationRenderer("Ele", new Bounds(84 GridRenderer er = new GridRenderer("Ele", new Bounds( 83 85 new LatLon(50.6607106, 8.7337029), 84 86 new LatLon(50.5767627, 9.1938483)), null); 85 87 86 88 er.run(); 89 } 90 91 public void testColorMap() { 92 ColorMap testMap = ColorMap.create("Test", new Color[]{Color.white, Color.black}, new int[]{0, 1000}); 93 94 // range test 95 Color c1 = testMap.getColor(-100); 96 assertEquals(Color.white, c1); 97 // range test 98 Color c2 = testMap.getColor(1100); 99 assertEquals(Color.black, c2); 100 // test mid (RGB 128, 128, 128) 101 Color c3 = testMap.getColor(500); 102 assertEquals(Color.gray, c3); 103 104 // test 0.75 (RGB 192 x 3) 105 Color c4 = testMap.getColor(751); 106 assertEquals(Color.lightGray, c4); 107 // test 0.25 (RGB 64 x 3) 108 Color c5 = testMap.getColor(251); 109 assertEquals(Color.darkGray, c5); 87 110 } 88 111
Note:
See TracChangeset
for help on using the changeset viewer.