Package org.geomajas.rendering

Examples of org.geomajas.rendering.GraphicsDocument


  }

  @Test
  public void testFormatter() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultVmlDocument(writer);
    DecimalFormat formatter = document.getFormatter();
    Assert.assertEquals("1", formatter.format(1.234));
    Assert.assertEquals("1", formatter.format(1.23456789));
    Assert.assertEquals("10", formatter.format(9.876));
    Assert.assertEquals("10", formatter.format(9.87654321));
    document.setMinimumFractionDigits(4);
    document.setMaximumFractionDigits(6);
    Assert.assertEquals("1.2340", formatter.format(1.234));
    Assert.assertEquals("1.234568", formatter.format(1.23456789));
    Assert.assertEquals("9.8760", formatter.format(9.876));
    Assert.assertEquals("9.876543", formatter.format(9.87654321));
  }
View Full Code Here


  }

  @Test
  public void writePathContent() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultVmlDocument(writer);
    document.writeElement("path", false);
    document.writeAttributeStart("points");
    Coordinate[] coordinates = new Coordinate[2];
    coordinates[0] = new Coordinate(1.23456789, 9.87654321);
    coordinates[1] = new Coordinate(9.876, 1.234);
    document.writePathContent(coordinates);
    document.writeAttributeEnd();
    document.closeElement();
    Assert.assertEquals("<path points=\"m1 10r9 -9 \"/>", writer.getBuffer().toString());
  }
View Full Code Here

TOP

Related Classes of org.geomajas.rendering.GraphicsDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.