Search in sources :

Example 1 with TypPolygon

use of uk.me.parabola.imgfmt.app.typ.TypPolygon in project mkgmap by openstreetmap.

the class TypTextReaderTest method testPolygon.

@Test
public void testPolygon() {
    tr = makeTyp("[_polygon]\n" + "Type=0x2\n" + "String1=0x04,Parking\n" + "String2=0x03,Parkeergarage\n" + "Xpm=\"0 0 2 0\"\n" + "\"1 c #7BCAD5\"\n" + "\"2 c #00008B\"\n" + "[End]\n");
    TypData data = tr.getData();
    List<TypPolygon> polygons = data.getPolygons();
    TypPolygon p = polygons.get(0);
    assertEquals(2, p.getType());
}
Also used : TypPolygon(uk.me.parabola.imgfmt.app.typ.TypPolygon) TypData(uk.me.parabola.imgfmt.app.typ.TypData) Test(org.junit.Test)

Example 2 with TypPolygon

use of uk.me.parabola.imgfmt.app.typ.TypPolygon in project mkgmap by openstreetmap.

the class TypTextReaderTest method testPolygonWithBitmap.

@Test
public void testPolygonWithBitmap() {
    tr = makeTyp("[_polygon]\n" + "Xpm=\"32 32 4 1\"\n" + "\"! c #FFCC99\"\n" + "\"  c none\"\n" + "\"3 c #000000\"\n" + "\"4 c none\"\n" + "\"!     !!!     !!!     !!!     !!\"\n" + "\"     !!!     !!!     !!!     !!!\"\n" + "\"    !!!     !!!     !!!     !!! \"\n" + "\"   !!!     !!!     !!!     !!!  \"\n" + "\"  !!!     !!!     !!!     !!!   \"\n" + "\" !!!     !!!     !!!     !!!    \"\n" + "\"!!!     !!!     !!!     !!!     \"\n" + "\"!!      !!      !!      !!      \"\n" + "\"!     !!!     !!!     !!!     !!\"\n" + "\"     !!!     !!!     !!!     !!!\"\n" + "\"    !!!     !!!     !!!     !!! \"\n" + "\"   !!!     !!!     !!!     !!!  \"\n" + "\"  !!!     !!!     !!!     !!!   \"\n" + "\" !!!     !!!     !!!     !!!    \"\n" + "\"!!!     !!!     !!!     !!!     \"\n" + "\"!!      !!      !!      !!      \"\n" + "\"!     !!!     !!!     !!!     !!\"\n" + "\"     !!!     !!!     !!!     !!!\"\n" + "\"    !!!     !!!     !!!     !!! \"\n" + "\"   !!!     !!!     !!!     !!!  \"\n" + "\"  !!!     !!!     !!!     !!!   \"\n" + "\" !!!     !!!     !!!     !!!    \"\n" + "\"!!!     !!!     !!!     !!!     \"\n" + "\"!!      !!      !!      !!      \"\n" + "\"!     !!!     !!!     !!!     !!\"\n" + "\"     !!!     !!!     !!!     !!!\"\n" + "\"    !!!     !!!     !!!     !!! \"\n" + "\"   !!!     !!!     !!!     !!!  \"\n" + "\"  !!!     !!!     !!!     !!!   \"\n" + "\" !!!     !!!     !!!     !!!    \"\n" + "\"!!!     !!!     !!!     !!!     \"\n" + "\"!!      !!      !!      !!      \"\n" + "[End]\n");
    TypData data = tr.getData();
    List<TypPolygon> polygons = data.getPolygons();
    TypPolygon p = polygons.get(0);
    ArrayImgWriter out = new ArrayImgWriter();
    p.write(out, data.getEncoder());
    byte[] bytes = out.getBytes();
    assertEquals(135, bytes.length);
}
Also used : TypPolygon(uk.me.parabola.imgfmt.app.typ.TypPolygon) TypData(uk.me.parabola.imgfmt.app.typ.TypData) ArrayImgWriter(func.lib.ArrayImgWriter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 TypData (uk.me.parabola.imgfmt.app.typ.TypData)2 TypPolygon (uk.me.parabola.imgfmt.app.typ.TypPolygon)2 ArrayImgWriter (func.lib.ArrayImgWriter)1