Changeset 32067 in osm
- Timestamp:
- 2016-02-13T19:35:29+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
r32064 r32067 11 11 import org.openstreetmap.josm.Main; 12 12 import org.openstreetmap.josm.data.Bounds; 13 import org.openstreetmap.josm.data.coor.LatLon;14 13 import org.openstreetmap.josm.plugins.mapillary.cache.CacheUtils; 15 14 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog; 16 import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;17 15 18 16 /** -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java
r32064 r32067 6 6 7 7 import org.openstreetmap.josm.data.coor.LatLon; 8 import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;9 8 import org.openstreetmap.josm.plugins.mapillary.utils.ValidationUtil; 10 9 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryTrafficSignLayer.java
r32066 r32067 9 9 import java.awt.Point; 10 10 import java.awt.RenderingHints; 11 import java.io.File;12 11 import java.io.IOException; 13 12 … … 26 25 27 26 public final class MapillaryTrafficSignLayer extends AbstractModifiableLayer { 28 private static final String TRAFFICO_PATH = " data/fonts/traffico/traffico.ttf";27 private static final String TRAFFICO_PATH = "/data/fonts/traffico/traffico.ttf"; 29 28 private static MapillaryTrafficSignLayer instance; 30 29 private final Font traffico; … … 33 32 super("Mapillary traffic signs"); 34 33 try { 35 traffico = Font.createFont(Font.TRUETYPE_FONT, new File("data/fonts/traffico/traffico.ttf")).deriveFont(50.0f); 34 traffico = Font.createFont( 35 Font.TRUETYPE_FONT, 36 MapillaryTrafficSignLayer.class.getResourceAsStream(TRAFFICO_PATH) 37 ).deriveFont(50.0f); 36 38 } catch (FontFormatException e) { 37 throw new IOException(I18n.tr("Traffic sign font at ''{0}'' has wrong format .", TRAFFICO_PATH), e);39 throw new IOException(I18n.tr("Traffic sign font at ''{0}'' has wrong format", TRAFFICO_PATH), e); 38 40 } catch (IOException e) { 39 throw new IOException(I18n.tr("Could not read font-file from ''{0}'' .", TRAFFICO_PATH), e);41 throw new IOException(I18n.tr("Could not read font-file from ''{0}''", TRAFFICO_PATH), e); 40 42 } 41 43 } … … 49 51 */ 50 52 public static synchronized MapillaryTrafficSignLayer getInstance() throws IOException { 51 if (instance == null) 53 if (instance == null) { 52 54 instance = new MapillaryTrafficSignLayer(); 55 } 53 56 return instance; 54 57 } … … 81 84 82 85 TrafficoSign[] signs = { 83 TrafficoSign.getSign(" europe", "mandatory_cycle_track"),84 TrafficoSign.getSign("de", " information_bus_stop"),85 TrafficoSign.getSign(" europe", "information_pedestrian_crossing") };86 TrafficoSign.getSign("de", "bicycles-only"), 87 TrafficoSign.getSign("de", "bus-stop"), 88 TrafficoSign.getSign("de", "pedestrian-crossing") }; 86 89 87 90 for (int i = 0; i < signs.length && i < points.length; i++) { -
applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/TestUtil.java
r31820 r32067 3 3 import static org.junit.Assert.assertEquals; 4 4 import static org.junit.Assert.assertTrue; 5 import static org.junit.Assert.fail; 5 6 6 7 import java.lang.reflect.Constructor; 8 import java.lang.reflect.InvocationTargetException; 7 9 import java.lang.reflect.Method; 8 10 import java.lang.reflect.Modifier; … … 20 22 * @author floscher 21 23 */ 22 public class TestUtil {24 public final class TestUtil { 23 25 private static boolean isInitialized; 24 26 … … 33 35 * That is needed e.g. to use {@link MapillaryLayer#getInstance()} 34 36 */ 35 public static final void initPlugin() {37 public static final synchronized void initPlugin() { 36 38 if (!isInitialized) { 37 39 System.setProperty("josm.home", "test/data/preferences"); … … 73 75 assertTrue(m.getDeclaringClass() != c || Modifier.isStatic(m.getModifiers())); 74 76 } 75 } catch ( Exception e) {76 assertTrue(e.getMessage(), false);77 } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { 78 fail(e.getLocalizedMessage()); 77 79 } 78 80 }
Note:
See TracChangeset
for help on using the changeset viewer.