Package org.kite9.diagram.adl

Examples of org.kite9.diagram.adl.Glyph


  @Kite9Item
  public Diagram simpleDiagramWithKeyHelper() {
    KeyHelper kh = new KeyHelper();
    Symbol s = kh.createSymbol("Brother of Tony Scott");
   
    Glyph hf = new Glyph("Actor","Harrison Ford", null, null);
    Glyph rs = new Glyph("Director", "Ridley Scott", null,
        createList(s));
    Diagram d1 = new Diagram("my_diagram", listOf(hf, rs),
        new Key("Big Movies", "", kh.getUsedSymbols()));
    return d1;
  }
View Full Code Here


public class SimpleDiagramWithContexts {

  @Kite9Item
  public Diagram contextExample() {
      Glyph hf = new Glyph("harrison_ford","Actor","Harrison Ford", null, null);
      Glyph rs = new Glyph("ridley_scott", "Director", "Ridley Scott", null, null);
      Arrow ww = new Arrow("worked_with", "worked with");
     
      new Link(ww, hf, null, null, null, null, Direction.RIGHT);
      new Link(ww, rs);
View Full Code Here

 
  @Kite9Item
  public Diagram contextDirectionExamples() {
    Glyph[] g = new Glyph[9];
    for (int i = 0; i < g.length; i++) {
      g[i] = new Glyph(""+i, null, ""+i, null, null);
    }
 
    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);
View Full Code Here

 
  @Kite9Item
  public Diagram contextDirection2() throws IOException {
    Glyph[] g = new Glyph[8];
    for (int i = 0; i < g.length; i++) {
      g[i] = new Glyph(""+i, null, ""+i, null, null);
    }
 
    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);
   
View Full Code Here

    return d1;
  }
 
  @Kite9Item
  public Diagram hiddenContext() throws IOException {
      Glyph rs = new Glyph("ridley_scott", "Director", "Ridley Scott", null, null);
      Arrow directed = new Arrow("directed");
     
      new Link(directed, rs);

      Glyph bladerunner = new Glyph("film", "Bladerunner", null, null);
      Glyph glad = new Glyph("film", "Gladiator", null, null);
      Glyph thelma = new Glyph("film", "Thelma & Louise", null, null);

      new Link(directed, bladerunner, null, null, LinkEndStyle.ARROW, null);
      new Link(directed, glad, null, null, LinkEndStyle.ARROW, null);
      new Link(directed, thelma, null, null, LinkEndStyle.ARROW, null);
View Full Code Here

        firstXml, secondXML);

  }

  public static Diagram createDiagram(KeyHelper kh) {
    Glyph g1 = new Glyph("class", "Test Class", createList(new TextLine(
        "Here is a line of text", createList(kh.createSymbol(
            "Baphomet", "B")))), createList(kh.createSymbol(
        "Public", "P")));

    Arrow a1 = new Arrow("leaver");

    // adding problem with references.
    Glyph g2 = new Glyph("ref1", "", "Some Item A", null, null);
    Glyph g3 = new Glyph("ref1", "", "Some Item B", null, null);

    Context inside = new Context(createList((Contained) g1, g2, g3), true,
        null, null);

    new Link(a1, g1, null, null, LinkEndStyle.ARROW, new TextLine(
View Full Code Here

           "<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

    top.add(a);
  }

  @Kite9Item
  public Diagram example_1_1_ClassHierarchy() throws IOException {
    Glyph collection = new Glyph("C", "interface", "Collection", null, null);
    Context c1 = new Context("C1", HelpMethods.listOf(collection), false, null, null);

    Glyph list = new Glyph("L", "interface", "List", null, null);
    Glyph set = new Glyph("S", "interface", "Set", null, null);

    Context c2 = new Context("C2", HelpMethods.listOf(set, list), false, null, Layout.RIGHT);

    Glyph hs = new Glyph("HS", "class", "HashSet", null, null);
    Glyph ts = new Glyph("TS", "class", "TreeSet", null, null);
    Glyph lhs = new Glyph("LHS", "class", "LinkedHashSet", null, null);
    Glyph al = new Glyph("AL", "class", "ArrayList", null, null);
    Glyph ll = new Glyph("LL", "class", "LinkedList", null, null);

    Context c3 = new Context("C3", HelpMethods.listOf(hs, ts, lhs, al, ll), false, null, Layout.RIGHT);

    List<Contained> c2Links = new ArrayList<Contained>(3);
    List<Contained> c3Links = new ArrayList<Contained>(6);
View Full Code Here

    @Kite9Item
    @Test
    public void test_13_1_AugmentGlyph() throws IOException {
  DiagramBuilder db = createBuilder();
  db.withClasses(SomeClass.class).show(db.asConnectedGlyphs());
  Glyph g = (Glyph) db.getNounElement(SomeClass.class);
  g.getText().add(new TextLine("This is a favourite of John's"));
  renderDiagram(db.getDiagram());
    }
View Full Code Here

    .show(db.asConnectedGlyphs())
    .withInterfaces(null, false)
    .show(db.asConnectedGlyphs());
 
  Arrow a = (Arrow) db.getRelationshipElement(SomeClass.class, JavaRelationships.IMPLEMENTS);
  Glyph sc = (Glyph) db.getNounElement(SomeClass.class);
  Glyph si = (Glyph) db.getNounElement(SomeInterface.class);
 
  Link top = (Link) a.getConnectionTo(si);
  Link bottom = (Link) a.getConnectionTo(sc);
 
  top.setDrawDirection(Direction.RIGHT);
View Full Code Here

TOP

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

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.