Package org.kite9.diagram.adl

Examples of org.kite9.diagram.adl.Diagram


 
    Context leftToRight = new Context(listOf(g[0], g[1], g[2]), true, new TextLine("Left to Right"), Layout.RIGHT);
    Context bottomToTop = new Context(listOf(g[3], g[4], g[5]), true, new TextLine("Bottom to Top"), Layout.UP);
    Context topToBottom = new Context(listOf(g[6], g[7], g[8]), true, new TextLine("Top to Bottom"), Layout.DOWN);
   
    Diagram d1 = new Diagram("my_diagram", listOf(leftToRight, bottomToTop, topToBottom), null);
   
    return d1;
   
  }
View Full Code Here


    Context hor = new Context(listOf(g[0], g[1], g[2], g[3]), true, new TextLine("Horizontal"), Layout.HORIZONTAL);
    Context vert = new Context(listOf(g[4], g[5], g[6], g[7]), true, new TextLine("Vertical"), Layout.VERTICAL);
   
    new Link(g[2], g[5]);
   
    Diagram d1 = new Diagram("my_diagram", listOf(hor, vert), null);
   
    return d1;
  }
View Full Code Here

      new Link(directed, glad, null, null, LinkEndStyle.ARROW, null);
      new Link(directed, thelma, null, null, LinkEndStyle.ARROW, null);

      Context hidden = new Context(listOf(bladerunner, glad, thelma), false, null, Layout.HORIZONTAL);
     
      Diagram d1 = new Diagram("my_diagram", listOf(rs, directed, hidden), null);
      return d1;
  }
View Full Code Here

  @Test
  public void quickSerializeTest() {
    KeyHelper kh = new KeyHelper();

    Diagram d1 = createDiagram(kh);

    XMLHelper helper = new XMLHelper();

    String firstXml = helper.toXML(d1);

    System.out.println(firstXml);

    Diagram d2 = (Diagram) helper.fromXML(firstXml);

    String secondXML = helper.toXML(d2);
    System.out.println(secondXML);

    Assert.assertEquals(firstXml + "\n is not same as \n" + secondXML,
View Full Code Here

    new Link(a1, g1, null, null, LinkEndStyle.ARROW, new TextLine(
        "Some Label"), Direction.RIGHT);
    new Link(a1, g2);
    new Link(a1, g3);

    Diagram d1 = new Diagram("My Diagram", createList((Contained) inside,
        (Contained) a1), new Key("Here is my amazing diagram", null,
        kh.getUsedSymbols()));
    return d1;
  }
View Full Code Here

public class Test3BrokenSerialization {

  @Test
  public void test_3_1_BrokenLinks() {
    XMLHelper help = new XMLHelper();
    Diagram d = (Diagram) help.fromXML(
        "<?xml version=\"1.0\" ?><diagram xmlns=\"http://www.kite9.org/schema/adl\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" id=\"p1\">"+
           "<glyph id=\"g1\" />" +
           "<allLinks>"+"<link id=\"5\">"+
           "<from xsi:type=\"glyph\" reference=\"bob\" />"+
           "<to xsi:type=\"context\" reference=\"g1\" />"+
           "</link></allLinks></diagram>");
         
    Assert.assertEquals(d.getContents().size(),1);
    Glyph g = (Glyph) d.getContents().get(0);
    Assert.assertEquals(0, g.getLinks().size());
  }
View Full Code Here

public class Test2SerializeWorkItems extends HelpMethods {

    @Test
  public void quickSerializeTest() {
    KeyHelper kh = new KeyHelper();
    Diagram d1 = Test1SerializeDiagram.createDiagram(kh);
    WorkItem w1 = new BasicWorkItem(d1, "hello", "diagram.png", -1, "x");
   
   
    XMLHelper helper = new XMLHelper();
   
View Full Code Here

    addLink(set, ts, "implements", c3Links);
    addLink(set, lhs, "implements", c3Links);
    addLink(list, al, "implements", c3Links);
    addLink(list, ll, "implements", c3Links);

    return new Diagram(top, null);
  }
View Full Code Here

      .withMethods(null, false).show(builder.asTextLines());
    // show references between the two
    uc.withReferencingAnnotatedElements(builder.only(Uses.class)).show(builder.asConnectedGlyphs(null,Direction.RIGHT));
   

    Diagram d = builder.getDiagram();
    d.setLayoutDirection(Layout.HORIZONTAL);
    return d;
  }
View Full Code Here

    addKey();
    return d;
  }

  private Diagram createRepresentation(String id) {
    return new Diagram(id, new ArrayList<Contained>(), null);
  }
View Full Code Here

TOP

Related Classes of org.kite9.diagram.adl.Diagram

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.