Package org.kite9.diagram.builders.java

Examples of org.kite9.diagram.builders.java.ObjectBuilder


   
   
    @Test
    @Kite9Item
    public void test_9_1_GlyphAlias() throws IOException {
  DiagramBuilder db = createBuilder();
  db.withClasses(SomeClass.class).show(db.asConnectedGlyphs());
  renderDiagram(db.getDiagram());
    }
View Full Code Here


    }
   
    @Test
    @Kite9Item
    public void test_9_2_ContextAlias() throws IOException {
  DiagramBuilder db = createBuilder();
  db.withClasses(SomeClass.class).show(db.asConnectedContexts());
  renderDiagram(db.getDiagram());
    }
View Full Code Here

    }
   
    @Test
    @Kite9Item
    public void test_9_3_MethodTextLineAlias() throws IOException {
  DiagramBuilder db = createBuilder();
  db.withClasses(SomeClass.class)
    .show(db.asConnectedGlyphs())
    .withMethods(db.onlyAnnotated(), false).show(db.asTextLines());
  renderDiagram(db.getDiagram());
    }
View Full Code Here

   
    @Test
    @Kite9Item
    public void test_9_4_FieldTextLineAlias() throws IOException {
  DiagramBuilder db = createBuilder();
  db.withClasses(SomeClass.class)
    .show(db.asConnectedGlyphs())
    .withFields(db.onlyAnnotated(), false).show(db.asTextLines());
  renderDiagram(db.getDiagram());
    }
View Full Code Here

    }
   
    @Test
    @Kite9Item
    public void test_9_5_AnnotationGlyphs() throws IOException {
  DiagramBuilder db = createBuilder();
  db.withClasses(SomeClass.class)
    .show(db.asConnectedGlyphs())
    .withAnnotations(null).show(db.asTextLines());
  renderDiagram(db.getDiagram());
    }
View Full Code Here

    return new Diagram(top, null);
  }

  @Kite9Item
  public Diagram example_1_3_FlowChart(DiagramBuilder builder) throws IOException {
    ObjectBuilder checkLaundry = builder.withObjects("Check Laundry Basket").show(builder.asConnectedGlyphs("choice"));
    checkLaundry.withObjects(null, "Is it empty?").show(builder.asTextLines());
    checkLaundry.withObjects(new Relationship("yes", Direction.RIGHT), "All Done!").show(builder.asConnectedGlyphs());

    Relationship no1 = new Relationship("no", Direction.DOWN);
    ObjectBuilder loadLaundry = checkLaundry.withObjects(no1, "Load Laundry Into Machine").show(
        builder.asConnectedGlyphs("action"));
    loadLaundry.withObjects(null, "Ensure machine is empty first", "Add powder, close door", "Start programme")
        .show(builder.asTextLines());

    String finished = "Is Cycle Finished?";
    ObjectBuilder isFinished = loadLaundry.withObjects(new Relationship("wait"), finished).show(
        builder.asConnectedGlyphs("choice"));

    ObjectBuilder waiting = isFinished.withObjects(new Relationship("no"), "Have a Coffee")
        .show(builder.asConnectedGlyphs());

    waiting.withObjects(new Relationship("check again"), finished).show(builder.asConnectedGlyphs());

    Relationship yes = new Relationship("yes");
    ObjectBuilder sunny = isFinished.withObjects(yes, "Is it Sunny?").show(builder.asConnectedGlyphs("choice"));

    sunny.withObjects(new Relationship("it's fine"), "Hang on the Line").show(builder.asConnectedGlyphs("action"));
    sunny.withObjects(new Relationship("it's wet"), "Hang on the Dryer").show(builder.asConnectedGlyphs("action"));

    return builder.getDiagram();
  }
View Full Code Here

  @Test
  @Kite9Item
  public void test_17_1_TestArchitectureWizard() throws IOException {
    DiagramBuilder db = createBuilder();
    String rh = "Rob's Architecture";
    ObjectBuilder context = db.withObjects(rh).show(db.asConnectedContexts());
    ClassDiagramWizard erw = new ClassDiagramWizard(db);
    erw.show(context.withClasses(JavaRelationships.CLASS_GROUP, Test17ClassDiagramWizard.class).withInnerClasses(null, false));
    renderDiagram(db.getDiagram());
  }
View Full Code Here

    s.add(db.withObjects(o));
    while (s.size() > 0) {
      AbstractBuilder ob = s.pop();
      if (ob instanceof ObjectBuilder) {
        if (((ObjectBuilder) ob).size()>0) {
          ObjectBuilder notDoneYet = ((ObjectBuilder)ob).reduce(db.not(db.onlyOnDiagram()));
          ObjectBuilder alreadyDone = ((ObjectBuilder)ob).reduce(db.onlyOnDiagram());
          notDoneYet.show(objectFormatNew);
          alreadyDone.show(objectFormatExisting);
          if (isShowFieldValues()) {
            s.add(notDoneYet.withFieldValues(fieldFilter));
          }
          if (isShowMethodReturnValues()) {
            s.add(notDoneYet.withMethodReturnValues(methodFilter));
View Full Code Here

  }

  @Kite9Item
  public Diagram example_1_5_UseCases(DiagramBuilder builder) throws IOException {
    // show use cases inside a context
    PackageBuilder ucp = builder.withPackages(UseCase.class);
    ucp.show(builder.asConnectedContexts());
    ClassBuilder uc = ucp.withMemberClasses(builder.not(builder.only(UseCase.class, Uses.class)));
    uc.show(builder.asConnectedGlyphs(null));

    // show actors inside context
    PackageBuilder ac = builder.withPackages(Actor.class);
    ac.show(builder.asConnectedContexts(true, Layout.VERTICAL));
    ClassBuilder contents = ac.withMembers(Person.class);
    contents.show(builder.asConnectedGlyphs());
    contents.withMethods(null, false).show(builder.asTextLines());
    contents.withSubClasses(builder.onlyAnnotated(), true).show(builder.asConnectedGlyphs())
      .withMethods(null, false).show(builder.asTextLines());
    // show references between the two
View Full Code Here

    return d;
  }

  @Kite9Item
  public Diagram example_1_6_Packaging(DiagramBuilder db) throws IOException {
    PackageBuilder p1 = db.withPackages(UseCase.class, Actor.class, Uses.class);
    p1.show(db.asConnectedGlyphs());
    p1.withMemberClasses(null).show(db.asTextLines());
    p1.withDependencies(new Filter<Package>() {

      public boolean accept(Package o) {
        return o.getName().startsWith("org.kite9.java.examples");
      }
View Full Code Here

TOP

Related Classes of org.kite9.diagram.builders.java.ObjectBuilder

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.