Examples of writeElement()


Examples of org.geomajas.rendering.GraphicsDocument.writeElement()

  @Test
  public void testSimple() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    document.writeElement("g", true);
    document.writeId("featureId");
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    document.closeElement();
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeElement()

  public void testSimple() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    document.writeElement("g", true);
    document.writeId("featureId");
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    document.closeElement();
    document.closeElement();
    Assert.assertEquals("<g id=\"featureId\"><g style=\"my-super-style:true;\" id=\"featureId.styleId\"/></g>", writer.getBuffer().toString());
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeElement()

  @Test
  public void testSimpleSvg() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer);
    document.writeElement("g", true);
    document.writeId("featureId");
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    document.closeElement();
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeElement()

  public void testSimpleSvg() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer);
    document.writeElement("g", true);
    document.writeId("featureId");
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    document.closeElement();
    document.closeElement();
    Assert.assertEquals("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:hlink=\"http://www.w3.org/1999/xlink\">" +
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeElement()

  @Test
  public void testSimpleFlush() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    document.writeElement("g", true);
    document.writeId("featureId");
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    Assert.assertEquals("featureId.styleId", document.getCurrentId());
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeElement()

  public void testSimpleFlush() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    document.writeElement("g", true);
    document.writeId("featureId");
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    Assert.assertEquals("featureId.styleId", document.getCurrentId());
    document.flush();
    Assert.assertEquals("<g id=\"featureId\"><g style=\"my-super-style:true;\" id=\"featureId.styleId\"/></g>", writer.getBuffer().toString());
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeElement()

  @Test
  public void testIds() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    document.setRootId("bla");
    document.writeElement("g", true);
    document.writeId("featureId");
    Assert.assertEquals("bla.featureId", document.getCurrentId());
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeElement()

    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    document.setRootId("bla");
    document.writeElement("g", true);
    document.writeId("featureId");
    Assert.assertEquals("bla.featureId", document.getCurrentId());
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    Assert.assertEquals("bla.featureId.styleId", document.getCurrentId());
    document.closeElement();
    document.closeElement();
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeElement()

  @Test
  public void writePathContent() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    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);
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeElement()

  @Test
  public void escapeAttribute() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    document.writeElement("x", true);
    document.writeAttribute("bla", "<stop&go>");
    document.closeElement();
    Assert.assertEquals("<x bla=\"&lt;stop&amp;go&gt;\"/>", writer.getBuffer().toString());
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.