Package org.kite9.diagram.adl

Examples of org.kite9.diagram.adl.Context


        DiagramElement out = representing == null ? null : contents
            .get(representing);
        if (out == null) {
          within = within == null ? getDiagram() : within;
          String id = idHelper.getId(representing);
          out = new Context(id, null, border, border ? overrideLabel
              : null, d);
          contents.put(representing, out);
          within.getContents().add((Context) out);
          ((Context) out).setContainer(within);
        }
View Full Code Here


      }
    }
   
    if (itemsToSubdivide.size() > 0) {
      // ok, we need to introduce a context
      Context c2 = cf.createContextFor(c, new ArrayList<Contained>(itemsToSubdivide), getInsertionInterface());
      c.getContents().add(firstIndex, c2);
      c.getContents().removeAll(itemsToSubdivide);
    }
  }
View Full Code Here

   
    db.introduceContexts(includedArrows, new DiagramBuilder.ContextFactory() {

      public Context createContextFor(Container subdivisionOf, List<Contained> contents, InsertionInterface ii) {
        Layout l = (subdivisionOf instanceof Context) ? ((Context)subdivisionOf).getLayoutDirection() null;
        return new Context(subdivisionOf.getID()+"-arrows", contents, false, null, l);
      }
     
    });
   
    db.introduceContexts(includedGlyphs, new DiagramBuilder.ContextFactory() {

      public Context createContextFor(Container subdivisionOf, List<Contained> contents, InsertionInterface ii) {
        Layout l = null;
        if (subdivisionOf instanceof Context) {
          // clear layout direction as it is inherited by the child contexts now
          l = ((Context)subdivisionOf).getLayoutDirection();
          ((Context)subdivisionOf).setLayoutDirection(null);
        }
       
        return new Context(subdivisionOf.getID()+"-glyphs", contents, false, null, l);
      }
     
    });
   
  }
View Full Code Here

  @Kite9Item
  public Diagram someDesignItem() {
    Glyph g1 = new Glyph("stereo", "project:" + this.getClass().getName(), null, null);
    Glyph g2 = new Glyph("stereo", "project:" + Another.class.getName(), null, null);

    return new Diagram("somename", createList((Contained) g1, g2), null);
  }
View Full Code Here

  }
 
  @Kite9Item
  public Diagram simpleDiagram(DiagramBuilder db) {
    Glyph test = new Glyph("project_class:bob", "this is a", "test", null, null);
    Diagram out = new Diagram("some diagram", createList((Contained) test), null);
    return out;
  }
View Full Code Here

   *
   * @return
   */
  @Kite9Item
  public Diagram someDesignItem() {
    Glyph g1 = new Glyph("stereo", "project:" + this.getClass().getName(), null, null);
    Glyph g2 = new Glyph("stereo", "project:" + Another.class.getName(), null, null);

    return new Diagram("somename", createList((Contained) g1, g2), null);
  }
View Full Code Here

    FileDiff.filesContainSameLines(f2, f2comp);
  }
 
  @Kite9Item
  public Diagram simpleDiagram(DiagramBuilder db) {
    Glyph test = new Glyph("project_class:bob", "this is a", "test", null, null);
    Diagram out = new Diagram("some diagram", createList((Contained) test), null);
    return out;
  }
View Full Code Here

      final Layout d, final Label l) {
    return new NounFormat() {
      public Connected returnElement(Container c, SimpleNoun to,
          InsertionInterface ii) {
        Label toUse = (l == null) ? (to.getLabel() == null ? null
            : new TextLine(to.getLabel())) : l;
        DiagramElement de = ii.returnContext(c, to, border ? toUse
            : null, border, d);
        if (de instanceof Connected) {
          return (Connected) de;
        } else {
View Full Code Here

          boolean arrowPreExists = ii.returnExisting(sr) instanceof Arrow;
         
          DiagramElement arrowEl = ii.returnConnectionBody(cont, sr,
              (String) activeVerb.getObjectForAlias());
          String fromLabel = getLabel(subject, from, ii);
          TextLine fromLabelTL = fromLabel.length() == 0 ? null
              : new TextLine(fromLabel);
          String toLabel = getLabel(object, to, ii);
          TextLine toLabelTL = toLabel.length() == 0 ? null
              : new TextLine(toLabel);

          Direction direction = d == null ? activeVerb.getDirection()
              : d;
          if (verb.getType() == RelationshipType.PASSIVE) {
            ii.returnConnection(toEl, arrowEl, or, toLabelTL, null, false, direction);
View Full Code Here

public class Test4Package extends AbstractBuilderTest {

    @Kite9Item
    @Test
    public void test_4_1_PackageAsContext() throws IOException {
  DiagramBuilder db = createBuilder();
  db.withPackages(Test4Package.class)
    .show(db.asConnectedContexts())
    .withMembers(Test4Package.class)
      .show(db.asConnectedGlyphs());
  renderDiagram(db.getDiagram());
 
    }
View Full Code Here

TOP

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

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.